Skip to content

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

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 Node Version TypeScript: 5.8 License: MIT PRs Welcome Sponsor on Dodo Payments 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 @ritualdev-lab/autoheal @ritualdev-lab/autoheal-interceptor
# or run from source:
git clone https://github.com/RitualDev-Lab/autoheal-qa.git && cd autoheal-qa && pnpm install && pnpm build

2. Configure Playwright Reporter

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

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

export default defineConfig({
  reporter: [
    ["list"],
    ["@ritualdev-lab/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

๐Ÿ’– Sponsor & Support via Dodo Payments

AutoHeal-QA is a 100% free, local-first open-source test auto-healer. Your sponsorship directly finances multi-browser Playwright test matrix runner hours (Chromium, Firefox, WebKit), local Ollama LLM integration tests, and AST mutation engines.

Sponsor on Dodo Payments Interactive Donation Portal GitHub Sponsors


โšก 1-Click Dodo Payments Checkout ย โ€ขย  ๐ŸŽ Interactive Donation Form (USD & INR UPI) ย โ€ขย  โค๏ธ GitHub Sponsors

๐Ÿ”’ Zero physical shipping required. Powered by Dodo Payments (Merchant of Record) with instant tax invoice and global payment methods (Cards, UPI, Apple Pay).

๐Ÿ“„ 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