
Playwright Skill
Gives solo builders a full Playwright playbook so an agent can write, run, and debug browser E2E and API tests without guessing APIs.
Overview
Playwright-skill is an agent skill most often used in Ship (also Build and Validate) that teaches agents end-to-end Playwright patterns for browser automation, assertions, and CI-ready test suites.
Install
npx skills add https://github.com/sickn33/antigravity-awesome-skills --skill playwright-skillWhat is this skill?
- 20-topic API reference from install through CI/CD, accessibility, visual, and mobile patterns
- Locator, wait, and assertion patterns aligned with stable E2E tests
- Page Object Model, network interception, and session/auth recipes for real apps
- Parallel runs, data-driven cases, performance and debugging workflows
- npm-based setup check (`npm list playwright`) and `playwright.config.ts` starter
- 20 major reference sections from installation through troubleshooting
Adoption & trust: 3.3k installs on skills.sh; 40.1k GitHub stars; 0/3 security scanners passed (skills.sh audits).
What problem does it solve?
You need reliable browser tests but your agent keeps mixing outdated Playwright APIs, brittle selectors, and missing wait or CI patterns.
Who is it for?
Indie builders adding E2E, visual, a11y, or API-via-browser coverage on a Node/TypeScript stack who want the agent to follow Playwright best practices.
Skip if: Projects that forbid browser automation, teams standardized only on non-Playwright runners with no Playwright install, or work limited to pure backend unit tests with zero UI surface.
When should I use this skill?
When implementing, extending, or debugging Playwright browser or API tests, CI integration, or automation patterns for a web app.
What do I get? / Deliverables
You get consistent Playwright scripts, configs, and debugging steps your agent can reuse from prototype checks through pre-release regression suites.
- playwright.config.ts and test file scaffolds
- E2E or API test scripts with assertions and waits
- CI-oriented run/debug notes and troubleshooting steps
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Browser verification and regression checks belong on the Ship shelf because they gate release confidence before users see changes. Testing is the canonical subphase for Playwright flows, assertions, CI hooks, and flake debugging—not one-off coding during feature work.
Where it fits
Script a fast Playwright walkthrough of a landing or MVP UI to confirm core clicks work before you commit to a full build.
Generate locators, actions, and POM scaffolding while you implement checkout or dashboard flows.
Expand regression suites, network mocks, and parallel CI jobs so releases do not break critical paths.
Add smoke tests that hit production-like URLs after deploy to catch obvious breakage early.
How it compares
Agent-side Playwright procedure and reference—not a hosted cloud browser grid or an MCP server that runs tests for you.
Common Questions / FAQ
Who is playwright-skill for?
Solo and indie developers using AI coding agents who ship web products and need Playwright E2E, smoke, or CI browser tests without maintaining their own cheat sheet.
When should I use playwright-skill?
Use it in Validate when you want a quick prototype click-through; in Build while wiring frontend flows and integrations; and in Ship when you are hardening tests, fixing flakes, or adding visual, mobile, or accessibility checks before release.
Is playwright-skill safe to install?
Treat it like any third-party skill: review the Security Audits panel on this Prism page and your org policy before granting shell, network, and browser access in automated runs.
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