playwright-cli

Run Playwright CLI tests, generate code, and debug with ARIA snapshots.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/swat9013/dotfiles --skill playwright-cli-swat9013
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: playwright-cli
Source: https://github.com/swat9013/dotfiles/tree/main/.claude-global/skills/playwright-cli
Command: npx skills add https://github.com/swat9013/dotfiles --skill playwright-cli-swat9013

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This guide reduces friction when using the Playwright CLI by consolidating commands, workflows, and debugging patterns so developers can run, generate, and analyze E2E tests reliably and quickly.

Core Features & Use Cases

  • Interactive CLI with element refs: snapshot pages to obtain element refs (e1, e2, …) and perform click, fill, type, and navigation without crafting selectors.
  • Code generation and test workflow: use codegen to record flows, refine generated tests, and run them in development or CI with UI/debug modes.
  • Debugging, tracing, and CI best practices: guidance on trace modes, Inspector usage, session management, CI configuration (forbidOnly, retries, workers), artifact upload, and sharding strategies.
  • ARIA snapshots for structural checks: prefer ARIA snapshots for semantic verification and robust locator debugging over raw screenshots.

Quick Start

Open an interactive Playwright session to snapshot the page and interact with elements for quick UI inspection.

Frequently Asked Questions about playwright-cli

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate Playwright tests automatically from browser interactions?

Playwright codegen records browser interactions to automatically generate E2E test scripts. You launch the tool, perform UI actions, and it outputs ready-to-run test code for your workflow.

What is the best way to debug Playwright tests locally?

Debug Playwright tests locally using the Inspector and interactive UI modes. Pause test execution, step through actions, and inspect elements to identify failures in your test automation scripts.

How does ARIA snapshotting work for Playwright element location?

ARIA snapshots capture page semantic structure, letting you interact with elements using refs like e1 or e2. This provides robust locator debugging and structural verification without crafting CSS selectors.

How do I configure Playwright tracing for CI pipeline postmortem analysis?

Configure Playwright trace modes in CI to record detailed execution logs. Set trace configuration to capture all retries, generating artifacts for postmortem analysis of failed test runs.

Can I run Playwright tests headless in CI with sharding and retries?

Playwright supports headless CI runs with sharding strategies to parallelize execution across machines. Configure workers, retries, and forbidOnly to manage test automation scale and artifact reporting.