[Feature]: Built-in Method to Mask Sensitive Input in Test Reports
维护者通常 1 天内回复
@dgozman 已经在做这个了。
开始于 2026年1月5日。
评估
这个 Issue 还没有评估数据。
描述
🚀 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.
- 主要语言
- TypeScript
- 星标
- 100k
- 派生
- 6.9k
- 平均合并
- 16 小时 8 分钟
- 30 天内合并 PR
- 281
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoft/playwright 的其他 Issue
-
[MCP]: page snapshots in .playwright-mcp/ are not git-ignored (.playwright-cli/ is, since #42318)未关闭
难度 2/5 1-3 小时 新手友好度 62/100
microsoft/playwright#44289 ·
维护者通常 1 天内回复
-
agent-triage-done
难度 2/5 1-3 小时 新手友好度 72/100
microsoft/playwright#44264 · 2 条评论 ·
维护者通常 1 天内回复
-
难度 5/5 一周以上 新手友好度 12/100
microsoft/playwright#44290 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 22/100
microsoft/playwright#44288 ·
维护者通常 1 天内回复
-
[Bug]: page.goto never returns for a load started as a newer service worker takes over (Chromium)未关闭
难度 5/5 一周以上 新手友好度 12/100
microsoft/playwright#44287 ·
维护者通常 1 天内回复
查看 microsoft/playwright 的全部 Issue
相似的 Issue
-
clawsweeper:needs-maintainer-review clawsweeper:needs-product-decision clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster P3
难度 2/5 1-3 小时 新手友好度 76/100
openclaw/openclaw#203385 · 1 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
nwverse/persona#12800 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 80/100
维护者通常 1 天内回复
-
good first issue
难度 2/5 半天 新手友好度 65/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
WISE-Community/WISE-Client#2404 ·
维护者通常 1 天内回复