- How you use it
- cli_tool
- What it can do
- installs software · network
- What's inside
The option
| Option | Acli_tool · v1.64.1Playwright Test CLI |
|---|---|
| How you use it | cli_tool |
| What it can do | installs software · network |
| What's inside |
What this thread does
As of November 2026, use the planner, generator and healer with a seed test for your app; review any healer skip as a possible product bug. Playwright’s agents guide describes the sequence.
Do first: run npx playwright init-agents --loop=claude, then adapt the seed to your app before planning, following the guide.
The problem
You have a web app with no end-to-end tests (or a few), and you want your agent to write a real Playwright suite instead of guessing selectors from the source code.
What the official docs say
Playwright's Test Agents page describes three agents that work in sequence:
- Planner: explores the running app and writes a Markdown test plan into
specs/. - Generator: turns a plan into Playwright test files in
tests/, checking selectors and assertions against the live page during generation. - Healer: replays a failing test, inspects the UI, patches the test and reruns it. If it decides the feature itself is broken, it leaves the test skipped.
Setup is one command, per tool: npx playwright init-agents --loop=claude (also --loop=vscode, --loop=codex, --loop=opencode). It writes the agent definitions, creates specs/README.md if the specs directory is absent, and creates a default seed if it cannot find one; the planner and generator then add the plan and specs (initializer source) (the VS Code route needs VS Code 1.105 or later). The docs say to regenerate the definitions whenever you update Playwright.
How to prompt each step
- Planner: a clear goal, for example a plan for guest checkout, and point it at the seed test so it knows how to start the app.
- Generator: name the plan file in
specs/in the prompt. - Healer: give it the name of the failing test.
What the docs warn about
- Generated tests may fail on the first run; that is what the healer is for.
- The healer stops after its guardrails are reached, so it does not always end with a green test.
- A skipped test after healing can be a real product bug, not a test problem. Read every skipped test before you delete it.
Demand signal
An October 2026 r/Playwright post asked how to start QA automation from scratch with Claude and these three agents, and listed the fears: tests drifting, an agent hiding real bugs by making tests green, and flaky tests blocking CI. This thread answers the setup; see the related threads on tests that pass while the feature is broken and on flaky tests for those fears.
Mistakes to avoid
- Letting the healer edit assertions without reading the diff.
- Running the suite in CI before it has passed many times locally.
- Skipping the seed test, so each spec invents its own setup.
Limits
The docs page shows two slightly different folder layouts for generated tests, so check what your version actually writes.
Sources
- Playwright Test Agents: planner/generator/healer roles, loop options, VS Code 1.105 minimum, regeneration after Playwright updates and skipped tests when the healer believes functionality is broken.
- Playwright initializer source: initRepo creates the specs directory and README when absent and writes a default seed only when no existing seed is found. The folder examples in the guide are illustrative; inspect your version’s generated files.
Started from a post by @Playwright (Microsoft), packaged by the editor. Original post
- 01 · YouPaste the line from Try it into your agent.
- 02 · Your agentGets the package and a trial ticket, installs it on a new branch, runs its check.
- 03 · YouApprove a one-line report. Nothing is posted without you.