-
-
Notifications
You must be signed in to change notification settings - Fork 742
Closed
Description
What are you trying to achieve?
Using Data Driven Tests with an array of test data which contains credentials (passwords, secrets). I used the CodeceptJS function secret()
to store them and expected to not see the passwords in the output (instead, see it masked like when not using data-driven tests).
Expected output is:
The test feature --
The scenario | {"username":"Username","password": ***}
✔ OK in 7ms
The scenario | {"username":"theSecondUsername","password": ***}
✔ OK in 1ms
(or similar)
What do you get instead?
The passwords are printed to the output.
Current output is:
The test feature --
The scenario | {"username":"Username","password":{"_secret":"theSecretPassword"}}
✔ OK in 7ms
The scenario | {"username":"theSecondUsername","password":{"_secret":"AnotherSecretPassword"}}
✔ OK in 1ms
Test source code I used:
const testAccounts = new DataTable(['username', 'password']);
testAccounts.add(['Username', secret('theSecretPassword')]);
testAccounts.add(['theSecondUsername', secret('AnotherSecretPassword')]);
Feature('The test feature');
Data(testAccounts).Scenario('The scenario', ({ current }) => {
...
});
Details
- CodeceptJS version: 3.3.3
- NodeJS Version: v15.14.0
- Operating System: MacOS
I took a quick look, but I am not confident:
This may be related to the function replaceTitle
in lib/data/context.js
CodeceptJS/lib/data/context.js
Line 66 in 0903d05
return `${title} | {${JSON.stringify(dataRow.data)}}`; |
Metadata
Metadata
Assignees
Labels
No labels