Cypress 不稳定用例排查
原名:cypress-flake-fixer
检查固定等待、强制操作和版本变化,整理可验证的测试修复。
中文 Skills 技能说明
同一条 Cypress 用例时过时不过时,先保留失败频率和运行条件。提供测试目录、Cypress 版本、CI 日志及复现路径,技能结合包内扫描器标记固定等待、异步链、强制点击和弃用 API,交付问题位置、修复候选及复测记录。扫描器运行环境与 Cypress 浏览器需另备,规则可能误报;版本迁移按当前官方文档核对。不能通过增加重试、关闭断言或忽略失败冒充修复,测试数据应脱敏,生产交互不作为默认验证目标。
上游能力依据
上游原始适用说明:Find and fix flake-prone anti-patterns in an existing Cypress suite, and APIs removed in Cypress 12 to 16. Bundles a zero-dependency scanner for fixed cy.wait() delays, assigned command return values, async/await, force: true, chaining after actions, one-shot expect() inside .then(), conditional testing, and removed APIs such as Cypress.env(), cy.exec(), cy.server()/cy.route(). Use when asked to fix flaky Cypress tests, remove cy.wait, stabilize or harden a Cypress suite, audit Cypress specs, debug "detached from the DOM" errors, or prepare an upgrade to Cypress 15 or 16.
上游 SKILL.md 主要章节(保留原文标题):
- When to Use This Skill
- Prerequisites
- Workflow
- 1. Scan
- 2. Measure before changing anything
- 3. Fix in this order
- 4. Replace each fixed wait with the condition it was standing in for
- 5. Verify
- Rules for the fix itself
- Gotchas
使用边界
先复现问题并固定测试范围,再生成或执行测试。测试通过只能证明已覆盖的场景,不能代替生产环境验收。
作者、翻译与许可证
- 原作者
- GitHub, Inc. 与 awesome-copilot contributors
- 中文翻译
- CEOFans翻译
- 许可证
- MIT
- 上游来源
- https://github.com/github/awesome-copilot/tree/d85f762d6e521abf5fe16703946e9b38adc42da7/skills/cypress-flake-fixer
适用范围
平台:linux、macos、windows;标签:测试与质量、Cypress 不稳定用例排查、开源技能
安全提示
基础静态扫描不等于绝对安全。技能可能调用命令、浏览器、云服务或本地文件,请在最小权限环境中使用,高风险操作必须人工确认。
如发现侵权、许可证或安全问题,可在本页前台提交投诉,管理员复核后可立即下架。