Generate an E2E test
generate-e2e-testScaffold a runnable Playwright or pytest spec from a description using real project selectors, optionally walking steps on the live page and verifying the spec passes.
Instructions
Scaffold a Playwright test (a .spec.ts, or a test_*.py module in a pytest-playwright project) from a description using the project's REAL selectors. Scans the agent's recent file changes (git working tree / last commit, mtime fallback), extracts data-testid / role / label / placeholder / id locators with their source locations, optionally cross-checks them against the live page, writes a ready-to-run spec, and returns next steps. With steps it walks the flow on the live page instead: each step must work there, the spec replays them, asserts the URL and aria snapshot where the flow landed, and is run once to prove it passes.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"description": "<description>"
},
"name": "generate-e2e-test"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | No | Exact spec path (*.spec.ts / *.test.ts, or test_*.py in a pytest project) inside the project instead of the default location | |
| steps | No | Walk the flow: run these steps on the live page first, then write a spec that replays them and asserts the end state | |
| write | No | Write the file to disk (default true) | |
| config | No | playwright.config path or 1-based index | |
| verify | No | steps: run the written spec once to prove it passes (default true) | |
| pageUrl | No | Page the test starts on (default: baseURL from playwright.config) | |
| project | No | steps: Playwright project for the verification run | |
| testDir | No | Directory for the generated spec (default: detected testDir or tests/) | |
| overwrite | No | Replace an existing spec at the target path (only specs this tool generated) | |
| timeoutMs | No | ||
| assertScope | No | steps: CSS scope of the end-state aria snapshot (default 'body') | |
| description | Yes | What the test should cover, e.g. "login with valid credentials" | |
| liveInspect | No | Verify discovered selectors against the live page (default true when a URL is known) | |
| projectRoot | No | Project directory; defaults to the server working directory | |
| storageState | No | steps: signed-in session file, also used by the spec |