‹ Back to apps
Playwright (1.x)
Playwright (1.x) rules for Cursor. Teaches semantic locators (getByRole/getByLabel over CSS), web-first assertions (toBeVisible over isVisible), the test.extend fixture model, storageState + setup-project auth, page.route mocking with proper continue/fallback, the Playwright POM-via-fixture pattern, ARIA snapshot a11y, sharded CI with merge-reports, and the macOS-vs-Linux baseline trap for visual regression. Catches 34 LLM regressions: page.click('text='), page.$ / page.$$ ElementHandles, waitForTimeout, isVisible booleanised, missing await on assertions, page.route after goto, hardcoded credentials, deprecated playwright-github-action, and more.
What’s inside
4 skills- Skillplaywright-new-testScaffold a new Playwright test the modern way: semantic locators (getByRole over CSS), web-first assertions (await expect(loc).toBeVisible()), test.extend fixtures (not beforeEach), POM-via-fixture for repeated screens, async-arrow signature with destructured fixtures, and the canonical test file layout.
- Skillplaywright-setup-authSet up Playwright authentication via the setup-project + storageState pattern. Covers single shared session (read-only tests), per-worker storage state (mutating tests), multi-role projects (admin/user/guest), and JWT bypass tokens for the fastest deterministic auth.
- Skillplaywright-validateScan a Playwright codebase for tracked anti-patterns. Most are reliably grep-detectable: text/CSS engine selectors, page.$/$$ ElementHandles, page.waitForTimeout, isVisible/textContent booleanised, page.route after goto, hardcoded credentials, missing forbidOnly, deprecated playwright-github-action, headless: false committed, mode 'serial' default. A few (assertion missing await, untyped test.extend) need manual review.
- Skillplaywright-visual-regressionSet up Playwright visual regression with toHaveScreenshot: mask volatile regions, animations: 'disabled', maxDiffPixels, the macOS-vs-Linux baseline trap (the #1 visual-regression gotcha), the CI workflow for diff review, and when to reach for Argos / Chromatic / Percy instead of the built-in.