Repair end-to-end tests broken by UI changes
When browser tests fail after a UI change, an agent replays them, finds what moved, and proposes updated locators or steps.
The use case
A redesign can break dozens of browser tests even when the product still works, and fixing them is tedious. Playwright's healer agent runs failing tests, inspects the current page, and proposes fixes such as updated locators, waits or changed steps, rerunning until the test passes or it decides the feature is actually broken. The output is a diff to the test files. A developer still reviews each change to make sure the test is checking the same behavior, because a healed test that clicks a different button can hide a real regression.
Example workflow
- Collect failing end-to-end tests after a UI change
- Run the healer agent on them in a test environment
- Agent proposes locator and step changes
- Review each diff against the intended behavior
- Merge fixes and file bugs for real regressions
Tools
- Playwright
Risks and guardrails
- Healing can mask real bugs by changing what is tested
- Avoid letting it weaken assertions
- Run only against test data
Sources
Written by Agents Lookup. Credits and official pages for the tools this use case names:
- Playwright docs: test agents: playwright.dev/docs/test-agents
- Playwright MCP server (official page): github.com/microsoft/playwright-mcp (checked 2026-11-09)