playwright-cli

Automate browser interactions and Playwright test workflows through a command-line interface.

25|4|Updated Dec 21, 2025
One-click install
npx skills add https://github.com/thangchung/agent-engineering-experiment --skill playwright-cli-thangchung
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: playwright-cli
Source: https://github.com/thangchung/agent-engineering-experiment/tree/main/agentgateway-entraid-obo/.claude/skills/playwright-cli
Command: npx skills add https://github.com/thangchung/agent-engineering-experiment --skill playwright-cli-thangchung

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @playwright/cli, playwright, and includes references (resource) components.

What problem does it solve? Manually driving a browser to test web pages, debug failing Playwright tests, or capture page state is slow and repetitive. This Skill lets you control a real browser with simple CLI commands, automatically generating reusable Playwright TypeScript code from every action. ## Core Features & Use Cases - Interactive Browser Automation: Open pages, click, fill forms, and navigate using element refs from accessibility snapshots, with support for tabs, sessions, cookies, and storage. - Test Generation and Healing: Plan test scenarios, generate Playwright test files from recorded actions, and debug failing tests by attaching to paused test runs. - Debugging and Evidence Capture: Record traces, videos with annotations, screenshots, console logs, and network requests, plus mock API responses for testing. - Use Case: A QA engineer needs to fix a flaky login test. They run the test with --debug=cli, attach playwright-cli to the paused session, inspect the live page snapshot, discover the button label changed, and copy the corrected generated locator directly into the test file. ## Quick Start Use playwright-cli to open https://example.com, take a snapshot, and click the sign-in button.

Frequently Asked Questions about playwright-cli

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate browser interactions from the command line?▼

Use playwright-cli to open a browser, navigate to a URL, and interact with elements using refs from the page snapshot. Commands like click, fill, and type map directly to Playwright actions and print the equivalent TypeScript code.

How to debug a failing Playwright test interactively?▼

Run the test with npx playwright test --debug=cli in the background, then attach with playwright-cli using the printed session name. The test pauses at the start so you can step through, inspect snapshots, and rehearse fixes.

Can playwright-cli mock network requests during testing?▼

Yes, the route command intercepts URL patterns and returns custom status codes, bodies, or headers. For conditional logic or response modification, use run-code with page.route to implement advanced mocking.

Does playwright-cli support multiple browser sessions at once?▼

Yes, the -s flag creates named sessions with isolated cookies, storage, cache, and tabs. You can run concurrent sessions for scraping or A/B testing and clean up with close-all or kill-all.

What browsers does playwright-cli support?▼

It supports Chromium, Chrome, Firefox, WebKit, and Microsoft Edge via the --browser flag on open. You can also attach to running Chrome or Edge instances over CDP or through the Playwright browser extension.

Why do URLs with query parameters fail on Windows?▼

On Windows, cmd.exe and PowerShell treat the ampersand as a command separator, truncating URLs with multiple query parameters. Escape ampersands with a caret in cmd.exe or use the --% stop-parsing token in PowerShell.