Insights · Deep dive
How Each Playwright AI Agent Works
By Chetan Gupta · Published December 1, 2026 · 6-minute read
In short
A Playwright AI agent plans, writes or repairs tests; adopting the agents directly means your team owns the workflow, review steps and maintenance.
In short: A Playwright AI agent here means one of the three test agents Playwright provides: the planner, the generator or the healer. They plan, write and repair tests, and Playwright's documentation says they can run independently, sequentially or chained in an agentic loop. In our view, using them directly means assembling the workflow around them yourself.
Playwright introduced Playwright Agents in version 1.56, and the chain runs from a plan, to test files, to repairs. We read these agents as building blocks rather than a test workflow. They settle how a test is planned, written and repaired. They leave open who approves a plan, who reviews a repair, and what a team does when a complex flow fails. Those decisions are the real cost of building in-house, and the build-or-buy choice should be judged on who owns them.
Each Playwright AI agent splits test work into plan, file and repair
Playwright's three test agents divide the work: the planner explores the app, the generator writes tests, and the healer repairs failures. Playwright's documentation describes the planner as exploring an application to produce a Markdown test plan. The generator then turns that plan into test files.
The planner is strict about its output. Its agent definition on GitHub requires each scenario to include a title, step-by-step instructions, expected outcomes where appropriate, blank starting state assumptions, and success and failure conditions.
The generator produces executable Playwright tests from that plan and verifies selectors and assertions live while it performs the scenarios. A seed file, per a dev.to post, is copied into generated tests, can be left blank, and is typically used for setup logic or fixtures.
The healer handles failure. Playwright's documentation says it replays the failing steps, inspects the current UI for equivalent elements or flows, suggests patches, and reruns until the test passes or guardrails stop the loop. Its output is a passing test, or a skipped test if it determines the application's functionality is broken.
So do the three agents cover enough on their own? They cover the three stages, but a skipped test is a verdict the agent reached by its own determination, and someone on your team still has to decide whether that verdict is right. We read the healer's skip as a handoff to a person, not a conclusion, and that handoff is the first of several duties the agents leave with you.
Running Playwright test agents directly means building the workflow around them
Because a skip needs a human verdict, adopting Playwright's test agents directly means your team owns everything outside the three stages. Playwright's documentation says agent definitions are collections of instructions and MCP tools that should be regenerated whenever Playwright is updated. A Playwright update therefore calls for regenerating the agent definitions.
The surrounding design is also yours. HCLTech's enterprise migration paper concerns migrating legacy test assets to Playwright, so its scope is narrower than greenfield test writing. It recommends a reference architecture that separates orchestration, specialist agents and shared enterprise services. It also recommends converting legacy assets into structured Markdown or JSON intermediate artifacts, capturing steps, data and outcomes, before any Playwright code is generated.
HCLTech's proposed migration factory also puts people in the loop: it says quality engineering leads and business subject-matter experts should approve business intent, edge cases and tranche readiness. We read the planner's Markdown plan as the natural place for that approval in a Playwright setup. The agents produce the plan, but the team that adopts them has to build the sign-off step. Whether the agents then hold up without that oversight depends on how they perform as flows get harder.
Measured results show generated tests degrading on complex flows
With the surrounding workflow in a team's hands, the measurements of generated and agent-driven Playwright tests show failure rates that climb with flow complexity. The clearest set comes from Slack Engineering. Action sequences varied across runs even though the high-level flows stayed consistent.
Slack's figures read as follows. Generated Playwright tests failed about 8% of the time on simple flows and about 48% on complex workflows. Agents driving Playwright MCP showed near-zero failure on simple flows and 0–12% on complex ones, while agents driving Playwright CLI failed roughly 12–20% of the time. Average runtimes were approximately 3 minutes for generated tests, 5 to 8 minutes for MCP agents and 9 to 11 minutes for CLI agents. Slack measured MCP agents, CLI agents and generated tests, so we caution against reading its figures as direct results for the planner, generator and healer chain. We treat them as signals about the approach: a team pays in runtime for agent flexibility and in failures for static generation.
Other measurements point the same way. In Diffie's internal lab benchmark, published on its own blog, 70.8% of 387 generated tests with recorded first-run outcomes passed on initial execution.
An empirical study of 300 autonomous execution reports covering 636 test-case executions found 70% repair convergence “at the scenario-family level, with a mean of 4.4 repair iterations to convergence”. Only 10% of scenario families passed on the first attempt, and 38% of reports produced no executable test artifact. Its authors say their findings suggest that enterprise-scale autonomous testing requires explicit constraints, validation boundaries and human oversight rather than full autonomy.
The strongest objection is that the healer loop closes the gap: 70% scenario-family-level repair convergence and near-zero MCP failure on simple flows suggest the agents may suffice alone. But those results come from different setups, and the same studies show weak first-attempt passes and missing artifacts. The objection holds for simple flows and moves our conclusion only there, which leaves the practical question of how to decide between building and buying.
Judge build versus buy on who owns the loop
In our view, the build-or-buy question comes down to who owns the work around the agents. Building around Playwright's test agents is a reasonable choice when your team can staff that work. Buying makes sense when a product takes over those items, including writing tests into the repository your team already reviews. A short list of checks follows from the facts above:
Upgrades: decide who regenerates the agent definitions whenever Playwright is updated.
Approval: name who approves business intent and edge cases; HCLTech's proposed factory says quality engineering leads and subject-matter experts should.
Skipped tests: assign someone to triage each skip the healer outputs, since it signals a determination that functionality is broken.
Complex flows: run your own most complicated flow through any candidate. Slack's roughly 48% failure on complex workflows is one company's result, and your suite may differ.
Human oversight: require a review step in either path, since the arXiv study's findings suggest enterprise-scale autonomous testing requires human oversight.
If a dedicated product cannot cover these items better than your team would, its place in your stack is hard to justify. If building covers them with staff you already have, the agents give you a sound start.
Frequently asked questions
What do Playwright's test agents do, and are they enough on their own?
Playwright's three test agents handle planning, test generation and failure repair; whether they are enough on their own depends on the flow and on who owns the workflow around them. Playwright's documentation explains that the planner creates Markdown test plans, the generator produces executable tests, and the healer suggests patches. However, adopting them directly leaves workflow orchestration, plan approvals, skipped test triage and definition maintenance to your team.
Should I build AI test generation myself with Playwright's test agents, or buy a product?
The choice comes down to whether your team can staff the workflow around the agents. Building around Playwright's test agents is a reasonable choice when your team can manage agent definition upgrades, plan approvals, triage of skipped tests and review gates. Buying makes sense when a dedicated product handles those orchestration and maintenance tasks while writing tests into your existing repository.
Sources
About the author
Chetan Gupta, Co-founder and Head of Engineering
Six years leading analytics teams at Games24x7 before co-founding Agrim Intelligence in 2025 to build multi-agent systems. IIT Bombay.

