playwright test --debug=cli attaches coding agents to paused tests
Introduced 2026-04-01 · score 0.98
HOW TO USE IT
When debugging a failing repository test, start it with `--debug=cli`, attach to the emitted session, then step through the paused test with `playwright-cli`.
npx playwright test --debug=cliplaywright-cli attach <session>playwright-cli --session=<session> step-overWHY THIS HELPS
When debugging a failing repository test, start it in CLI debug mode and attach to inspect and step through the paused test.
REQUIREMENTS AND LIMITATIONS
- Version: v1.59.0
- --debug=cli: Runs the test paused at the start and prints debugging instructions.
- <session> (required): The session name emitted by the test runner; pass it to `attach`.
- --session=<session>: Selects the named browser session for a CLI command.
- Prerequisite: Playwright 1.59.0 or newer is needed for `--debug=cli`.
- Prerequisite: If Playwright is already a project dependency, the docs say `playwright-cli` commands can also be run as `npx playwright cli <command>`.
FIRST-PARTY EVIDENCE
- https://github.com/microsoft/playwright/releases/tag/v1.59.0
- https://playwright.dev/docs/release-notes
- https://playwright.dev/agent-cli/commands/test-debugging
- https://playwright.dev/agent-cli/capabilities
- https://playwright.dev/agent-cli/installation
Check the installed version and the source before using it. Entry JSON