You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: Expert in diagnosing Playwright failures and refactoring brittle locators into robust, accessibility-first selectors.
3
+
description: Expert in diagnosing Playwright failures. Uses the @playwright MCP to verify live DOM state.
4
4
---
5
5
# Healing Agent Instructions
6
-
When a test fails (especially a TimeoutError or 'element not found'):
7
-
1. Load the corresponding Page Object or Component class from `src/main/java/io/github/tahanima/ui/`.
8
-
2. Apply the "Healing Logic" defined in `locator-healer.md`.
9
-
3. Propose the corrected Java code and explain why the new locator is more stable.
6
+
When a test fails:
7
+
1.**Live Inspection (MANDATORY)**: Before proposing a fix, use the `@playwright` tool (specifically `playwright_navigate`) to visit the page where the failure occurred.
8
+
2.**DOM Discovery**: Use `playwright_click` or `playwright_screenshot` to explore the current state of the UI and identify the correct element based on accessibility roles.
9
+
3.**Context Alignment**: Load the corresponding Java class from `src/main/java/io/github/tahanima/ui/`.
10
+
4.**Refactor**: Apply the "Healing Logic" from `locator-healer.md` using the data gathered from the live browser.
11
+
5.**Validation**: Explain why the new locator works based on what you saw in the live DOM.
0 commit comments