playwright-cli

Automate browser interactions and execute Playwright tests via CLI.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/SeanChenR/maestro-agent --skill playwright-cli-seanchenr
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: playwright-cli
Source: https://github.com/SeanChenR/maestro-agent/tree/main/.agents/skills/playwright-cli
Command: npx skills add https://github.com/SeanChenR/maestro-agent --skill playwright-cli-seanchenr

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Playwright-cli removes manual, repetitive browser interactions and simplifies debugging, test generation, and session management by exposing a compact, interactive command-line interface for Playwright workflows.

Core Features & Use Cases

  • Interactive Browser Control: Launch, attach, navigate, and interact with pages using snapshot-based element refs or CSS/role selectors.
  • Test & Debug Support: Generate Playwright TypeScript snippets automatically, attach to paused tests, and explore pages during test debugging.
  • State and Network Management: Save/load storage state, manage cookies/localStorage/sessionStorage, mock network requests, and intercept or modify responses for reliable testing.
  • Observability: Record traces, capture videos with chaptering and overlays, and collect console/network logs for postmortem analysis.
  • Use Case: Reproduce a flaky end-to-end test by attaching to the test session, inspecting DOM via snapshots, applying a temporary route mock, and recording a trace to diagnose the failure.

Quick Start

Use playwright-cli to open a browser session, navigate to a page, interact with elements using snapshot refs, take a snapshot, and then close the browser.

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 testing and debug paused Playwright tests?

You can automate browser testing and debug paused Playwright tests by attaching the CLI to the test session, inspecting the DOM via snapshots, and interacting with pages using CSS or role selectors.

What is the best way to manage browser session state and cookies for end-to-end testing?

Managing browser session state and cookies for end-to-end testing is done by saving and loading storage state, which handles cookies, localStorage, and sessionStorage for reliable test workflows.

Can I mock network requests and intercept responses with Playwright?

Yes, you can mock network requests and intercept responses with Playwright by applying temporary route mocks to modify network behavior and ensure reliable testing conditions.

How do I capture traces and record videos when reproducing a flaky test?

To capture traces and record videos when reproducing a flaky test, use the CLI to record traces with chaptering and overlays, collecting console and network logs for postmortem analysis.

Does this Playwright CLI work with Node and npm environments?

Yes, this Playwright CLI works with Node and npm environments, providing a compact interactive command-line interface to execute Playwright-based tests and workflows.

How do I target page elements using snapshot-based refs in browser automation?

Targeting page elements using snapshot-based refs in browser automation involves taking a page snapshot and using the generated element references to interact with the DOM.