
Playwright Skill
Author and run Playwright end-to-end, API, visual, and CI-ready browser tests so shipping agents can verify critical flows before launch.
Overview
Playwright Skill is an agent skill most often used in Ship (also Build) that implements browser E2E, API, and visual testing with Playwright patterns, config, and CI integration.
Install
npx skills add https://github.com/lackeyjb/playwright-skill --skill playwright-skillWhat is this skill?
- End-to-end reference spanning selectors, waits, assertions, POM, and network/API testing
- Visual, mobile, accessibility, and performance testing patterns in one skill package
- Auth/session persistence, parallel execution, and data-driven test layouts
- CI/CD integration guidance with setup via skill-local npm run setup
- Troubleshooting and best-practices sections for flaky tests and debugging
- Reference table of contents with 20+ Playwright topic sections
- Covers POM, network/API testing, visual, mobile, a11y, and CI/CD integration
Adoption & trust: 2.7k installs on skills.sh; 2.7k GitHub stars; 0/3 security scanners passed (skills.sh audits).
What problem does it solve?
You are shipping a web product without reliable automated checks for login, payments, or critical UI flows.
Who is it for?
Indie SaaS and ecommerce builders adding Playwright coverage to React/Vite or similar web apps with agent-assisted test authoring.
Skip if: Native-only mobile apps with no web surface, or teams forbidden from browser automation in CI due to policy constraints.
When should I use this skill?
User needs Playwright installation, E2E or API browser tests, visual/mobile/a11y checks, debugging flaky automation, or CI integration for a web app.
What do I get? / Deliverables
You get Playwright tests, configuration, and debugging practices that agents can extend for regression safety before each release.
- playwright.config.ts and runnable test specs
- Page Object Model and fixture patterns where applicable
- CI-ready test execution and debugging notes
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Automated browser verification is a Ship concern—tests gate releases after the product exists, even though you may start writing suites late in Build. Testing subphase is the canonical home for Playwright configs, locators, assertions, and pipeline hooks that prevent regressions.
Where it fits
Create Playwright specs for signup, billing, and settings flows before tagging v1.0.
Wire Playwright into CI so marketing deploys cannot break primary conversion paths.
Scaffold locators and POM classes while implementing a new dashboard module.
Add regression tests after fixing a production checkout bug traced via Playwright traces.
How it compares
Deep Playwright procedural skill with API reference—not a hosted recorder SaaS or a single smoke-test snippet generator.
Common Questions / FAQ
Who is playwright-skill for?
Solo developers and small teams who want agent-guided Playwright suites for web apps, including API and visual checks, without a dedicated QA engineer.
When should I use playwright-skill?
In Ship while adding E2E and regression tests before launch, and in Build when you scaffold test harnesses alongside new UI features.
Is playwright-skill safe to install?
It may run npm install, browser downloads, and shell commands; review the Security Audits panel on this Prism page and audit scripts before execution.
SKILL.md
READMESKILL.md - Playwright Skill
# Playwright Skill - Complete API Reference This document contains the comprehensive Playwright API reference and advanced patterns. For quick-start execution patterns, see [SKILL.md](SKILL.md). ## Table of Contents - [Installation & Setup](#installation--setup) - [Core Patterns](#core-patterns) - [Selectors & Locators](#selectors--locators) - [Common Actions](#common-actions) - [Waiting Strategies](#waiting-strategies) - [Assertions](#assertions) - [Page Object Model](#page-object-model-pom) - [Network & API Testing](#network--api-testing) - [Authentication & Session Management](#authentication--session-management) - [Visual Testing](#visual-testing) - [Mobile Testing](#mobile-testing) - [Debugging](#debugging) - [Performance Testing](#performance-testing) - [Parallel Execution](#parallel-execution) - [Data-Driven Testing](#data-driven-testing) - [Accessibility Testing](#accessibility-testing) - [CI/CD Integration](#cicd-integration) - [Best Practices](#best-practices) - [Common Patterns & Solutions](#common-patterns--solutions) - [Troubleshooting](#troubleshooting) ## Installation & Setup ### Prerequisites Before using this skill, ensure Playwright is available: ```bash # Check if Playwright is installed npm list playwright 2>/dev/null || echo "Playwright not installed" # Install (if needed) cd ~/.claude/skills/playwright-skill npm run setup ``` ### Basic Configuration Create `playwright.config.ts`: ```typescript import { defineConfig, devices } from '@playwright/test'; export default defineConfig({ testDir: './tests', fullyParallel: true, forbidOnly: !!process.env.CI, retries: process.env.CI ? 2 : 0, workers: process.env.CI ? 1 : undefined, reporter: 'html', use: { baseURL: 'http://localhost:3000', trace: 'on-first-retry', screenshot: 'only-on-failure', video: 'retain-on-failure', }, projects: [ { name: 'chromium', use: { ...devices['Desktop Chrome'] }, }, ], webServer: { command: 'npm run start', url: 'http://localhost:3000', reuseExistingServer: !process.env.CI, }, }); ``` ## Core Patterns ### Basic Browser Automation ```javascript const { chromium } = require('playwright'); (async () => { // Launch browser const browser = await chromium.launch({ headless: false, // Set to true for headless mode slowMo: 50 // Slow down operations by 50ms }); const context = await browser.newContext({ viewport: { width: 1280, height: 720 }, userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36' }); const page = await context.newPage(); // Navigate await page.goto('https://example.com', { waitUntil: 'networkidle' // Wait for network to be idle }); // Your automation here await browser.close(); })(); ``` ### Test Structure ```typescript import { test, expect } from '@playwright/test'; test.describe('Feature Name', () => { test.beforeEach(async ({ page }) => { await page.goto('/'); }); test('should do something', async ({ page }) => { // Arrange const button = page.locator('button[data-testid="submit"]'); // Act await button.click(); // Assert await expect(page).toHaveURL('/success'); await expect(page.locator('.message')).toHaveText('Success!'); }); }); ``` ## Selectors & Locators ### Best Practices for Selectors ```javascript // PREFERRED: Data attributes (most stable) await page.locator('[data-testid="submit-button"]').click(); await page.locator('[data-cy="user-input"]').fill('text'); // GOOD: Role-based selectors (accessible) await page.getByRole('button', { name: 'Submit' }).click(); await page.getByRole('textbox', { name: 'Email' }).fill('user@example.com'); await page.getByRole('heading', { level: 1 }).click(); // GOOD: Text content (for unique text) await page.getByText('Sign in').click(); await page.getByText(/welcome back/i).click(); // OK: Semantic HTML await page.locator('button[type="submit"]').click(); await page.loca