playwright-cli

Automate browser interactions and Playwright test workflows via command-line commands.

2|Updated Jul 24, 2026
One-click install
npx skills add https://github.com/elbruno/ElBruno.MagenticUI --skill playwright-cli-elbruno
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: playwright-cli
Source: https://github.com/elbruno/ElBruno.MagenticUI/tree/main/.agents/skills/playwright-cli
Command: npx skills add https://github.com/elbruno/ElBruno.MagenticUI --skill playwright-cli-elbruno

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @playwright/cli, 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 error-prone. This Skill lets you control a real browser through simple CLI commands, with automatic snapshots and generated Playwright TypeScript code for every action. ## Core Features & Use Cases - Browser Automation: Open pages, click, fill forms, navigate tabs, manage cookies and storage, and capture snapshots, screenshots, PDFs, traces, and videos. - Test Authoring and Healing: Run Playwright tests in debug mode, attach to the paused browser, and turn interactive actions into ready-to-paste TypeScript test code following a plan-generate-heal workflow. - Network and Session Control: Mock or block requests, run multiple isolated named browser sessions, and attach to running Chrome or Edge instances via CDP. - Use Case: A failing Playwright test needs diagnosis. Run it with --debug=cli, attach playwright-cli to the paused session, inspect the snapshot and console, rehearse the fix interactively, and paste the generated locator code back into the test. ## Quick Start Use the playwright-cli skill 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 each command prints 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, letting you snapshot the page, inspect console output, and rehearse corrected actions.

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 inspect requests and fulfill them dynamically.

Does playwright-cli support multiple isolated browser sessions?▼

Yes, the -s flag creates named sessions with independent cookies, storage, cache, and tabs. You can list sessions, close them individually or all at once, and persist profiles to disk with the --persistent flag.

What browsers does playwright-cli support?▼

It launches Chrome, Firefox, WebKit, and Edge via the --browser flag on open. It can also attach to running Chrome or Edge instances by channel name or through a CDP endpoint URL.

Why do URLs with query parameters fail on Windows?▼

cmd.exe and PowerShell treat the ampersand as a command separator, truncating URLs before playwright-cli runs. Escape ampersands with a caret in cmd.exe or use the --% stop-parsing token in PowerShell.