Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ To fill in sensitive data use the `secret` function, it won't expose actual valu

```js
I.fillField('password', secret('123456'));
// you can also mask a property value in an object as an argument
I.doMyCustomLogIn({ login: 'Jan', password: secret('12345') });
```

### Assertions
Expand Down
6 changes: 5 additions & 1 deletion lib/step.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,11 @@ class Step {
} else if (arg.toString && arg.toString() !== '[object Object]') {
return arg.toString();
} else if (typeof arg === 'object') {
return JSON.stringify(arg);
return JSON.stringify(
Object.fromEntries(
Object.entries(arg).map(([key, value]) => [key, value instanceof Secret ? '*****' : value]),
),
);
}
return arg;
}).join(', ');
Expand Down
6 changes: 3 additions & 3 deletions test/acceptance/codecept.Playwright.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ module.exports.config = {
restart: process.env.BROWSER_RESTART || false,
browser: process.env.BROWSER || 'chromium',
ignoreHTTPSErrors: true,
webkit: {
ignoreHTTPSErrors: true,
}
webkit: {
ignoreHTTPSErrors: true,
},
},
JSONResponse: {
requestHelper: 'Playwright',
Expand Down