What problem does it solve?
Playwright-cli removes manual, repetitive browser interactions and simplifies debugging, test generation, and session management by exposing a compact, interactive command-line interface for Playwright workflows.
Core Features & Use Cases
- Interactive Browser Control: Launch, attach, navigate, and interact with pages using snapshot-based element refs or CSS/role selectors.
- Test & Debug Support: Generate Playwright TypeScript snippets automatically, attach to paused tests, and explore pages during test debugging.
- State and Network Management: Save/load storage state, manage cookies/localStorage/sessionStorage, mock network requests, and intercept or modify responses for reliable testing.
- Observability: Record traces, capture videos with chaptering and overlays, and collect console/network logs for postmortem analysis.
- Use Case: Reproduce a flaky end-to-end test by attaching to the test session, inspecting DOM via snapshots, applying a temporary route mock, and recording a trace to diagnose the failure.
Quick Start
Use playwright-cli to open a browser session, navigate to a page, interact with elements using snapshot refs, take a snapshot, and then close the browser.