playwright-cli

Automate browser interactions and debug Playwright tests through a command-line interface.

Updated Jun 30, 2026
One-click install
npx skills add https://github.com/bsamiee/Rasm --skill playwright-cli-bsamiee
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: playwright-cli
Source: https://github.com/bsamiee/Rasm/tree/main/.claude/plugins/playwright/skills/playwright-cli
Command: npx skills add https://github.com/bsamiee/Rasm --skill playwright-cli-bsamiee

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 repetitive. This Skill lets an AI agent control a real browser session through the playwright-cli command line, turning every action into reusable Playwright TypeScript code. ## Core Features & Use Cases - Browser Automation: Open pages, click, fill forms, navigate tabs, and capture snapshots or screenshots using element refs from accessibility snapshots. - Test Authoring and Healing: Run tests with --debug=cli, attach to the paused session, explore the live page, and copy generated locators and assertions directly into test files following a plan-generate-heal workflow. - Network and Storage Control: Mock requests with route rules, manage cookies and localStorage, save and restore authentication state, and record traces or videos for debugging. - Use Case: A failing login test needs diagnosis. Run it with --debug=cli, attach playwright-cli to the printed session, snapshot the page to find the renamed button, rehearse the corrected click, and paste the generated locator 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 page, take a snapshot to get element refs, then run commands like click, fill, and type against those refs. Each command returns an updated page snapshot so you can chain actions without writing code.

How to debug a failing Playwright test with playwright-cli?▼

Run the test with `npx playwright test --debug=cli` in the background and wait for the debugging instructions with a session name. Attach with `playwright-cli attach <session>`, then snapshot, inspect console and requests, and rehearse fixes whose generated code you paste into the test.

Can playwright-cli mock network requests during testing?▼

Yes, the route command intercepts URL patterns and fulfills them with custom status codes, bodies, or headers. For conditional logic or response modification, use run-code with page.route to inspect requests and alter real responses.

Does playwright-cli support multiple isolated browser sessions?▼

Yes, the -s flag names a session, giving each one 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.

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 it as ^& in cmd.exe or use the --% stop-parsing token in PowerShell to pass the full URL.

What are the limitations of playwright-cli snapshots?▼

Snapshots omit some DOM attributes like id, class, and data-* values, which require the eval command to read directly from the element. Large pages produce big snapshots, so use --depth, element refs, or the find command to scope output.