testing-plugin/skills/playwright-testing/SKILL.md
Playwright E2E testing — cross-browser, visual regression, API testing, mobile emulation. Use when writing E2E tests or setting up automated UI testing for web apps.
npx skillsauth add laurigates/claude-plugins 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.
Playwright is a modern end-to-end testing framework for web applications. It provides reliable, fast, and cross-browser testing with excellent developer experience.
| Use this skill when... | Use another skill instead when... | |------------------------|----------------------------------| | Writing E2E browser tests | Writing unit tests (use vitest-testing) | | Testing across Chromium, Firefox, WebKit | Testing Python code (use python-testing) | | Setting up visual regression testing | Analyzing test quality (use test-quality-analysis) | | Mocking network requests in E2E tests | Generating property-based tests (use property-based-testing) | | Testing mobile viewports | Testing API contracts only (use api-testing) |
bun create playwright # Initialize (recommended)
bun add --dev @playwright/test # Or install manually
bunx playwright install # Install browsers
bunx playwright install --with-deps # With system deps (Linux)
bunx playwright --version # Verify
import { defineConfig, devices } from '@playwright/test';
export default defineConfig({
testDir: './tests',
timeout: 30000,
use: {
baseURL: 'http://localhost:3000',
trace: 'on-first-retry',
},
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
],
});
bunx playwright test # Run all tests
bunx playwright test tests/login.spec.ts # Specific file
bunx playwright test --headed # See browser
bunx playwright test --debug # Debug mode
bunx playwright test --project=chromium # Specific browser
bunx playwright test --ui # UI mode
bunx playwright codegen http://localhost:3000 # Record tests
bunx playwright show-report # Last report
bunx playwright show-trace trace.zip # Trace viewer
bunx playwright test --update-snapshots # Update snapshots
import { test, expect } from '@playwright/test';
test('basic test', async ({ page }) => {
await page.goto('https://example.com');
await expect(page).toHaveTitle(/Example/);
});
test.describe('login flow', () => {
test('should login successfully', async ({ page }) => {
await page.goto('/login');
await page.fill('input[name="email"]', '[email protected]');
await page.fill('input[name="password"]', 'password123');
await page.click('button[type="submit"]');
await expect(page).toHaveURL('/dashboard');
});
});
// Text/Role selectors (recommended)
await page.getByText('Sign in').click();
await page.getByRole('button', { name: 'Submit' }).click();
await page.getByLabel('Email').fill('[email protected]');
await page.getByPlaceholder('Enter your name').fill('John');
await page.getByTestId('login-button').click();
// CSS/XPath selectors
await page.locator('.button-primary').click();
await page.locator('xpath=//button[text()="Submit"]').click();
// Chaining
await page.locator('.card').filter({ hasText: 'Product' }).getByRole('button').click();
| Assertion | Description |
|-----------|-------------|
| toHaveTitle(title) | Page title |
| toHaveURL(url) | Page URL |
| toBeVisible() | Element visible |
| toBeEnabled() | Element enabled |
| toHaveText(text) | Element text |
| toContainText(text) | Partial text |
| toHaveAttribute(name, value) | Attribute value |
| toHaveClass(class) | CSS class |
| toHaveValue(value) | Input value |
| toBeEmpty() | Empty input |
| toHaveCount(n) | Element count |
| not.toBeDisabled() | Negation |
| Context | Command |
|---------|---------|
| Quick test | bunx playwright test --reporter=line --bail |
| CI test | bunx playwright test --reporter=github |
| Single browser | bunx playwright test --project=chromium --reporter=line |
| Debug failing | bunx playwright test --trace on --reporter=line |
| Headed debug | bunx playwright test --headed --debug |
For detailed examples, advanced patterns, and best practices, see REFERENCE.md.
tools
Scaffold a new ComfyUI custom-node repo (pyproject, CI, release-please, vitest+pytest, JS extension skeleton) in the picker/gesture vein. Use when bootstrapping or init-ing a comfyui node pack.
tools
Orchestrate a ComfyUI node pack from idea to registry: scaffold, create + seed the repo, open the gitops adoption PR. Use when releasing or spinning up a new comfyui node pack.
testing
macOS EndpointSecurity/EDR high CPU & battery drain. Use when Kandji ESF / XProtect pegs a core; trace the exec storm via powermetrics + eslogger.
development
odiff pixel-by-pixel image diffing. Use when comparing screenshots, detecting visual regressions, diffing before/after PNGs, asserting golden images.