Modern QA2026Playwright Test Agents: Planner, Generator, Healer — tiles
Log inJoin
135 / 139 · 13 Browser Automation with Playwright · AI-Assisted Testing← prev⊞ allnext →☰ Read as one page

16.4Playwright Test Agents: Planner, Generator, Healer

Since v1.56 (current stable is 1.61), Playwright ships its own first-party agentic workflow: Test Agents — three predefined agent definitions that plug into the coding agent you already use.

  • 🎭 planner — explores the running application and writes human-readable test plans as Markdown into a specs/ folder
  • 🎭 generator — turns a plan into executable Playwright Test code, verifying locators and assertions against the live page as it writes
  • 🎭 healer — re-runs a failing test, inspects the failure in the browser, and proposes a fix (updated locator, adjusted assertion) or flags a likely product bug

Scaffold them for your agent loop of choice:

npx playwright init-agents --loop=claude    # Claude Code
# or: --loop=vscode | codex | opencode

This generates the agent definitions plus the supporting artifacts: the specs/ folder for the planner's test plans and a seed.spec.ts that gives the agents a working entry point (fixtures, auth, base URL) to build on.

The planner → generator → healer loop is the same division of labor that teams building custom agent workflows converged on — now maintained by the Playwright team itself. Use it as the default starting point before rolling your own agents.