Skip to content

Repository files navigation

๐Ÿ”ฎ AutoHeal-QA

100% Free, Open-Source Self-Healing E2E Test Runner for Playwright

Stop manually fixing broken locators after every UI redesign. Heal your Playwright test suites locally with $0 cloud cost.

CI Workflow Running Cost: $0 Playwright: 1.50+ Local AI: Ollama TypeScript: 5.8 License: MIT PRs Welcome Featured on DevShelf

โšก Quick Start โ€ข โš–๏ธ Why AutoHeal-QA โ€ข ๐Ÿ—๏ธ Architecture โ€ข ๐Ÿ“– Usage Guide โ€ข ๐Ÿ“š DevShelf Ecosystem


โšก Why AutoHeal-QA?

Flaky tests and UI redesigns waste hundreds of engineering hours every month. Existing self-healing tools either:

  • Require expensive cloud subscriptions ($1,000s/mo per seat).
  • Leak proprietary DOM snapshots and credentials to 3rd-party LLM APIs.
  • Blindly patch source code without verifying if the fix actually passes.

AutoHeal-QA solves this once and for all:

  • 100% Free & Local: Deterministic algorithms first ($0, <1ms), with local Ollama models (qwen2.5-coder, llama3.2) for complex UI rewrites. Zero cloud API tokens required.
  • Surgical Auto-Patcher: Intelligently updates your actual .spec.ts files while preserving indentation, chaining (.click(), .fill()), and formatting.
  • Verification Loop: Automatically re-runs the failed test before committing. If the patch fails, it auto-rolls back from backup and tries alternative candidates.
  • Safe by Default: Automatically creates .autoheal-backup snapshots before modifying disk. Revert anytime with autoheal rollback.

๐Ÿ“Š Comparison: AutoHeal-QA vs Commercial Tools

Feature AutoHeal-QA Commercial Cloud QA (Mabl, Testim) Legacy Plugins (Healenium)
Pricing 100% Free & Open Source ($0) $1,200 โ€“ $5,000 / month Free, but requires Docker/DB setup
Privacy / Data Security 100% In-Process & Local Code & DOM sent to cloud Local backend required
AI Architecture Multi-Tiered (Heuristics + Local Ollama) Proprietary Cloud Models Classical ML (Selenium only)
Playwright Native โœ… Native โš ๏ธ Wrapper / Vendor Lock-in โŒ Selenium-centric
Surgical Code Patching โœ… Modifies source files โŒ No (cloud dashboard only) โŒ No (database locator store)
Verification Loop โœ… Auto-verifies before commit โŒ Manual review โŒ No auto-verification
Instant Rollback โœ… autoheal rollback โŒ No โŒ No

๐Ÿ—๏ธ Architecture & How It Works

flowchart TD
    A[Playwright Test Fails] --> B[AutoHeal Interception Engine]
    B --> C[Page State Harvester: Live AXTree + Pruned DOM]
    C --> D{Tier 1: Deterministic Heuristic Engine}
    
    D -->|Confidence >= 85%| G[Surgical Patcher & Diff Preview]
    D -->|Ambiguous / Low Confidence| E{Local Ollama Available?}
    
    E -->|Yes| F[Tier 2: Local AI Reasoning - Qwen2.5 / Llama3.2]
    E -->|Offline| H[Tier 3: Graceful Heuristic Fallback]
    
    F --> G
    H --> G
    
    G --> I[Verification Loop: Re-run Specific Test]
    I -->|Passed| J[โœ… Commit Patch & Clean Backup]
    I -->|Failed| K[๐Ÿ”„ Auto-Rollback from Backup & Try Next Candidate]
Loading

๐Ÿš€ Quickstart in 30 Seconds

1. Install AutoHeal-QA

pnpm add -D autoheal
# or
npm install --save-dev autoheal

2. Configure Playwright Reporter

Add @autoheal/interceptor to your playwright.config.ts:

import { defineConfig } from "@playwright/test";

export default defineConfig({
  reporter: [
    ["list"],
    ["@autoheal/interceptor", { outputFile: "autoheal-failures.json" }],
  ],
});

3. Run Your Tests with AutoHeal

autoheal test

If any locators break, AutoHeal intercepts the failure and captures the live accessibility snapshot.

4. Interactively Review & Apply Patches

autoheal heal

You will see an instant colorized diff preview:

[#1/1] Authentication Suite > user logs in successfully
Broken: page.getByRole('button', { name: 'Submit' })
File:   tests/auth.spec.ts:14

๐Ÿ” Analyzing candidates and finding optimal replacement...
โœจ Suggested: page.getByRole('button', { name: 'Sign In to Account' }) (95% confidence) [โšก Local Heuristics ($0)]
   Reason:    Matching button with 92% text similarity to name "Sign In to Account"

๐Ÿ“‹ Proposed Diff Preview:
--- a/tests/auth.spec.ts:14
+++ b/tests/auth.spec.ts:14
@@ -14,1 +14,1 @@
-   await page.getByRole('button', { name: 'Submit' }).click();
+   await page.getByRole('button', { name: 'Sign In to Account' }).click();

๐Ÿ‘‰ Apply this patch? [Y]es / [n]o / [a]ll / [q]uit: y
โณ Verifying patch with Playwright runner...
โœ… Verification PASSED: Tests pass with new locator! Committed to auth.spec.ts.

๐Ÿ’ป CLI Command Reference

Command Description
autoheal test [args...] Runs Playwright tests with AutoHeal failure interception active.
autoheal test --heal Runs Playwright and automatically triggers interactive healing if any tests fail.
autoheal heal Interactively reviews failed tests and applies verified patches.
autoheal heal --yes Automatically verifies and applies all patches without interactive prompts (ideal for CI/CD).
autoheal heal --no-verify Applies patches immediately without re-running test verification.
autoheal report Generates a visual standalone HTML dashboard (autoheal-report.html).
autoheal rollback Reverts all .autoheal-backup files across the workspace.

๐ŸŽจ Standalone Visual HTML Report

Whenever tests fail, AutoHeal automatically compiles an interactive, dark-mode visual report:

autoheal report

Open autoheal-report.html in your browser to view:

  • Overview Metrics: Total failures, captured DOM snapshots, running cost ($0.00).
  • Comparison Cards: Side-by-side broken locator vs suggested replacement.
  • Confidence Meters: Transparent score breakdowns (role matching, string distance, action compatibility).
  • Interactive AXTree Inspector: Expandable candidate elements captured at the exact moment of failure.

๐Ÿงช Try the Demo Sandbox

Clone this repository and run the included interactive demo:

git clone https://github.com/RitualDev-Lab/autoheal-qa.git
cd autoheal-qa
pnpm install
pnpm build

# Run the demo
cd examples/demo-app
pnpm run test:heal

๐Ÿ’– Support & GitHub Sponsors

AutoHeal-QA is built as a 100% free, community-first open-source alternative to closed-source enterprise test automation tools. We believe world-class QA engineering should be accessible to every solo developer and startup without massive monthly bills.

If AutoHeal-QA saves your team hours of flaky test debugging, please consider supporting ongoing development:

  • โญ Star this repository on GitHub.
  • ๐Ÿ’ฌ Share AutoHeal-QA on Twitter/X, LinkedIn, and Reddit.
  • โ˜• Sponsor on GitHub Sponsors: Help us keep AutoHeal-QA 100% free and independent.

๐Ÿ“„ License

Distributed under the MIT License. See LICENSE for details.

About

๐Ÿ”ฎ The 100% Free, Local-First Agentic Self-Healing E2E Test Runner for Playwright. $0 cloud cost, AST patcher & verification loop.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages