/skillry-testing-and-qa:playwright-e2e-auditfrom skillry-testing-and-qa
Creates and audits focused Playwright/Cypress E2E tests for critical user flows. Repairs flaky suites with broken selectors or waitForTimeout. Supports visual regression baselines and DevTools MCP debugging.
Ships in skillry-testing-and-qa. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Run or create minimal Playwright checks for browser and local app flows. The scope is intentionally narrow: cover the 1 to 3 highest-value user journeys with stable locators and web-first assertions that auto-wait — not an exhaustive regression suite. Existing flaky suites are audited and repaired (broken selectors, blind waitForTimeout) rather than rewritten wholesale.
Skillry 3.0.0 folded the skills below into playwright-e2e-audit. Each keeps its full guidance as a reference file; open only the one the task needs. The old names are routing keys, not separate skills.
| Old skill | Reference | Open it for |
|---|---|---|
e2e-testing-patterns | references/e2e-testing-patterns.md | E2E patterns for Playwright and Cypress: page objects, fixtures, waits, mocking, flaky tests, CI |
webapp-testing | references/webapp-testing.md | driving a local web app with Playwright scripts: verify UI, screenshots, browser logs |
browser-testing-with-devtools | references/browser-testing-with-devtools.md | real-browser debugging through Chrome DevTools MCP: DOM, console, network, performance |
visual-regression-review | references/visual-regression-review.md | visual diff review: baselines, viewport coverage, flakiness, stale snapshots |
playwright-skill | references/playwright-skill.md | deep Playwright guide library (index): locators, assertions, fixtures, auth, mocking, CI and sharding, POM, CLI, Cypress/Selenium migration |
api-test-suite-review | references/api-test-suite-review.md | reviewing an existing API test suite: route coverage, error paths, auth tests, fixture isolation, mocking |
waitForTimeout, or has broken selectors after a UI refactor — audit and repair them.playwright.config.ts via webServer so the suite starts and waits for readiness automatically in CI.smoke-test-and-repair for the install/build/test gate chain, references/api-test-suite-review.md for API-only contracts. For pixel diffs follow references/visual-regression-review.md.playwright.config.{ts,js}, @playwright/test in devDependencies, and existing tests//e2e/ specs. Reuse the project's config and conventions before adding anything.npm i -D @playwright/test, then npx playwright install --with-deps chromium (one browser unless cross-browser is explicitly required).webServer block so the run starts or reuses the server and waits for readiness.waitForTimeout.--trace on (or --debug) and open the trace to diagnose.getByRole, getByLabel, getByText, or getByTestId — not brittle CSS/XPath like div > span:nth-child(3).await expect(locator).toBeVisible()) so Playwright auto-waits and auto-retries; no expect(await locator.count()) snapshots of a racing DOM.page.waitForTimeout(...) is used to "wait for things to settle"; wait on a condition instead.baseURL is set in config so specs use page.goto('/'), not hardcoded http://localhost:3000/... repeated per file.webServer.url matches baseURL; reuseExistingServer: !process.env.CI so local runs reuse a running dev server but CI starts fresh.trace: 'on-first-retry' (or 'on' while debugging) is set so a failure produces a viewable trace.// tests/smoke.spec.ts — minimal, stable, web-first
import { test, expect } from '@playwright/test';
test('app loads and primary flow works', async ({ page }) => {
await page.goto('/');
await expect(page.getByRole('heading', { name: /dashboard/i })).toBeVisible();
await page.getByRole('button', { name: 'New item' }).click();
await page.getByLabel('Title').fill('Hello');
await page.getByRole('button', { name: 'Save' }).click();
await expect(page.getByText('Hello')).toBeVisible();
});
// playwright.config.ts — auto-start the local app
import { defineConfig } from '@playwright/test';
export default defineConfig({
testDir: './tests',
use: { baseURL: 'http://localhost:3000', trace: 'on-first-retry' },
webServer: {
command: 'npm run dev',
url: 'http://localhost:3000',
reuseExistingServer: !process.env.CI,
timeout: 120_000,
},
});
npx playwright test # headless run
npx playwright test --ui # interactive UI mode
npx playwright test -g "primary flow" # filter by title
npx playwright test --headed --project=chromium
npx playwright test --trace on # force trace capture on every test
npx playwright show-trace trace.zip # open the trace viewer for a failure
npx playwright codegen http://localhost:3000 # record stable selectors
When auditing an existing flaky suite, match the symptom to the fix rather than adding retries blindly:
| Symptom | Root cause | Fix |
|---|---|---|
| Passes alone, fails in the suite | shared state between specs | isolate each spec; reset DB/storage in a fixture |
| Fails only in CI, passes locally | CI is slower; element not ready | replace waitForTimeout with await expect(...).toBeVisible() |
| Selector not found after a refactor | brittle CSS/XPath | switch to getByRole/getByTestId |
| Intermittent click misses | clicking before hydration | assert the element is enabled, then click |
| Login step times out randomly | re-authenticating per test | reuse a saved storageState (below) |
| Assertion races the DOM | count() snapshot read | use toHaveCount, which auto-retries |
Logging in inside every spec is slow and a common flake source. Authenticate once in global setup, save the storage state, and reuse it:
// auth.setup.ts — runs once, persists the logged-in session
import { test as setup } from '@playwright/test';
setup('authenticate', async ({ page }) => {
await page.goto('/login');
await page.getByLabel('Email').fill(process.env.E2E_USER!);
await page.getByLabel('Password').fill(process.env.E2E_PASS!);
await page.getByRole('button', { name: 'Sign in' }).click();
await page.waitForURL('/dashboard');
await page.context().storageState({ path: 'playwright/.auth/user.json' });
});
// in playwright.config.ts, a project that depends on setup and reuses the state
{ name: 'chromium', dependencies: ['setup'],
use: { storageState: 'playwright/.auth/user.json' } }
Credentials come from E2E_USER/E2E_PASS env vars (a test account), never hardcoded. The .auth/ directory must be gitignored — the saved state is a live session token.
waitForTimeout as a fix. A fixed sleep masks a race; it is slow and still flaky. Wait on a visible element or network response instead.nth-child, deep descendant chains, and generated class names break on any layout change. Prefer role/label/test-id.expect(await page.locator('.row').count()).toBe(3) reads once with no retry; the DOM may still be rendering. Use await expect(page.locator('.row')).toHaveCount(3).baseURL and use relative paths.trace: 'on-first-retry'.Return: setup state (existing vs added), flows covered, the run command, pass/fail per spec, and artifact paths for any failure (trace/screenshot/video). Recommend the smallest next fix or the next flow worth covering, and state explicitly if coverage was intentionally limited.
playwright install downloads browser binaries — note it; do not run it without need.Done means the highest-value flows have runnable specs using stable locators and web-first assertions, the result is reported with artifacts for any failure, and the local app is wired through webServer so the suite starts cleanly.
references/api-test-suite-review.md (opens in a new tab)references/browser-testing-with-devtools.md (opens in a new tab)references/browser-testing-with-devtools/LICENSE (opens in a new tab)references/e2e-testing-patterns.md (opens in a new tab)references/e2e-testing-patterns/LICENSE (opens in a new tab)references/playwright-skill.md (opens in a new tab)references/playwright-skill/LICENSE (opens in a new tab)references/playwright-skill/ci/README.md (opens in a new tab)references/playwright-skill/ci/ci-github-actions.md (opens in a new tab)references/playwright-skill/ci/ci-gitlab.md (opens in a new tab)references/playwright-skill/ci/ci-other.md (opens in a new tab)references/playwright-skill/ci/docker-and-containers.md (opens in a new tab)references/playwright-skill/ci/global-setup-teardown.md (opens in a new tab)references/playwright-skill/ci/parallel-and-sharding.md (opens in a new tab)references/playwright-skill/ci/projects-and-dependencies.md (opens in a new tab)references/playwright-skill/ci/reporting-and-artifacts.md (opens in a new tab)references/playwright-skill/ci/test-coverage.md (opens in a new tab)references/playwright-skill/core/README.md (opens in a new tab)references/playwright-skill/core/accessibility.md (opens in a new tab)references/playwright-skill/core/angular.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
e2e-testing, playwright, cypress, visual-regression, devtools, flaky-tests
6 skills in this plugin
/real-user-release-gateRelease gate as a real customer: full baseline once, then only touched journeys on a local or staging candidate; read-only after deploy, live steps by a human./customer-lens-testingCustomer lens inside the release gate: use the product as a free and paid beginner, intermediate and expert; score ease, motion and polish; propose fixes./smoke-test-and-repairRun and repair install, typecheck, lint, build, test, startup gates; audit tsconfig strictness and build config.npx claudepluginhub fluxonlab/skillry --plugin skillry-testing-and-qaOther plugins' skills for the same job