playwright-cli

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

Updated Aug 2, 2026
One-click install
npx skills add https://github.com/jeje-it/template-projet --skill playwright-cli-jeje-it
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: playwright-cli
Source: https://github.com/jeje-it/template-projet/tree/main/.agents/skills/playwright-cli
Command: npx skills add https://github.com/jeje-it/template-projet --skill playwright-cli-jeje-it

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 error-prone. This Skill lets an AI agent control a real browser session via the playwright-cli command line, turning every action into reproducible Playwright TypeScript code. ## Core Features & Use Cases - Interactive Browser Automation: Open pages, click, fill forms, navigate tabs, and inspect accessibility snapshots using element refs from the CLI. - Test Authoring and Healing: Plan test scenarios, generate Playwright test files from recorded actions, and debug failing tests by attaching to paused --debug=cli sessions. - Network, Storage, and Media Control: Mock requests, manage cookies and localStorage, record videos with overlays, and capture traces for debugging. - Use Case: A developer's login test fails after a UI update. Attach playwright-cli to the paused debug session, snapshot the page to find the renamed button, rehearse the corrected click, 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 with playwright-cli?▼

Run playwright-cli open to launch a browser, then use snapshot to get element refs and commands like click, fill, and type to interact with the page. Each command returns an updated page snapshot so you can chain actions step by step.

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

Run the test with npx playwright test --debug=cli in the background, then attach with playwright-cli attach using the printed session name. The test pauses at the start, letting you snapshot the page, inspect console output, and rehearse corrected actions whose generated code you paste back into the test.

Can playwright-cli mock network requests during testing?▼

Yes, the route command intercepts URL patterns and returns custom status codes, JSON 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 browser sessions at once?▼

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

What browsers does playwright-cli support?▼

The open command supports Chromium, Chrome, Firefox, WebKit, and Microsoft Edge via the --browser flag. You can also attach to a running Chrome or Edge instance over CDP, or connect through the Playwright browser extension.

What are the limitations of playwright-cli video recording?▼

Video recording produces WebM files and adds slight overhead to automation, with large recordings consuming significant disk space. Tracing is a lighter alternative when you need DOM snapshots and network details rather than a visual demo.