How It Works
Triage: Bug or Healable?
The first thing the healing agent does is triage every failure in the test run. For each failing test, the agent:- Reads the test results and error context (screenshots, error messages, stack traces)
- Reads the relevant test code and application code
- Classifies the failure as one of:
- Test issue — the app is fine but the test needs fixing (selector drift, timing, stale setup, assertion drift). These proceed to the fix stage.
- Application bug — a real defect in your product. The agent submits a
bugverdict and tags the test with@bugin the source code. These are tracked in the Feature Health Dashboard for your team to address.
- Bug — confirmed application issue (won’t be healed)
- Clear — test is healthy
- Under Healing — a healing agent session is actively working on a fix
Triggering Healing
Automatic
Healing triggers automatically when tests fail in CI and the failures are classified as healable.Via API
You can trigger healing programmatically for any test run:| Parameter | Type | Required | Description |
|---|---|---|---|
testRunId | string | Yes | The test run to heal |
autoCreatePR | boolean | No | Auto-create a PR with fixes (default: true) |
branch | string | No | Branch to create the PR against |
prNumber | number | No | Associate healing with an existing PR |
metadata | object | No | Arbitrary key-value pairs included as context in the agent’s prompt |
Deep vs Standard Healing
Like test generation, healing supports two modes:Standard Healing
The agent triages failures, then fixes the healable ones:- Triage — classifies each failure as an application bug or a test issue. Submits verdicts for real bugs.
- Fix — fixes test-local issues (selectors, timing, setup, assertions), runs the tests to verify, and commits the changes.
Deep Healing
Thorough analysis — the agent first plans the fixes, builds understanding of what changed in your app, then implements repairs.What the Agent Fixes
| Issue | How It’s Healed |
|---|---|
| Selector drift | Updates data-testid, role, or text selectors to match current DOM |
| Timing / waits | Replaces arbitrary waits with Playwright web-first assertions |
| Assertion mismatches | Updates expected values to match current app behavior |
| Setup / cleanup changes | Adjusts data setup and cleanup when API endpoints or data models change |
| Flow changes | Adds, removes, or reorders test steps to match the current user flow |
| Page layout changes | Adapts to restructured pages, moved elements, or new UI components |
| Authentication flow changes | Handles updated login, SSO, or multi-factor auth steps |
| API endpoint changes | Updates API calls in data setup/cleanup when backend endpoints change |
Reviewing Healed Tests
When healing completes, you’ll receive a PR with the changes. Review it just like any other PR:- Read the diff — what was changed and why
- Run the tests locally to verify they pass
- Merge when satisfied