playwright-cli

Automate browser interactions and test web pages using Playwright CLI commands.

13|3|Updated Mar 13, 2026
One-click install
npx skills add https://github.com/gqcn/lina --skill playwright-cli-gqcn
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: playwright-cli
Source: https://github.com/gqcn/lina/tree/main/.agents/skills/playwright-cli
Command: npx skills add https://github.com/gqcn/lina --skill playwright-cli-gqcn

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Manually driving a browser to test pages, debug failing Playwright tests, or capture automation evidence is slow and repetitive. This Skill provides a complete command-line workflow for controlling browsers, inspecting page state, and generating reusable Playwright test code. ## Core Features & Use Cases - Browser Automation: Open pages, click, fill forms, drag elements, manage tabs, and capture snapshots using element refs from accessibility snapshots. - Session & Storage Management: Run isolated named browser sessions, save and restore cookies, localStorage, and full storage state for authenticated workflows. - Debugging & Evidence Capture: Record traces, videos with chapter overlays, intercept network requests with mocks, and debug failing Playwright tests by attaching to paused sessions. - Use Case: A failing CI test can be rerun with --debug=cli, attached via playwright-cli attach, explored interactively, and the generated TypeScript code copied directly back into the test file. ## 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 with a URL, then use snapshot to get element refs like e5, and interact using commands such as click, fill, and type. Each command returns an updated page snapshot for the next 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 using playwright-cli attach with the printed session name. Explore the paused page interactively and copy the generated TypeScript code into your test.

Can playwright-cli mock network requests?▼

Yes, use playwright-cli route with a URL pattern and options like --status, --body, or --header to mock responses. For conditional logic or response modification, use run-code with page.route in custom Playwright code.

Does playwright-cli support multiple browser sessions?▼

Yes, use the -s flag to create named sessions with isolated cookies, storage, and tabs. Manage them with playwright-cli list, close, close-all, and delete-data commands.

How do I save and reuse login state in Playwright?▼

After logging in, run playwright-cli state-save to write cookies and localStorage to a JSON file. Later, restore it with playwright-cli state-load before navigating, skipping the login flow entirely.

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

Video recording adds overhead to automation and large recordings consume significant disk space. For debugging with DOM snapshots and network details, tracing is a better fit than video.