Analyze and fix Playwright selector
analyze_and_fix_selectorDiagnose Playwright selector failures using error messages and screenshots, then recommend stable getByRole-based locator fixes.
Instructions
Analyze Playwright failure: require reading the full spec for context first; use error message + screenshot path (and optional DOM snapshot) to suggest a stable locator fix (getByRole preferred).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| domSnapshot | No | HTML snippet at failure time (e.g. from trace or snapshot) | |
| errorMessage | Yes | Playwright error message or stack snippet | |
| originalCode | No | Relevant test/spec code snippet that failed (full spec should still be read for context) | |
| specFilePath | No | Full path to the spec file (Cursor should read entire file for context before fixing) | |
| failureContext | No | Failure context: pass 'hover' | 'fill' | 'iframe' | 'default' to include the corresponding rule and instruction (default: 'default') | |
| screenshotPath | No | Path to failure screenshot (e.g. test-results/.../test-failed-1.png); analyze screenshot with error message |