Suggest (and apply) a fix
suggest-fixPatch a failed Playwright run by replacing a drifted locator with a proven unique selector and updating changed expected text. Returns a diff; optionally applies, reruns, and reverts if still red.
Instructions
Patch a failure from the last run: a drifted locator is matched against the DOM at failure (trace, or live url) and replaced with one proven unique; changed copy gets the new expected text. Returns a diff and confidence; apply: true writes it, re-runs the test and reverts if still red. Refuses when the element is truly missing (app bug).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | Heal against this live page instead of the trace snapshot | |
| apply | No | Write the fix (default: diff only) | |
| index | No | 1-based failure index (default 1) | |
| config | No | playwright.config path or 1-based index | |
| verify | No | Re-run after applying; revert if still failing (default true) | |
| headers | No | Extra HTTP headers, e.g. Authorization | |
| timeoutMs | No | Verification run limit (default 120000) | |
| projectRoot | No | ||
| storageState | No | Logged-in session: storageState JSON inside the project, e.g. playwright/.auth/user.json | |
| allowExpectationUpdate | No | Allow applying changed expected text (can hide regressions) |