src/orchestrator/plugins/playwright/SKILL.md
Playwright E2E testing patterns, cross-browser configuration, page objects, and CI setup. Use when creating E2E specs, visual regression suites, or configuring Playwright in CI. Trigger terms: playwright, e2e, trace, page object, cross-browser
npx skillsauth add etylsarin/opencastle playwright-testingInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
For project-specific test configuration and breakpoints, see testing-config.md.
npx playwright test # Run all tests
npx playwright test --ui # Open interactive UI mode
npx playwright test --headed # Run with visible browsers
npx playwright test auth.spec.ts # Run specific spec
npx playwright test --project=chromium # Run in specific browser
npx playwright test --grep "login" # Filter by test name
npx playwright test --debug # Step-through debugging
npx playwright codegen http://localhost:3000 # Generate tests from actions
npx playwright show-report # View HTML test report
npx playwright install # Install browsers
Tests: tests/e2e/{feature}/, page objects: tests/pages/, fixtures: tests/fixtures/.
import { test, expect } from '@playwright/test';
import { LoginPage } from '../pages/login-page';
test.describe('Login', () => {
test('submits valid credentials', async ({ page }) => {
const login = new LoginPage(page);
await login.goto();
await login.fill('[email protected]', 'password123');
await page.getByRole('button', { name: 'Sign in' }).click();
await expect(page.getByTestId('dashboard')).toBeVisible();
});
});
// Mock API responses for deterministic tests
await page.route('/api/login', (route) => {
route.fulfill({ status: 200, body: JSON.stringify({ token: 'test' }) });
});
Prefer semantic locators; avoid brittle CSS selectors:
page.getByRole('button', { name: 'Sign in' }) // preferred: ARIA role + accessible name
page.getByLabel('Email address') // form inputs by label
page.getByTestId('login-form') // test-id for complex containers
page.getByText('Welcome back') // visible text
page.locator('[data-state="open"]') // CSS only when no semantic alternative
test.describe.npx playwright test --ui to iterate interactively.trace: 'on-first-retry'), save an HTML report, and inspect via npx playwright show-report.npx playwright show-report shows 0 failures and that saved traces contain the failing trace id.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'], ['list']],
use: {
baseURL: 'http://localhost:3000',
trace: 'on-first-retry',
screenshot: 'only-on-failure',
},
projects: [
{ name: 'chromium', use: { ...devices['Desktop Chrome'] } },
{ name: 'firefox', use: { ...devices['Desktop Firefox'] } },
{ name: 'webkit', use: { ...devices['Desktop Safari'] } },
{ name: 'mobile', use: { ...devices['iPhone 14'] } },
],
webServer: {
command: 'npm run dev',
url: 'http://localhost:3000',
reuseExistingServer: !process.env.CI,
},
});
See REFERENCE.md for MCP tools and advanced config (moved to a referenced file).
trace: 'on-first-retry' selectively for flaky suites; attach trace IDs to failure ticketsdevelopment
Defines 10 sequential validation gates: secret scanning, lint/test/build checks, blast radius analysis, dependency auditing, browser testing, cache management, regression checks, and smoke tests. Use when running pre-deploy validation or CI checks, CI/CD pipelines, deployment pipeline validation, pre-merge checks, continuous integration, or pull request validation.
development
Generates test plans, writes unit/integration/E2E test files, identifies coverage gaps, and flags common testing anti-patterns. Use when writing tests, creating test suites, planning test strategies, mocking dependencies, measuring code coverage, or test planning.
development
Provides model routing rules, validates delegation prerequisites, supplies cost tracking templates, and defines dead-letter queue formats for Team Lead orchestration. Load when assigning tasks to agents, choosing model tiers, starting a delegation session, running a multi-agent workflow, delegating work, choosing which model to use, or assigning tasks.
testing
Saves and restores session state including task progress, file changes, and delegation history. Use when saving progress, resuming interrupted work, picking up where you left off, or checkpointing current work.