
Playwright Generate Test
Turn a written user-flow scenario into a passing Playwright TypeScript test by rehearsing it in the browser via Playwright MCP before generating code.
Overview
Playwright Generate Test is an agent skill for the Ship phase that walks a scenario in the browser via Playwright MCP, then writes and iterates a passing `@playwright/test` TypeScript spec.
Install
npx skills add https://github.com/github/awesome-copilot --skill playwright-generate-testWhat is this skill?
- Refuses premature codegen until every scenario step is executed through Playwright MCP tools
- Emits a `@playwright/test` TypeScript spec aligned with the completed interaction history
- Saves generated files under the project tests directory and runs them until green
- Asks for a scenario when the user has not supplied one
- Iterates on failures instead of handing off a static draft
- Runs scenario steps one-by-one via Playwright MCP before any test code is emitted
Adoption & trust: 13k installs on skills.sh; 34.6k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You have a test scenario in plain language but no executable Playwright spec—and generating code before driving the flow produces flaky or wrong selectors.
Who is it for?
Solo builders shipping web apps who use Playwright MCP and want tests grounded in real browser steps rather than guessed DOM structure.
Skip if: Teams without Playwright MCP configured, unit-only coverage needs, or flows where you already have a maintained spec and only need a one-line tweak.
When should I use this skill?
You need a Playwright test from a scenario and have (or can configure) Playwright MCP; provide a scenario or answer when the skill asks for one.
What do I get? / Deliverables
You get a saved Playwright TypeScript test under tests/ that has been executed and iterated until it passes against the scenario you validated step by step.
- Playwright TypeScript test file in tests/
- Executed test run with iterations until pass
Recommended Skills
Journey fit
End-to-end test generation belongs on the Ship shelf because it produces automated regression coverage right before or after release. Testing is the canonical subphase for skills that author, save, and run Playwright specs in a tests directory.
How it compares
Use instead of asking the model to invent Playwright code from the scenario alone without MCP-driven exploration.
Common Questions / FAQ
Who is playwright-generate-test for?
Indie and solo web developers who run Claude Code, Cursor, or similar agents with Playwright MCP and need E2E tests from scenario descriptions.
When should I use playwright-generate-test?
Use it in Ship during testing when you are adding regression coverage for a checkout, onboarding, or settings flow and want the agent to execute each step in the browser before writing TypeScript.
Is playwright-generate-test safe to install?
It drives a real browser and writes to your filesystem via MCP; review the Security Audits panel on this Prism page and scope MCP permissions before running against production accounts.
SKILL.md
READMESKILL.md - Playwright Generate Test
# Test Generation with Playwright MCP Your goal is to generate a Playwright test based on the provided scenario after completing all prescribed steps. ## Specific Instructions - You are given a scenario, and you need to generate a playwright test for it. If the user does not provide a scenario, you will ask them to provide one. - DO NOT generate test code prematurely or based solely on the scenario without completing all prescribed steps. - DO run steps one by one using the tools provided by the Playwright MCP. - Only after all steps are completed, emit a Playwright TypeScript test that uses `@playwright/test` based on message history - Save generated test file in the tests directory - Execute the test file and iterate until the test passes