You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using Data Driven Tests with an array of test data which is reading the credentials from an .env-file (passwords, cleartext). I used the CodeceptJS function secret() to hide them and expected to see the tests use the correct password, and that it is only hidden in outputs.
Expected output is:
The test feature --
The scenario | {"username":"Username","password": ***}
'The real password: theLoggedPasswordInCleartext'
I.fillField('somePasswordLocator', '****')
✔ OK in 7ms
The scenario | {"username":"theSecondUsername","password": ***}
'The real password: theLoggedPasswordInCleartext'
I.fillField('somePasswordLocator', '****')
✔ OK in 1ms
What do you get instead?
The passwords are not only hidden in the outputs, but the asterisks are also used within the tests. Which makes logging in impossible.
The test feature --
The scenario | {"username":"Username","password": ***}
'The real password: ****'
I.fillField('somePasswordLocator', '****')
✖
The scenario | {"username":"theSecondUsername","password": ***}
'The real password: ****'
I.fillField('somePasswordLocator', '****')
✖
Testfile
constaccounts=newDataTable(['role','username','password']);accounts.add(['ROLE_A',process.env['FIRST_USERNAME'],secret(process.env['FIRST_PASSWORD']),]);accounts.add(['ROLE_B',process.env['SECOND_USERNAME'],secret(process.env['SECOND_PASSWORD']),]);Data(accounts).Scenario('ScenarioTitle',({ I, pageObject, current })=>{I.say("Given I'am logged in");I.amOnPage('/');loginPage.**sendForm**(current.username,current.password);)
Might be related to the changes from this issue: #3429
The text was updated successfully, but these errors were encountered:
KreuzigTobias
changed the title
Passwords stored with secret() are written to output as asterisks ("****")
Passwords stored with secret() are written into inputs as asterisks ("****") not as the actual string
Sep 21, 2023
What are you trying to achieve?
Using Data Driven Tests with an array of test data which is reading the credentials from an .env-file (passwords, cleartext). I used the CodeceptJS function secret() to hide them and expected to see the tests use the correct password, and that it is only hidden in outputs.
Expected output is:
What do you get instead?
The passwords are not only hidden in the outputs, but the asterisks are also used within the tests. Which makes logging in impossible.
Testfile
loginPageObject
Details
Might be related to the changes from this issue:
#3429
The text was updated successfully, but these errors were encountered: