write_test
Generates a Playwright-based pytest test from crawled page data following a user instruction, and provides the path to the test file for execution.
Instructions
Generate a pytest Playwright test based on crawl data and a user instruction. Always call crawl_page first to get the crawl_data. Returns the path to the generated test file — pass it as test_file when calling run_test.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| crawl_data | Yes | The crawl data returned by crawl_page as a JSON string. | |
| instruction | Yes | What the test should do. | |
| output_dir | Yes | The absolute path of the project the user is currently working in — this is where tests and reports will be saved. Use your working directory context to determine this. In Claude Code CLI this is the directory you were launched from. In VS Code it is the workspace root. Never use the MCP server's own directory. Never ask the user for it. | |
| show_browser | No | If true the browser opens visibly during the test. Default is false. |