Skip to content

Self-Healing

Sentri's self-healing runtime automatically recovers from broken selectors at test execution time.

How It Works

When a selector fails, the self-healing layer tries multiple fallback strategies in a waterfall:

getByRole('button', { name }) → getByRole('link', { name })
→ getByText(exact) → getByText(partial)
→ locator([aria-label]) → locator([title])

When a fallback wins, Sentri records which strategy index succeeded for that element. On the next run, it tries the winner first — skipping strategies that previously failed.

safeCheck / safeUncheck list-item fallbacks

Checkboxes in task lists (TodoMVC), bug trackers, and settings grids are typically inside a container (<li>, <tr>, [role="listitem"], [role="row"], or class names like .item / .row / .todo / .task) where the visible label is a sibling text node rather than an ARIA label on the checkbox itself. When the direct getByRole('checkbox', { name }) and getByLabel(name) strategies miss, safeCheck and safeUncheck scope to the container by hasText and then pick the checkbox within — both getByRole('checkbox') and raw input[type="checkbox"] variants are tried.

Healing History

The healing history is stored per element, keyed by <testId>::<action>::<label>. Over time, tests become more resilient automatically as the system learns the best strategy for each element.

View healing stats on the Dashboard (self-healed count, elements tracked) and in the Healing Timeline on each test run detail page.

Failure Classification

After failures, an AI feedback loop classifies each one:

CategoryDescription
SELECTOR_ISSUEElement not found — selector changed or removed
TIMEOUTElement exists but didn't become interactive in time
ASSERTION_FAILElement found but content/state doesn't match expected
NAVIGATION_FAILPage didn't load or redirected unexpectedly

The highest-priority failing tests are auto-regenerated with context-aware fix instructions.

Clearing History

To reset the healing history and force the waterfall to start fresh:

  • UI: Settings → Data Management → Clear Self-Healing History
  • API: DELETE /api/v1/data/healing

Released under the MIT License.