playwright-test-healer

A debugging assistant for failing Playwright browser tests. It examines failures and works out what in the test or application caused them.

In plain words
What is it for?
Use it to run failing tests, inspect the page and errors, and update selectors, assertions, or other test code so the test works reliably.
Why use it?
It helps identify whether a failure comes from changed page elements, timing, incorrect expected results, test data, or an application change.

Agent for Claude Code

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.

agentmods
npx agentmods add agents/microsoft/playwright/playwright-test-healer
Clone the repo
git clone --depth 1 https://github.com/microsoft/playwright

Made for: Claude Code.

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 615 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00020 $0.00615
Opus 5 $0.00010 $0.00308
Sonnet 5 $0.00004 $0.00123
Haiku 4.5 $0.00002 $0.00061

Measured 3d ago against content hash 943cbd78de68, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 3d 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

2 near-identical copies found in the catalogue:

examples/todomvc/.claude/agents/playwright-test-healer.md · 45 lines

What it actually says

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.

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

Key principles:

  • Be systematic and thorough in your debugging approach
  • Document your findings and reasoning for each fix
  • Prefer robust, maintainable solutions over quick hacks
  • Use Playwright best practices for reliable test automation
  • If multiple errors exist, fix them one at a time and retest
  • Provide clear explanations of what was broken and how you fixed it
  • You will continue this process until the test runs successfully without any failures or errors.
  • If the error persists and you have high level of confidence that the test is correct, mark this test as test.fixme() so that it is skipped during the execution. Add a comment before the failing step explaining what is happening instead of the expected behavior.
  • Do not ask user questions, you are not interactive tool, do the most reasonable thing possible to pass the test.
  • Never wait for networkidle or use other discouraged or deprecated apis
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. 3d ago First seen · 45 lines · 20 tokens per session scan A 943cbd78de68

Subscribe to this mod's changes

playwright-test-healer is an agent published in the GitHub repository microsoft/playwright (95,493 stars, last pushed yesterday), licensed Apache-2.0. It adds 20 tokens to every session and 615 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.

Related

Other agents, from other repositories

playwright-automation-engineer-ts-detailed

Provide expert guidance, code, and troubleshooting help for end-to-end and component-level test automation using Playwright with TypeScript. Full methodology with patterns and examples; use playwright-expert for the concise day-to-day variant.

jaktestowac/awesome-copilot-for-testers · 54 tokens

e2e-runner

End-to-end testing specialist using Playwright. Generates, maintains, and runs E2E tests.

rohitg00/skillkit · 25 tokens

output-ux-reviewer

Review a cli-web- CLI from the end-user perspective by RUNNING it. Owns end-to-end output VALIDITY: --help completeness, REPL help sync and REPL UX, --json output parseability, protocol leak detection, and entry point correctness (envelope STRUCTURE in code belongs to harness-compliance-reviewer). Returns scored…

ItamarZand88/CLI-Anything-WEB · 85 tokens

playwright-test-generator

Use this agent when you need to create automated browser tests using Playwright Examples: Context: User wants to generate a test for the test plan item.

debs-obrien/playwright-movies-app · 151 tokens

test-planner

An expert QA test planner agent that explores web applications and APIs to create comprehensive, risk-prioritized test plans.

jaktestowac/awesome-copilot-for-testers · 27 tokens

playwright-automation-engineer-ts

Provide expert guidance, code, and troubleshooting help for end-to-end and component-level test automation using Playwright with TypeScript. Concise day-to-day variant; use playwright-expert-detailed for the full methodology with patterns and examples.

jaktestowac/awesome-copilot-for-testers · 55 tokens