What problem does it solve?
Flaky end-to-end tests fail intermittently in CI due to race conditions, tight timeouts, and snapshot-then-assert patterns, eroding trust in the test suite and blocking merges. This Skill provides a systematic workflow to diagnose the root cause of each flake and replace it with a retry-safe alternative.
Core Features & Use Cases
- CI Evidence Gathering: Pulls Playwright reports from GitHub Actions runs with
gh CLI and locates tests marked as flaky, including ones that passed only on retry.
- Pattern Classification: Matches failing assertions against a table of ten common race-prone patterns such as immediate count checks, tight poll timeouts, and screenshots without readiness waits.
- Mechanical Transforms: Applies concrete fixes like converting
expect(await evaluate()).toBe(x) to expect.poll(), exposing locators for toHaveCount(), removing force: true clicks, and using toPass() for multi-condition settling.
- Use Case: A CI run shows a spec failing intermittently after a menu click. The Skill identifies the nextFrame-after-click race, replaces it with
contextMenu.waitForHidden(), and verifies the fix with --repeat-each 10 before monitoring the next CI run.
Quick Start
Ask the AI to diagnose and fix the flaky Playwright tests reported in the latest CI run for the current branch.