fix by alirezarezvani/claude-skills
npx skills add https://github.com/alirezarezvani/claude-skills --skill fix使用系统化的分类法诊断并修复 Playwright 测试中的失败或间歇性通过问题。
$ARGUMENTS 包含:
e2e/login.spec.ts"should redirect after login""the checkout test fails in CI but passes locally"运行测试以捕获错误:
npx playwright test <file> --reporter=list
如果测试通过,则很可能是不稳定的。运行压力测试:
npx playwright test <file> --repeat-each=10 --reporter=list
如果仍然通过,尝试使用并行工作器:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
npx playwright test --fully-parallel --workers=4 --repeat-each=5
启用完整追踪运行:
npx playwright test <file> --trace=on --retries=0
读取追踪输出。如果可用,使用 /debug 来分析追踪文件。
从本技能目录加载 flaky-taxonomy.md。
每个失败的测试都属于以下四类之一:
| 类别 | 症状 | 诊断 |
|---|---|---|
| 时序/异步 | 在任何地方都间歇性失败 | --repeat-each=20 可在本地复现 |
| 测试隔离 | 在套件中失败,单独运行通过 | --workers=1 --grep "test name" 通过 |
| 环境 | 在 CI 中失败,在本地通过 | 比较 CI 与本地截图/追踪信息 |
| 基础设施 | 随机失败,无规律 | 错误引用浏览器内部信息 |
时序/异步:
waitForTimeout()awaittoBeVisible()测试隔离:
环境:
docker 以匹配 CI 环境基础设施:
retries: 2)运行测试 10 次以确认稳定性:
npx playwright test <file> --repeat-each=10 --reporter=list
必须全部 10 次都通过。如果有任何失败,请返回步骤 3。
建议:
retries: 2trace: 'on-first-retry'每周安装量
35
仓库
GitHub 星标
2.8K
首次出现
4 天前
安全审计
安装于
claude-code33
codex33
gemini-cli32
github-copilot32
amp32
cline32
Diagnose and fix a Playwright test that fails or passes intermittently using a systematic taxonomy.
$ARGUMENTS contains:
e2e/login.spec.ts"should redirect after login""the checkout test fails in CI but passes locally"Run the test to capture the error:
npx playwright test <file> --reporter=list
If the test passes, it's likely flaky. Run burn-in:
npx playwright test <file> --repeat-each=10 --reporter=list
If it still passes, try with parallel workers:
npx playwright test --fully-parallel --workers=4 --repeat-each=5
Run with full tracing:
npx playwright test <file> --trace=on --retries=0
Read the trace output. Use /debug to analyze trace files if available.
Load flaky-taxonomy.md from this skill directory.
Every failing test falls into one of four categories:
| Category | Symptom | Diagnosis |
|---|---|---|
| Timing/Async | Fails intermittently everywhere | --repeat-each=20 reproduces locally |
| Test Isolation | Fails in suite, passes alone | --workers=1 --grep "test name" passes |
| Environment | Fails in CI, passes locally | Compare CI vs local screenshots/traces |
| Infrastructure | Random, no pattern | Error references browser internals |
Timing/Async:
waitForTimeout() with web-first assertionsawait to missing Playwright callstoBeVisible() before interacting with elementsTest Isolation:
Environment:
docker locally to match CI environmentInfrastructure:
retries: 2)Run the test 10 times to confirm stability:
npx playwright test <file> --repeat-each=10 --reporter=list
All 10 must pass. If any fail, go back to step 3.
Suggest:
retries: 2 if not alreadytrace: 'on-first-retry' in configWeekly Installs
35
Repository
GitHub Stars
2.8K
First Seen
4 days ago
Security Audits
Gen Agent Trust HubWarnSocketPassSnykPass
Installed on
claude-code33
codex33
gemini-cli32
github-copilot32
amp32
cline32
Vue JSX 最佳实践指南:与React JSX差异详解及代码迁移方案
3,300 周安装
Hyperliquid 交易技能:在链上 DEX 交易永续合约与现货,AI 代理自动执行
3,300 周安装
Nuxt UI v4 组件库 | Vue 3 & Nuxt 4+ 开发必备 | 基于 Tailwind CSS
3,300 周安装
UI/UX Pro Max 设计指南:避免AI生成感,打造高级SaaS/着陆页设计原则与实现
3,400 周安装
Three.js 动画教程 - 从程序化动画到关键帧系统完整指南
3,300 周安装
Angular v20+ 测试指南:使用 Vitest 测试信号组件与最佳实践
3,300 周安装