Use this file to discover all available pages before exploring further.
Auto-healing tests automatically fix themselves when your application changes. By integrating GitHub Copilot with TestDriver in your CI pipeline, you can have AI investigate test failures and propose fixes.
Here’s what auto-healing looks like when a button’s text changes:
1
Application Changes
A developer changes a button’s text from “Submit” to “Send”:
<!-- Before --><button>Submit</button><!-- After --><button>Send</button>
2
Test Fails
The test fails because it’s looking for the old text:
// This now failsconst submitButton = await testdriver.find("Submit button");
3
Auto-Heal Triggers
The auto-heal workflow runs, and Copilot investigates:
The test is looking for a "Submit button" but I see a "Send button"on the page. The button functionality is the same, just the text changed.I'll update the test to use the new text.
4
PR Created
A pull request is opened with the fix:
// Updated by auto-healconst submitButton = await testdriver.find("Send button");
Add instructions to constrain what the AI can change:
- name: Invoke Copilot to fix tests uses: github/copilot-action@v1 with: prompt: | @testdriver Fix the failing tests. Rules: - Only update element selectors and text matching - Do not change test logic or assertions - Do not add or remove tests - Keep changes minimal
Auto-heal is a tool, not a replacement for human judgment. Review all changes before merging to ensure the test still validates what you intended.
Use descriptive element descriptions
Tests with clear, semantic descriptions are easier for the AI to heal:
// ✅ Good - describes purposeawait testdriver.find("primary call-to-action button in the hero section");// ❌ Bad - too vagueawait testdriver.find("button");
Set up notifications
Configure GitHub notifications or Slack integration to be alerted when auto-heal PRs are created.
Track heal rate
Monitor how often tests need healing. High heal rates may indicate: