Repository navigation
Open
Labels
Description
🚀 Feature Request
// Current implementation
await page.getByPlaceholder('Password').fill(process.env.USER_PASSWORD);
// Report shows: Fill "actualPasswordValue123"
The sensitive value appears in:
HTML test reports
Trace viewer
Console logs
CI/CD artifacts
**Current Workaround:**
// Manual masking using evaluate
await passwordField.evaluate((el, val) => {
el.value = val;
el.dispatchEvent(new Event('input', { bubbles: true }));
}, secretValue);
**Proposed Solution**
Add a built-in method or option to mask sensitive input values in reports.
Option 1: New method fillSensitive()
await page.getByPlaceholder('Password').fillSensitive(process.env.USER_PASSWORD);
// Report shows: Fill "********" or Fill "[REDACTED]"
Option 2: Add mask option to existing fill() method
await page.getByPlaceholder('Password').fill(process.env.USER_PASSWORD, { mask: true });
// Report shows: Fill "********"
### Example
```typescript
// Login test with sensitive credentials
async login(username: string, password: string) {
await this.usernameField.fill(username);
// Current: Password visible in reports
await this.passwordField.fill(password);
// Proposed: Password masked in reports
await this.passwordField.fillSensitive(password);
// OR
await this.passwordField.fill(password, { mask: true });
}
### Motivation
**Security Compliance**: Prevents accidental exposure of credentials in test artifacts that may be shared with stakeholders or stored in version control.
**Developer Experience:** Provides a simple, intuitive API without requiring custom workarounds.
**Industry Standard**: Similar to how many frameworks handle sensitive data logging.
**Real-world Impact:** Affects teams testing authentication flows, API integrations, payment systems, and any application using environment variables for secrets.
This feature would significantly improve security posture for teams using Playwright in enterprise environments where test reports are reviewed by security auditors or shared across teams.Reacted by Ilya Rybakov, Mike Matuszak, Rodrigo Silva Ferreira, Jon Vanausdeln, Christopher Mead, Marie Idleman, Tim Mok, ianahilario, robin-maenhaut-fluvius, Noam Cattan and 8 more
Activity
dgozman commentedon Jan 5, 2026
TRNVNP KUMAR BEZAWADA (@playwrightwork-source) Any information produced by Playwright might include sensitive information. We recommend treating reports, traces and other artifacts as sensitive information and ensure proper access control to it.
playwrightwork-source commentedon Jan 5, 2026
Dmitry Gozman (@dgozman) thanks for your reply and provide the reference
It is good to provide the direct way to mask/hide sensitive information via built in methods can use it playwright config/env files/spec files etc. so sensitive information can be hidden from the code itself and have the more control
As playwright already widely used any direct simple playwright native method implementation from playwright is highly appreciated from security prospective 👍
As the reports are sharing to clients via automation it is impossible to hide secret information like credentials and other secret information
bakoppad commentedon Mar 28, 2026
Yes, the masking sensitive information in the playwright report is much needed, please consider it as high priority
aliuk2012 commentedon Mar 31, 2026
I agree this is a much needed feature. I do like the proposed Option 1 because it shows the developers intent to flag the text as sensitive and I would be happy for it not to show up in the reports. Very difficult justify using playwright when passwords are exposed in the generated report
feat(reporters): add secrets option to redact sensitive values
feat(test runner): add secrets option to trace to redact sensitive va…
chore: mark v0.1.23 (#494)
playwrightwork-source commentedon Nov 8, 2026
Hi Dmitry Gozman (@dgozman) and team. This issue is closed with the v1.65 label. But the reporter and trace secrets option was reverted in #43870 before the 1.65.0 release ("not ready for the release"). The 1.65.0 package has no secrets option.
Could you please tell us:
Is this feature planned for a later release (for example 1.66)?
We are curious to see the the credentials hide in our playwright reports.
dgozman commentedon Nov 9, 2026
TRNVNP KUMAR BEZAWADA (@playwrightwork-source) Thank you for bringing our attention to this. The feature was deemed as not yet ready for a public release, so it was pulled back from v1.65. We'll see what we can do to make it ready for a public release.
ariaSnapshot()#44205 as a duplicate of this issue