[Feature]: Built-in Method to Mask Sensitive Input in Test Reports
Maintainers usually reply within 1 day
@dgozman is already working on this.
Since Jan 5, 2026.
Assessment
This issue has not been assessed yet.
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.
- Dominant language
- TypeScript
- Stars
- 100k
- Forks
- 6.9k
- Avg merge
- 16h 8m
- Merged PRs (30d)
- 281
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/playwright
-
[MCP]: page snapshots in .playwright-mcp/ are not git-ignored (.playwright-cli/ is, since #42318)Open
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
microsoft/playwright#44289 ·
Maintainers usually reply within 1 day
-
agent-triage-done
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
microsoft/playwright#44264 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 12/100
microsoft/playwright#44290 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 22/100
microsoft/playwright#44288 ·
Maintainers usually reply within 1 day
-
[Bug]: page.goto never returns for a load started as a newer service worker takes over (Chromium)Open
Difficulty 5/5 Over a week Newbie friendliness 12/100
microsoft/playwright#44287 ·
Maintainers usually reply within 1 day
All issues in microsoft/playwright
Similar issues
-
clawsweeper:needs-maintainer-review clawsweeper:needs-product-decision clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster P3
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
openclaw/openclaw#203385 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
nwverse/persona#12800 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
Maintainers usually reply within 1 day
-
good first issue
Difficulty 2/5 Half a day Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
WISE-Community/WISE-Client#2404 ·
Maintainers usually reply within 1 day