
Playwright Expert
Author and harden Playwright E2E suites with page objects, fixtures, CI wiring, and flaky-test debugging for web apps you are shipping.
Overview
Playwright Expert is an agent skill for the Ship phase that designs, writes, and debugs Playwright E2E tests with POM patterns, fixtures, mocking, and CI integration.
Install
npx skills add https://github.com/jeffallan/claude-skills --skill playwright-expertWhat is this skill?
- Five-step core workflow: analyze flows → setup → write tests → debug via trace → CI integrate
- Page Object Model, locator priority, and auto-waiting patterns from bundled reference guides
- Flaky-test loop: run → trace → identify → fix → verify
- API mocking, reporters, test fixtures, and visual regression testing support
- Pairs with test-master, react-expert, and devops-engineer per skill metadata
- 5-step core workflow (analyze, setup, write, debug, integrate)
Adoption & trust: 3.2k installs on skills.sh; 9.7k GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You have critical user flows in production but no reliable Playwright suite—or your browser tests flake and block every deploy.
Who is it for?
Indie builders and small teams shipping SaaS or web UIs who want Playwright as the default E2E layer.
Skip if: Pure API-only backends with no browser surface, or teams standardizing on Cypress/Selenium who will not adopt Playwright.
When should I use this skill?
Writing E2E tests with Playwright, setting up test infrastructure, or debugging flaky browser tests; triggers include Playwright, E2E, UI testing, Page Object Model, visual testing.
What do I get? / Deliverables
You get structured E2E tests, page objects, and CI-ready Playwright config with a trace-driven path to fix flakiness.
- Playwright test scripts and page objects
- Fixture and reporter configuration
- CI integration steps for the E2E suite
Recommended Skills
Journey fit
How it compares
Specialist Playwright workflow skill—not a generic unit-test generator or an MCP browser server.
Common Questions / FAQ
Who is playwright-expert for?
Developers writing or stabilizing Playwright end-to-end tests for web apps, especially when flakiness or missing CI integration slows shipping.
When should I use playwright-expert?
In Ship during testing when you need E2E scripts, page objects, fixtures, reporters, API mocking, visual regression, or debugging flaky browser runs before launch.
Is playwright-expert safe to install?
It emits test and config code under your control; review the Security Audits panel on this page and run new scripts in isolated CI before production credentials.
SKILL.md
READMESKILL.md - Playwright Expert
# Playwright Expert E2E testing specialist with deep expertise in Playwright for robust, maintainable browser automation. ## Core Workflow 1. **Analyze requirements** - Identify user flows to test 2. **Setup** - Configure Playwright with proper settings 3. **Write tests** - Use POM pattern, proper selectors, auto-waiting 4. **Debug** - Run test → check trace → identify issue → fix → verify fix 5. **Integrate** - Add to CI/CD pipeline ## Reference Guide Load detailed guidance based on context: | Topic | Reference | Load When | |-------|-----------|-----------| | Selectors | `references/selectors-locators.md` | Writing selectors, locator priority | | Page Objects | `references/page-object-model.md` | POM patterns, fixtures | | API Mocking | `references/api-mocking.md` | Route interception, mocking | | Configuration | `references/configuration.md` | playwright.config.ts setup | | Debugging | `references/debugging-flaky.md` | Flaky tests, trace viewer | ## Constraints ### MUST DO - Use role-based selectors when possible - Leverage auto-waiting (don't add arbitrary timeouts) - Keep tests independent (no shared state) - Use Page Object Model for maintainability - Enable traces/screenshots for debugging - Run tests in parallel ### MUST NOT DO - Use `waitForTimeout()` (use proper waits) - Rely on CSS class selectors (brittle) - Share state between tests - Ignore flaky tests - Use `first()`, `nth()` without good reason ## Code Examples ### Selector: Role-based (correct) vs CSS class (brittle) ```typescript // ✅ Role-based selector — resilient to styling changes await page.getByRole('button', { name: 'Submit' }).click(); await page.getByLabel('Email address').fill('user@example.com'); // ❌ CSS class selector — breaks on refactor await page.locator('.btn-primary.submit-btn').click(); await page.locator('.email-input').fill('user@example.com'); ``` ### Page Object Model + Test File ```typescript // pages/LoginPage.ts import { type Page, type Locator } from '@playwright/test'; export class LoginPage { readonly page: Page; readonly emailInput: Locator; readonly passwordInput: Locator; readonly submitButton: Locator; readonly errorMessage: Locator; constructor(page: Page) { this.page = page; this.emailInput = page.getByLabel('Email address'); this.passwordInput = page.getByLabel('Password'); this.submitButton = page.getByRole('button', { name: 'Sign in' }); this.errorMessage = page.getByRole('alert'); } async goto() { await this.page.goto('/login'); } async login(email: string, password: string) { await this.emailInput.fill(email); await this.passwordInput.fill(password); await this.submitButton.click(); } } ``` ```typescript // tests/login.spec.ts import { test, expect } from '@playwright/test'; import { LoginPage } from '../pages/LoginPage'; test.describe('Login', () => { let loginPage: LoginPage; test.beforeEach(async ({ page }) => { loginPage = new LoginPage(page); await loginPage.goto(); }); test('successful login redirects to dashboard', async ({ page }) => { await loginPage.login('user@example.com', 'correct-password'); await expect(page).toHaveURL('/da