playwright-authoring

Write and run Playwright E2E tests with video, trace, and HAR evidence collection.

1|Updated Apr 21, 2026
One-click install
npx skills add https://github.com/devbasex/ai-plugins --skill playwright-authoring-devbasex
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: playwright-authoring
Source: https://github.com/devbasex/ai-plugins/tree/main/plugins/playwright-kit/skills/playwright-authoring
Command: npx skills add https://github.com/devbasex/ai-plugins --skill playwright-authoring-devbasex

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Writing reliable end-to-end browser tests is slow and error-prone: scripts often lack reproducibility, skip assertions, and produce no evidence when they fail. This Skill guides you through creating reviewable Playwright test scripts, running them deterministically, and automatically collecting video, trace, HAR, and screenshot evidence for every run. ## Core Features & Use Cases - Template-based test authoring: Start from ready-made pytest templates (auth, list, form, dashboard) and record interactions with playwright codegen, then add expect() assertions and page-role markers. - Reproducibility review checklist: Enforces checks for deterministic data, marker coverage, assertion completeness, and explicit wait strategies before any test runs. - Evidence collection by default: Every run captures video, Playwright traces, HAR network logs, and failure screenshots into a structured reports/<run-id>/ directory, with optional overlay captions and Google Drive upload. - Flexible browser connection: Run against local containerized Chromium or attach to a remote Chrome over CDP to reuse logged-in sessions, including SSH-based host Chrome launching. - Use Case: After implementing a new login flow, record the flow with codegen, turn it into a reproducible pytest with assertions, then run ./scenario-test/run.sh to get a video and trace proving the flow works. ## Quick Start Ask the AI to write a Playwright E2E test for your login page using the auth template and run it with video evidence enabled.

Frequently Asked Questions about playwright-authoring

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

FAQPage Schema
How do I write a Playwright E2E test with pytest?▼

Start from the provided test templates (auth, list, form, dashboard) or record interactions with playwright codegen, then add expect() assertions and page_role markers. Run the suite with ./scenario-test/run.sh to execute tests and collect evidence.

How do I record Playwright browser interactions automatically?▼

Use uv run playwright codegen <URL> to record your browser actions as code. Copy the generated code into a test function, then add markers, fixtures like pwk_config.base_url, and expect() assertions to make it reproducible.

Can Playwright connect to an already running Chrome browser?▼

Yes, set browser.mode to cdp-remote in scenario.config.yaml and launch Chrome with --remote-debugging-port=9222. The conftest.py fixture uses connect_over_cdp() to attach, letting you reuse logged-in sessions and existing browser state.

How do I capture video and trace evidence in Playwright tests?▼

Video recording is on by default for every test run via run.sh. Traces are retained on failure, HAR logs use minimal mode, and screenshots capture failures; disable them with --pwk-no-video or --pwk-no-evidence flags.

Why does CDP connection to Chrome fail from a Docker container?▼

Chrome binds to 127.0.0.1 by default, so containers cannot reach it. Launch Chrome with --remote-allow-origins=* and use host.docker.internal:9222 as the endpoint, or add --remote-debugging-address=0.0.0.0 on Linux/WSL2 hosts.

When should I use MCP browser checks instead of writing test scripts?▼

Use MCP-based checks (Playwright MCP or Chrome DevTools MCP) for one-off verification of the current branch without writing scripts. Convert recurring checks into scripted tests so they run reproducibly with evidence collection.