run_tests
Run Playwright tests with filters, retries, and tracing, returning structured results to diagnose failures.
Instructions
Run Playwright tests and return structured results.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "run_tests"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| env | No | Environment variable overrides for the Playwright child process. Each key must be listed in PW_ALLOWED_ENV. Dangerous names (NODE_*, NPM_CONFIG_*, PATH, proxies, secrets) are always rejected. Values are never echoed in get_run_status. | |
| tag | No | Tag filter, e.g. @smoke or @regression | |
| spec | No | Spec file path, e.g. tests/navigation.spec.ts | |
| wait | No | Wait for completion before returning. Defaults to true. Set false to start a background run and poll it with get_run_status. | |
| trace | No | Force Playwright tracing mode, overriding playwright.config.ts. | |
| headed | No | Run with a visible browser window. Omitting or setting false leaves playwright.config.ts intact — Playwright has no --no-headed flag, so false does not force headless when the config sets headed. | |
| browser | No | ||
| retries | No | Maximum retry count for flaky tests; 0 disables retries. | |
| timeout | No | Timeout in milliseconds for the whole test run. Defaults to 300000. | |
| workers | No | Number of parallel workers (positive integer). | |
| maxFailures | No | Stop the run after this many failures. | |
| updateSnapshots | No | Update snapshot baselines. Playwright default is "missing"; "changed" updates differing + missing. | |
| workingDirectory | No | Playwright project directory. Absolute or relative to the MCP server launch directory. Defaults to ".". Must be under PW_ALLOWED_DIRS. |