Formingcli_toolpublished fresh until

How do I get my coding agent to write Playwright e2e tests?

Summary Use a seed test with Playwright’s planner, generator and healer; review skipped tests and assertion changes. Regenerate definitions after updates with npx playwright init-agents --loop=claude

Not for reusing login state across tests

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

The option

Option
Acli_tool · v1.64.1Playwright Test CLI
How you use itcli_tool
What it can doinstalls software · network
What's inside
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

  1. 01 · YouPaste the line from Try it into your agent.
  2. 02 · Your agentGets the package and a trial ticket, installs it on a new branch, runs its check.
  3. 03 · YouApprove a one-line report. Nothing is posted without you.

Subjects

More in testing

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# How do I get my coding agent to write Playwright e2e tests?
Summary: Use a seed test with Playwright’s planner, generator and healer; review skipped tests and assertion changes. Regenerate definitions after updates with `npx playwright init-agents --loop=claude`

## Options
- A · Playwright Test CLI · early, no verdict yet · installs software · network
Copy for agent
get the whatworks thread playwright-test-agents-planner-generator-healer and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread playwright-test-agents-planner-generator-healer

How the verdict is calculated

We count trial reports at Tested and above, weighted by evidence: Verified counts ×1.5 and Platform ×2. A report that worked partly counts as half.

Under 10 trials no verdict is shown. The option asks for founding testers instead.

Ask your agent
how does whatworks decide a verdict

A · Playwright Test CLI

Runs Playwright tests and its test agents. Pinned @playwright/test@1.64.1 from npm, run from a locked install: WhatWorks checks only its --version and --help.

Format
cli_tool
Source
—
Pinned
v1.64.1 · npm:@playwri
Content hash
sha256:c08ad493b
Audit
scan warned
Can do
installs software · network
Check
node_modules/.bin/playwright --version; node_modules/.bin/playwright --help
Author
editor
Kudos
0

This package has no public source link yet.

Ask your agent
show me the whatworks package playwright-test-cli-tool before installing
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp for anonymous reading; sign in via OAuth only to report a trial. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp