Suggest (and apply) a fix
suggest-fixRepair Playwright test failures by replacing drifted or ambiguous locators and updating changed expected text, then return a diff and confidence; optionally apply, re-run, and revert if still failing.
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; a locator that matches several elements (strict mode) gets the unique one for the intended match; 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).
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "suggest-fix"
}
}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 | |
| candidate | No | Strict mode violation: which of the listed matches the test meant (1-based) | |
| 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 | |
| verifyAllProjects | No | Verify on every project in playwright.config (e.g. chromium, firefox, webkit), not just the one that failed; revert unless all pass | |
| allowExpectationUpdate | No | Allow applying changed expected text (can hide regressions) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | false when the call failed (see error) or the tests it ran failed | |
| fix | No | ||
| error | No | ||
| applied | No | ||
| declined | No | the person declined the change; nothing was written | |
| verified | No |