ReferenceActions

Live tests

Pause a single Playwright test on a remote runner and evaluate code interactively against the live page.

Live test actions run one Playwright test on a remote browser and pause it at a source line so an agent can inspect the DOM, evaluate Playwright statements against page, capture screenshots, and iterate without restarting the test. Live tests run from your local repository, so they are available on the CLI and the local MCP server (endform mcp).

Start a live test

Start a live test

Runs one Playwright test on a remote browser and pauses it at a checkpoint so an agent can inspect the page and evaluate code interactively.

$ npx endform@latest live-test start tests/checkout.spec.ts:47 --line 72
$ npx endform@latest live-test start --grep 'completes checkout' --project chromium

Selection must match exactly one test. The session stays paused until it is stopped or reaches the session time limit.

Parameters
TEST_FILE_FILTERSstring[]
Positional test file filters. Include file.spec.ts:LINE to target a specific test declaration.
--linenumber
1-based source line to pause before. Defaults to the first statement inside the selected test body.
-g, --grepstring[]
Only select tests whose full title matches this regular expression.
-G, --grep-invertstring[]
Exclude tests whose full title matches this regular expression.
--projectstring[]
Only select tests from the named Playwright projects.
-c, --configstring
Playwright config file or test directory.
--organization-idstring
Organization ID. Inferred from your repository config or active login when omitted.

Output

Prints a text summary with the live session ID, paused checkpoint file and line, local results and log paths, follow-up commands, and the initial ARIA snapshot file path.

Live session started: lt_01J...
  checkpoint: tests/checkout.spec.ts:72
  results: /tmp/endform-live/lt_01J.../results.json
  log: /tmp/endform-live/lt_01J.../session.log
Run code: endform live-test run lt_01J... --code 'console.log(await page.title())'
Stop: endform live-test stop lt_01J...
Initial snapshot: /tmp/endform-live/lt_01J.../snapshot-0.txt
Toollive_test_startLocal MCP server only
Example promptStart a live test paused before line 72 of tests/checkout.spec.ts and check why the payment button is disabled.

Startup can take a few minutes when project setup or local servers run first. Call live_test_stop when finished.

Parameters
testFileFiltersstring[]
Regular expressions matched against absolute paths. May include file.spec.ts:LINE to select a test declaration.
linenumber
1-based source line to pause before. Defaults to the first statement inside the selected test body.
grepstring[]
Regular expressions matching the full Playwright title chain.
grepInvertstring[]
Regular expressions excluding tests with matching titles.
projectstring[]
Only select tests from these Playwright projects.
configstring
Playwright config file or test directory.
organizationIdstring
Organization ID. Defaults to the organization configured for the repository or active login.

Output

Returns JSON with sessionId, checkpointFile, checkpointLine, resultsPath, logPath, and an inline initial ARIA snapshot (plus snapshotPath).

Not available from the dashboard.

Run code in a live test

Run code in a live test

Evaluates JavaScript inside the paused test's scope with access to fixtures such as page.

$ npx endform@latest live-test run lt_01J... --code "console.log(await page.locator('button').allTextContents())"
$ npx endform@latest live-test run lt_01J... - <<'EOF'
await page.getByRole('button', { name: 'Continue' }).click();
await page.screenshot({ path: 'after-click.png' });
EOF

Pass either --code or - (to read code from stdin). If the snippet throws, the command exits non-zero and the session remains paused so the agent can run another snippet.

Parameters
SESSION_IDstringrequired
Live session ID returned by live-test start.
--codestring
JavaScript to evaluate at the checkpoint. Supports multiple statements and top-level await. Required unless - is passed.
-stdin
Read JavaScript to evaluate from standard input instead of --code.

Output

Writes the evaluated snippet's stdout and stderr, downloads any artifacts created (such as screenshots), updates the saved ARIA snapshot, and exits with the snippet's exit code.

Toollive_test_runLocal MCP server only
Example promptIn the paused live session, inspect the visible form validation messages and test clicking the submit button.

A non-zero exitCode means the snippet threw an error; the session stays paused and the agent can call live_test_run again.

Parameters
sessionIdstringrequired
Live session ID returned by live_test_start.
codestringrequired
JavaScript to evaluate in the paused test scope. May use multiple statements, await, and test fixtures such as page.

Output

Returns stdout, stderr, exitCode, a fresh inline ARIA snapshot, snapshotPath, and artifactPaths for files written during execution.

{
  "sessionId": "lt_01J...",
  "stdout": "[ 'Back', 'Pay now' ]\n",
  "stderr": "",
  "exitCode": 0,
  "snapshot": "- main:\n  - alert: \"Select a start date\"",
  "snapshotPath": "/tmp/endform-live/lt_01J.../snapshot-1.txt",
  "artifactPaths": ["/tmp/endform-live/lt_01J.../artifacts/after-click.png"]
}

Not available from the dashboard.

Check live test status

Check live test status

Reports whether a live session is starting, paused, running code, ended, or stale.

$ npx endform@latest live-test status lt_01J...
Parameters
SESSION_IDstringrequired
Live session ID returned by live-test start.

Output

Prints JSON with sessionId, status (starting, paused, running, ended, or stale), error, and snapshotPath when paused or running (resultsPath when ended, or hint when starting or stale).

{
  "sessionId": "lt_01J...",
  "status": "paused",
  "error": null,
  "snapshotPath": "/tmp/endform-live/lt_01J.../snapshot-2.txt"
}
Toollive_test_statusLocal MCP server only
Example promptCheck whether my live test session is still paused.
Parameters
sessionIdstringrequired
Live session ID returned by live_test_start.

Output

Returns JSON with sessionId, status (starting | paused | running | ended | stale), optional error, resultsPath, hint, and a fresh ARIA snapshot when paused.

Not available from the dashboard.

Stop a live test

Stop a live test

Ends an active live session and releases both local and remote runner resources.

$ npx endform@latest live-test stop lt_01J...
Parameters
SESSION_IDstringrequired
Live session ID returned by live-test start.

Output

Prints a confirmation line stating whether the session was stopped or had already ended.

Toollive_test_stopLocal MCP server only
Example promptStop the live test session now that we found the locator.
Parameters
sessionIdstringrequired
Live session ID returned by live_test_start.

Output

Returns JSON with sessionId, status ("stopped" or "already-ended"), and optional error.

{
  "sessionId": "lt_01J...",
  "status": "stopped",
  "error": null
}

Not available from the dashboard.

How live sessions work

  • Single-test selection: Filters must match exactly one test occurrence in one Playwright project. Narrow selection with file.spec.ts:LINE, --grep, --grep-invert, or --project.
  • Retries and fixtures: The paused attempt runs without retries. Setup projects run first as usual, and code passed to live-test run executes inside the test's scope with access to fixtures such as page.
  • Recovering from errors: If a code snippet throws, live-test run returns a non-zero exit code and stderr, and the session stays paused so the agent can fix the snippet and run again.
  • Session limits: live-test start runs a detached local session supervisor, so exiting live-test start leaves the session running until it is stopped or reaches the 12-minute-30-second deadline after the checkpoint. Call live-test stop (live_test_stop) as soon as debugging is complete.
  • Isolation from analytics: Live sessions do not create normal suite-run analytics records, do not consume shared CI concurrency allocations, and do not appear in the dashboard.

Last updated