Loading...
Loading...
Use when running Playwright via terminal CLI — `npx playwright test` (test runner), `codegen` (interactive recording), `screenshot` / `pdf` (one-off captures), and CI sharding. NOT for agent-driven real-time browser control (use `claude-in-chrome` MCP tools for that).
npx skill4agent add mizchi/chezmoi-dotfiles playwright-clinpx playwrightcodegen| I want to... | Use |
|---|---|
| Run E2E tests | |
| Record a browser session → test code | |
| One-off screenshot / PDF from a URL | |
| Write / review / tune a Playwright test suite | |
| Agent-driven real-time browser control (navigate → click → read → assert) | |
| Interactive data scraping / SPA exploration | |
tests/*.spec.tsnpx playwright testplaywright-test# Interactive codegen (generates test code from browser actions)
npx playwright codegen https://example.com
# Run all tests
npx playwright test
# Run specific file
npx playwright test tests/login.spec.ts
# Run specific test by title
npx playwright test -g "should login"
# Debug mode (opens Playwright Inspector)
npx playwright test --debug
# UI mode (visual test runner with time-travel)
npx playwright test --ui
# Headed mode (see the browser)
npx playwright test --headed
# Specific browser
npx playwright test --project=chromium
# Generate trace
npx playwright test --trace on
# View report
npx playwright show-report
# Install browsers
npx playwright install
npx playwright install chromium --with-deps # CI-optimizednpx playwright test --shard=1/3
npx playwright test --shard=2/3
npx playwright test --shard=3/3# Screenshot from CLI
npx playwright screenshot --browser=chromium https://example.com screenshot.png
# PDF (Chromium only)
npx playwright pdf https://example.com page.pdf