Write end-to-end browser tests from a test plan
An agent explores your app in a real browser, writes a test plan, and turns it into Playwright tests you review and run in CI.
The use case
Teams know they should have end-to-end coverage for key flows but writing browser tests is slow. Playwright ships test agents: a planner that explores the running app and writes a plan in Markdown, and a generator that turns the plan into Playwright test files, checking selectors against the live page. The Playwright MCP server lets other agents drive a browser the same way. A QA engineer or developer reviews the plan first, cuts scenarios that do not matter, then reviews the generated tests for stable selectors and real assertions before adding them to CI.
Example workflow
- Run the app locally or in a test environment
- Ask the planner agent to explore a flow and write a plan
- Edit the plan to keep the scenarios that matter
- Generate Playwright tests from the plan
- Review assertions and selectors, then add to CI
Tools
- Playwright
- Playwright MCP
Risks and guardrails
- Only point agents at test environments with test accounts
- Generated tests can assert on unstable text or layout
- Plans may skip edge cases a person would add
Sources
Written by Agents Lookup. Credits and official pages for the tools this use case names:
- Playwright docs: test agents: playwright.dev/docs/test-agents
- Microsoft on GitHub: Playwright MCP: github.com/microsoft/playwright-mcp
- Playwright MCP server (official page): github.com/microsoft/playwright-mcp (checked 2026-11-09)