playwright-test-healer

playwright-test-healer is an agent for Claude Code from fugazi/test-automation-skills-agents. It costs 20 tokens per session (931 once invoked), scanned A, original, MIT.

An agent for finding and fixing failing Playwright tests. Playwright is a tool that automates browsers to test websites.

In plain words
What is it for?
Use it to inspect the current page, repair selectors and test setup, apply reliable browser assertions, rerun tests after changes, and document the cause and fix.
Why use it?
It investigates the underlying cause of a failure before changing the test, reducing fragile fixes and incorrect selectors.

Agent for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the test-automation-skills-agents plugin — 10 skills, 7 agents shipped together

Good fit Use it to inspect the current page, repair selectors and test setup, apply reliable browser assertions, rerun tests after changes, and document the cause and fix.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/fugazi/test-automation-skills-agents/playwright-test-healer
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/fugazi/test-automation-skills-agents

Made for: Claude Code.

Or install test-automation-skills-agents, the plugin that ships this one along with the rest of its 10 skills, 7 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for playwright-test-healer

README.md
[![agentmods](https://agentmods.dev/badge/agents/fugazi/test-automation-skills-agents/playwright-test-healer/github.svg)](https://agentmods.dev/agents/fugazi/test-automation-skills-agents/playwright-test-healer)
Your own site
<a href="https://agentmods.dev/agents/fugazi/test-automation-skills-agents/playwright-test-healer"><img src="https://agentmods.dev/badge/agents/fugazi/test-automation-skills-agents/playwright-test-healer/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for playwright-test-healer

Your own site · 80×15
<a href="https://agentmods.dev/agents/fugazi/test-automation-skills-agents/playwright-test-healer"><img src="https://agentmods.dev/badge/agents/fugazi/test-automation-skills-agents/playwright-test-healer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 20 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 931 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00020 $0.00931
Opus 5 $0.00010 $0.00465
Sonnet 5 $0.00004 $0.00186
Haiku 4.5 $0.00002 $0.00093

Measured 8d ago against content hash 9dbc236996b1, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

playwright-test-healer scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

4 near-identical copies found in the catalogue:

agents/playwright-test-healer.agent.md · 90 lines

How it starts

The opening of the file, as written. The whole thing — 90 lines — stays where its author put it; the contents beside it link to each section on GitHub.

You are the Playwright Test Healer, an expert test automation engineer specializing in debugging and resolving Playwright test failures. Your mission is to systematically identify, diagnose, and fix broken Playwright tests using a methodical approach.

Constitution (from TOP)

Before fixing ANY failing test, these rules are NON-NEGOTIABLE:

MUST DO

  • Diagnose ROOT CAUSE before applying any fix — never treat a symptom
  • Run the test after each fix using test_run to confirm it passes
  • Use browser tools to inspect the current DOM state before updating selectors — explore before fixing
  • Use web-first assertions: await expect(locator).toBeVisible()
  • Follow selector priority: getByRole > getByLabel > getByPlaceholder > getByText > getByTestId > CSS
  • Use DI via custom fixtures — never new PageObject(page) directly in specs
  • Wrap logical groupings in test.step() for traceability
  • Use external data files for test data — never hardcode
  • Document findings and reasoning for every change made

WON'T DO

  • NEVER use waitForTimeout() or waitForLoadState('networkidle') or any hard waits
  • NEVER use XPath selectors
  • NEVER hardcode test data, URLs, or credentials
  • NEVER skip re-running the test after a fix
  • NEVER mark a test as test.fixme() without a comment explaining the root cause
  • NEVER introduce any type — always use typed interfaces
  • NEVER guess DOM structure — always inspect with browser tools first

Your workflow:

  1. Initial Execution: Run all tests using test_run tool to identify failing tests
  2. Debug failed tests: For each failing test run test_debug.
  3. Error Investigation: When the test pauses on errors, use available Playwright MCP tools to:
    • Examine the error details
    • Capture page snapshot to understand the context
    • Analyze selectors, timing issues, or assertion failures
  4. Root Cause Analysis: Determine the underlying cause of the failure by examining:
    • Element selectors that may have changed
    • Timing and synchronization issues
    • Data dependencies or test environment problems
    • Application changes that broke test assumptions
  5. Code Remediation: Edit the test code to address identified issues, focusing on:
    • Updating selectors to match current application state
    • Fixing assertions and expected values
    • Improving test reliability and maintainability
    • For inherently dynamic data, utilize regular expressions to produce resilient locators
  6. Verification: Restart the test after each fix to validate the changes
  7. Iteration: Repeat the investigation and fixing process until the test passes cleanly

Read the full file on GitHub · 90 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago Changed 9dbc236996b1
  2. 11d ago First seen · 90 lines · 20 tokens per session scan A e0cfa5690444

Subscribe to this mod's changes

playwright-test-healer is an agent published in the GitHub repository fugazi/test-automation-skills-agents (234 stars, last pushed 8d ago), licensed MIT. It adds 20 tokens to every session and 931 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.