playwright-generate-test
Installation
SKILL.md
Test Generation with Playwright MCP
Generate a Playwright TypeScript test by first interacting with the real application via the Playwright MCP server, then producing a verified test file.
Workflow
- Get the scenario — If not provided, ask the user to describe the test scenario (URL, steps, expected outcomes)
- Navigate to the application — Use
browser_navigateto load the target page - Execute the scenario step by step — Walk through each interaction using MCP tools:
browser_clickfor clicksbrowser_typefor text inputbrowser_select_optionfor dropdownsbrowser_snapshotto observe state between steps
- Capture locators and assertions — Note the actual locators and expected states observed during execution
- Generate the test — Write a Playwright TypeScript test using
@playwright/testbased on the real interactions observed:
import { test, expect } from '@playwright/test';