File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -68,6 +68,10 @@ function replaceTitle(title, dataRow) {
6868 return `${ title } | {${ JSON . stringify ( dataRow . data ) } }`
6969 }
7070
71+ if ( typeof dataRow . data . getMasked === 'function' ) {
72+ return `${ title } | ${ dataRow . data . getMasked ( ) } `
73+ }
74+
7175 // if `dataRow` is object and has own `toString()` method,
7276 // it should be printed
7377 if ( Object . prototype . toString . call ( dataRow . data ) === Object ( ) . toString ( ) && dataRow . data . toString ( ) !== Object ( ) . toString ( ) ) {
Original file line number Diff line number Diff line change @@ -122,4 +122,11 @@ describe('ui', () => {
122122 expect ( dataScenarioConfig . scenarios [ 0 ] . test . title ) . to . equal ( 'scenario | {"username":"jon","password":"snow"}' )
123123 } )
124124 } )
125+
126+ describe ( 'secret data rows' , ( ) => {
127+ it ( "should not leak a secret data row's value into the title" , ( ) => {
128+ const dataScenarioConfig = context . Data ( [ new Secret ( 'theSecretPassword' ) ] ) . Scenario ( 'scenario' , ( ) => { } )
129+ expect ( dataScenarioConfig . scenarios [ 0 ] . test . title ) . to . equal ( 'scenario | *****' )
130+ } )
131+ } )
125132} )
You can’t perform that action at this time.
0 commit comments