playwright-cli

Run Playwright browser tests, record test code, and capture screenshots via terminal CLI.

416|6|Updated Apr 24, 2026
Ready to run
npx skills add https://github.com/mizchi/skills --skill playwright-cli-mizchi
๐Ÿ’ฌ Prompt for ChatGPT / Claude Chatโ–ผ
Please help me install this Agent Skill.
Skill: playwright-cli
Source: https://github.com/mizchi/skills/tree/main/playwright-cli
Command: npx skills add https://github.com/mizchi/skills --skill playwright-cli-mizchi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Developers need a straightforward way to execute end-to-end browser tests, generate test code interactively, and capture visual snapshots without writing custom scripts. This Skill automates the terminal interface to Playwright, handling test execution, debugging, and CI sharding. ## Core Features & Use Cases - Test Execution: Run full test suites or filter by file and test name with headed/headless modes. - Interactive Codegen: Record browser actions and automatically generate test code. - CI Sharding: Distribute tests across parallel jobs using --shard flags. - Capture & Reporting: Generate screenshots, PDFs, traces, and HTML reports from a single command. - Use Case: You need to run a 500-test suite in CI across 5 machines. Use sharding to split work, then consolidate reports for visibility into flaky tests. ## Quick Start Run all Playwright tests in the current project and open the HTML report to view results.

Frequently Asked Questions about playwright-cli

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

FAQPage Schema
How do I run Playwright tests in CI with parallel execution?โ–ผ

Use `npx playwright test --shard=X/N` where X is the shard number and N is total shards. For example, `--shard=1/3` runs the first third of tests. Each CI job runs a different shard, then results merge when viewing the report.

How do I generate Playwright test code from browser interactions?โ–ผ

Run `npx playwright codegen https://example.com` to open an interactive browser window. Actions you perform (clicks, typing, navigation) are recorded and translated into test code that you can copy into a `.spec.ts` file.

What's the difference between headed and headless mode?โ–ผ

Headless mode runs tests without displaying the browser window, which is faster and used in CI. Headed mode (`--headed`) shows the browser, useful for debugging locally. Debug mode (`--debug`) pauses execution for step-through inspection.

Can I generate a screenshot or PDF from a URL without writing a test?โ–ผ

Yes. Use `npx playwright screenshot --browser=chromium https://example.com output.png` or `npx playwright pdf https://example.com page.pdf` (PDF requires Chromium). No test file needed.

How do I debug a failing Playwright test?โ–ผ

Run `npx playwright test --debug` to open the Playwright Inspector, which pauses execution and lets you step through each line. Alternatively, use `--ui` for the UI test runner with time-travel debugging to replay test steps.