TOPIC 56/6020 MINNOT STARTED

Test agents and the Playwright CLI for coding agents

Meet the planner, generator and healer agents that ship with Playwright, and the command line tool made for coding agents. Learn what each does, and how a tester stays in charge.

L1–L4 are part of the Pro pass

L0 Explain simply

Analogy: three kitchen helpers, and a chef who tastes. One helper drafts the menu. One cooks from the draft. One tries to fix a dish that came out wrong. The chef tastes every plate before it leaves.

Tom tests Daily List, a to-do list app. Playwright now ships helpers that draft plans, write tests and suggest repairs. Mei's rule is the chef's rule. A person reads every draft.

What it is: Playwright is a free program, made by Microsoft, that drives real browsers from test code. A is an (AI) helper that works through several steps on tests. Playwright ships three: a planner, a generator and a healer. They are one kind of AI test assistant. A coding agent is an AI helper that reads and edits a code project. An agent skill is a folder of instructions that tells that helper how to use a tool. Playwright also has a command-line interface (CLI) made for coding agents. It drives a browser with short commands. Prompt injection is text on a page that tries to give the agent new orders. An end-to-end test drives the app the way a user does. Do not mix the three test agents with the CLI. The agents write tests. The CLI lets an agent see and click a page.

Why it matters: an agent that cannot see the page invents locators. The CLI gives it a text picture of the real page. The risk is a test that passes and checks nothing, or a healer that weakens until the goes away.

A helper can be confidently wrong. Tom reads the plan before any test joins the suite.

Kept simple: agent commands change quickly. The command names here come from the Playwright agent pages checked for this lesson.

(SYNTHETIC / TRAINING ONLY: Daily List and every person named here are invented.)

PLAIN WORDS · 1 in this section
playwright
a free Microsoft tool that drives a browser for tests

PICTURE IT

The picture is the one the lesson above opens with. The table below shows how each part of it matches the software.

THE REAL JOB Using (AI) helpers to draft and repair tests quickly, while a person decides what is worth testing and what counts as a pass.

  1. Plan
  2. Generate
  3. Heal
  4. Review
Draft, cook, repair, taste

HOW THE PICTURE MAPS

How each part of the picture matches the software
In the pictureIn the software
The helper who drafts the menuThe planner agent
The helper who cooks from the draftThe generator agent
The helper who repairs a bad dishThe healer agent
The head chef who tastes everythingThe tester who reviews every result

WHERE THIS PICTURE STOPS

  • A kitchen helper learns your taste over years. An agent can make confident mistakes from the first day.
  • A chef can taste a dish at once. A weak test looks fine until the app breaks.
  • A kitchen has one crew. Agents may use many tools and settings that change with versions.

HOOK

Draft, cook, repair, taste.

REMEMBER IT THIS WAY

A rule of thumb: if you see this, think that.

If an agent drafted or repaired a test, usually read it yourself before you trust it.

What each part of the trick stands for
In the trickWhat it stands for
AgentA helper can be confidently wrong
Personmust review every draft

A review only helps if the person knows what is worth testing and what counts as a pass.

TELL A FRIEND

It is like a chef with three helpers who draft, cook and repair, and the chef tastes everything before it leaves.

OFTEN MIXED UP WITH AI-assisted test writing and the Playwright MCP server. The (MCP) lesson covers the server that gives an helper the tools of a browser. This lesson covers the three test agents and the lighter command line tool.

Sources & standards — 5 sources
  1. Market practice

    Playwright Test Agents (Playwright documentation) ↗ — Microsoft (Playwright) · Three agents: planner writes a test plan, generator turns the plan into tests, healer replays failing steps and suggests a patch; npx playwright init-agents sets them up for a chosen client; definitions should be regenerated after updating Playwright (search excerpt, page not opened)

    Describes the planner, generator and healer agents. Vendor documentation, not a standard. · Checked 2026-10-18

    Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number; read at the time of writing. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.

  2. Market practice

    Playwright CLI (Playwright documentation) ↗ — Microsoft (Playwright) · Reviewed 6 November 2026: Complete extracted primary article; examples inspected, not executed. See v45 source analysis for version scope and documented source ambiguities; no upstream run claimed.

    Describes the Playwright command line interface for coding agents. Vendor documentation, not a standard. · Checked 2026-11-06

    Primary source opened and operative text inspected on 6 November 2026. Scope: Complete extracted primary article; examples inspected, not executed. Current live Playwright documentation reflects 1.65 where stated; explicit older examples retain their version. Source inspection is not an execution or compatibility-test claim. See the completed v45 Playwright analysis for source discrepancies and exact reading boundaries.

  3. Market practice

    Best practices (Playwright documentation) ↗ — Microsoft (Playwright) · Test what the user sees, keep tests isolated, prefer role and text locators, use web-first assertions that retry, use TypeScript and ESLint to catch errors early, and run tsc --noEmit in the pipeline (search excerpt, page not opened)

    Recommends user-facing locators such as role-based ones over Cascading Style Sheets (CSS) or XPath, web-first assertions that retry, and avoiding fixed waits. Vendor documentation. Practitioner or vendor guidance, not a standard unless stated. · Checked 2026-10-18

    Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail. A second search on 2026-10-20 returned this page for its title and matched the described content; the page was still not opened (search excerpt, page not opened).

  4. Market practice

    Sessions & Dashboard (Playwright CLI documentation) ↗ — Microsoft (Playwright) · A session is picked with -s=name; playwright-cli show opens a dashboard to watch and take over sessions; attach joins a running browser (search excerpt, page not opened)

    Says each named session runs its own browser, a session is picked with -s=name, playwright-cli show opens a dashboard for watching and taking over sessions, and attach joins a browser that is already running. Vendor documentation, not a standard. · Checked 2026-10-18

    Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number; read at the time of writing. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.

  5. Market practice

    Test agents (Playwright documentation) ↗ — Microsoft (Playwright) · Reviewed 6 November 2026: Complete extracted primary article; examples inspected, not executed. See v45 source analysis for version scope and documented source ambiguities; no upstream run claimed.

    Describes the planner, generator and healer agents that ship with Playwright and how they can be used one after another. Not a standard. · Checked 2026-11-06

    Primary source opened and operative text inspected on 6 November 2026. Scope: Complete extracted primary article; examples inspected, not executed. Current live Playwright documentation reflects 1.65 where stated; explicit older examples retain their version. Source inspection is not an execution or compatibility-test claim. See the completed v45 Playwright analysis for source discrepancies and exact reading boundaries.

PRACTISE AND KEEP

Sources for this topic — 5 sources
  1. Market practice

    Playwright Test Agents (Playwright documentation) ↗ — Microsoft (Playwright) · Three agents: planner writes a test plan, generator turns the plan into tests, healer replays failing steps and suggests a patch; npx playwright init-agents sets them up for a chosen client; definitions should be regenerated after updating Playwright (search excerpt, page not opened)

    Describes the planner, generator and healer agents. Vendor documentation, not a standard. · Checked 2026-10-18

    Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number; read at the time of writing. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.

  2. Market practice

    Playwright CLI (Playwright documentation) ↗ — Microsoft (Playwright) · Reviewed 6 November 2026: Complete extracted primary article; examples inspected, not executed. See v45 source analysis for version scope and documented source ambiguities; no upstream run claimed.

    Describes the Playwright command line interface for coding agents. Vendor documentation, not a standard. · Checked 2026-11-06

    Primary source opened and operative text inspected on 6 November 2026. Scope: Complete extracted primary article; examples inspected, not executed. Current live Playwright documentation reflects 1.65 where stated; explicit older examples retain their version. Source inspection is not an execution or compatibility-test claim. See the completed v45 Playwright analysis for source discrepancies and exact reading boundaries.

  3. Market practice

    Best practices (Playwright documentation) ↗ — Microsoft (Playwright) · Test what the user sees, keep tests isolated, prefer role and text locators, use web-first assertions that retry, use TypeScript and ESLint to catch errors early, and run tsc --noEmit in the pipeline (search excerpt, page not opened)

    Recommends user-facing locators such as role-based ones over Cascading Style Sheets (CSS) or XPath, web-first assertions that retry, and avoiding fixed waits. Vendor documentation. Practitioner or vendor guidance, not a standard unless stated. · Checked 2026-10-18

    Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail. A second search on 2026-10-20 returned this page for its title and matched the described content; the page was still not opened (search excerpt, page not opened).

  4. Market practice

    Sessions & Dashboard (Playwright CLI documentation) ↗ — Microsoft (Playwright) · A session is picked with -s=name; playwright-cli show opens a dashboard to watch and take over sessions; attach joins a running browser (search excerpt, page not opened)

    Says each named session runs its own browser, a session is picked with -s=name, playwright-cli show opens a dashboard for watching and taking over sessions, and attach joins a browser that is already running. Vendor documentation, not a standard. · Checked 2026-10-18

    Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number; read at the time of writing. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.

  5. Market practice

    Test agents (Playwright documentation) ↗ — Microsoft (Playwright) · Reviewed 6 November 2026: Complete extracted primary article; examples inspected, not executed. See v45 source analysis for version scope and documented source ambiguities; no upstream run claimed.

    Describes the planner, generator and healer agents that ship with Playwright and how they can be used one after another. Not a standard. · Checked 2026-11-06

    Primary source opened and operative text inspected on 6 November 2026. Scope: Complete extracted primary article; examples inspected, not executed. Current live Playwright documentation reflects 1.65 where stated; explicit older examples retain their version. Source inspection is not an execution or compatibility-test claim. See the completed v45 Playwright analysis for source discrepancies and exact reading boundaries.

Deepest material on this page: L4 — Standards & sources. Where a topic stops short of implementation depth, that is a deliberate coverage decision, not an oversight — see coverage.