Playwright test agents are three agent definitions that ship with Playwright: a planner that walks through your app and drafts a test plan in Markdown, a generator that converts the plan into Playwright test files, and a healer that reruns failing tests and patches them. You set them up with one command and drive them from Claude Code, Codex, OpenCode or VS Code. They're free. They work. What you get at the end is a Playwright suite in your repo, which is worth deciding you want before you generate one.
What ships with Playwright
The agents arrived in Playwright 1.56 in October 2025 and have been in every release since; the current version is 1.65 (released 5 November 2026, per npm). Under the hood, each agent is a set of instructions plus Playwright's MCP tools, so your coding agent knows how to drive a browser and what to produce.
Setup is one command per tool, from Playwright's test agents docs:
npx playwright init-agents --loop=claude # Claude Code
npx playwright init-agents --loop=codex # Codex
npx playwright init-agents --loop=opencode # OpenCode
npx playwright init-agents --loop=vscode # VS Code 1.105 or later
Regenerate the definitions whenever you upgrade Playwright. The docs are explicit that they change with each release.
What each agent does
Planner
You give the planner a request ("generate a plan for guest checkout"), optionally a seed test that logs in and sets up fixtures, and optionally a product requirements doc. It explores the running app and saves a human-readable plan to specs/, with steps and expected results per scenario. The plan is the most reusable output of the three. Read it before you generate anything.
Generator
The generator turns a plan into test files under tests/. It checks selectors and assertions live as it goes, using role and text locators where it can. Playwright's docs note that generated tests "may include initial errors", which is what the third agent is for.
Healer
When a test fails, the healer replays the steps and inspects the current UI for the element or flow that moved. It suggests a patch (a locator, a wait, a data fix). Then it reruns until the test passes or a guardrail stops it. If it decides the feature itself is broken, it marks the test skipped. That's a sensible rule, and it also means a judgement call about your product is being made by the same loop that wants the suite green.
Test agents vs Playwright MCP
They're related and easy to mix up. Playwright MCP is a server that gives any AI agent browser tools, working from the page's accessibility tree instead of screenshots. Install it and your coding agent can navigate, click and read pages for any purpose. The test agents are a specific use of those tools: prompts and conventions aimed at producing and maintaining a Playwright test suite.
Use MCP when you want an agent to poke at a page while it builds. Use the test agents when you want files under tests/ at the end.
Where they stop
The output is a suite you own
A generated test is still a script bound to how the UI looked when it was generated. The healer exists because those scripts break. Every product change can become a test change, which someone reviews. Teams that generate Playwright with agents still bring us the same three complaints: maintenance, flaky runs and false positives. Cheaper scripts are still scripts.
The agent grades its own homework
When the coding agent that wrote a feature also plans and generates its tests, both come from the same reading of the task. Vilhelm von Ehrenheim, QA.tech's co-founder and Chief AI Officer, told a CTO audience in September 2026 about an agent that broke a tool call despite an RFC and a comment block warning against exactly that change. Asked afterwards, the agent's own reflection was: "I had the answer written down twice and shipped the bug anyway." The lesson he draws for test-first loops: if they write "the tests and the implementation at the same time themselves, there's still a huge risk for bias," so add verification "that is not controlled by the agent loop itself."
It doesn't know what your PR changed
The planner explores the app as it is and plans what you ask for. Wiring it to pull requests (which PR, which preview URL, which flows the diff touches, how deep to go) is your workflow to build and keep running.
Your test data is still your problem
Agents running locally see your local data. An engineering lead at a software company running his own agent factory told us his Claude-and-Playwright setup already handled the clicking; where his team was stuck was "test data and environment". The planner will happily plan a guest checkout. It can't plan the edge case that only shows up for a customer with three years of invoices, because your laptop doesn't have one.
When to use them, and what to pair them with
Use Playwright's test agents to build and maintain a short suite for the handful of journeys that can't break: signing up, logging in, paying, and whatever your product is actually for. Read the plans, review the generated code like any other code, and keep the suite small enough that one person can say what every test is for.
For everything else, the job is different: testing what each pull request changed, on its preview build, without growing the suite. That's dynamic testing, and it's what QA.tech's PR testing does. The agent reads the change, picks and writes the tests it needs, runs them on the preview and posts a verdict that can say Can't Verify when it couldn't reach the change. There are no generated files to heal, because the agent works from what each test should prove. If you're weighing the wider field, see Playwright alternatives and the best pull request testing tools.
Frequently asked questions
What are Playwright test agents? Three agent definitions that ship with Playwright since version 1.56: a planner that walks through your app and drafts a test plan in Markdown, a generator that converts the plan into Playwright test files, and a healer that reruns failing tests and patches them. You run them from Claude Code, Codex, OpenCode or VS Code.
How do I set up Playwright test agents?
Run npx playwright init-agents with the loop for your tool, for example --loop=claude or --loop=vscode. It adds the agent definitions to your project. Regenerate them whenever you upgrade Playwright so they pick up new tools and instructions.
What's the difference between Playwright test agents and Playwright MCP? Playwright MCP is a server that gives any AI agent browser tools, working from the page's accessibility tree. The test agents are ready-made instructions built on those tools, aimed at one job: producing and repairing a Playwright test suite.
Does the Playwright healer fix bugs in my app? No. The healer repairs tests. It replays a failing test, looks for the changed element or flow, patches the test and reruns it. If it believes the functionality itself is broken, it marks the test as skipped, so someone still has to read what it skipped.
Do Playwright test agents replace a QA tool? They replace the typing. You still end up with a Playwright suite in your repo, generated by the same coding agent that writes your features, and someone has to own it. They work well for a short critical-path suite; testing every pull request against what it changed is a different job.
