Audit tests for flake risks
audit-testsAudit Playwright test code for flake risks like hard waits, missing awaits and .only, rank files by past flakiness, and optionally rewrite mechanical findings then re-run and restore files if the run fails.
Instructions
Audit the Playwright test code for flake risks (hard waits, one-shot assertions instead of web-first ones, missing awaits, .only, force clicks, networkidle, element handles, layout selectors) and rank files by how flaky their tests have been in the run history. fix: true rewrites the mechanical ones, re-runs the touched files and restores them if the run fails.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fix | No | Rewrite the mechanical findings (web-first assertions, missing awaits, .only), re-run the touched files and restore them if the run fails | |
| limit | No | Max findings to list (default 50); the summary counts all | |
| config | No | playwright.config path or 1-based index, for the verify run | |
| filter | No | Case-insensitive substring filter on the file path | |
| verify | No | With fix: re-run the touched files (default true) | |
| testDir | No | Audit only this directory (inside the project); defaults to the config testDir | |
| timeoutMs | No | Wall-clock limit for the verify run | |
| historyRuns | No | How many recent runs of the local history to weigh in (default 50) | |
| minSeverity | No | Report findings at or above this severity (default low) | |
| projectRoot | No | Project directory; defaults to the server working directory |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | false when the call failed (see error) or the tests it ran failed | |
| error | No | ||
| total | No | ||
| applied | No | ||
| findings | No | ||
| verified | No | ||
| truncated | No |