Test a Playwright script
test_playwright_scriptBrowser checks: runs a Playwright Test script once in a sandboxed browser without saving it (write scope; counts against the plan's test runs per hour). The script is a normal @playwright/test file: import { test, expect } from '@playwright/test', test.step(...) for readable steps, process.env.TARGET_URL for the site and process.env.NAME for organization variables and secrets. It runs with those secrets in its environment and can reach any public host. A script error returns 400 naming the line. Waits up to ~60 s and returns the run (status passed/flaky/failed/timed_out/script_error/infra_error, failed step with its error and code frame, console errors, failed requests, Web Vitals) plus missing_variables: the process.env names the organization hasn't set, which are unset when the script runs. A run still going after that returns its test_run_id instead.
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": {
"script": "<script>",
"target": "<target>"
},
"name": "test_playwright_script"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| script | Yes | The Playwright Test file | |
| target | Yes | The site under test (TARGET_URL) | |
| location_id | No | A probe location id with browser support; omitted = the nearest | |
| timeout_seconds | No | Run timeout in seconds, 10-180 |