playwright-e2e-testing
Skill0 starsChanged 3 months agoMITView on GitHub
End-to-end testing with Playwright in Next.js: config, webServer, helpers, localStorage seeding, accessibility scans, and CI. Use when adding E2E tests, smoke tests, or browser automation for React webapps.
- Reads credentials
- Installs packages
8 other projects use a version of this.
Adopted by
Most recently taken up by
- JPeetz/agent-skillstheir own version, first seen Oct 28, 2026
- fugazi/test-automation-skills-agentstheir own version, first seen Oct 21, 2026
- aiqadam/qadam-flowtheir own version, first seen Oct 8, 2026
- Ghosteken/agent-harnesstheir own version, first seen Oct 1, 2026
- ZeroTokenClaw/agents-skillstheir own version, first seen Sep 21, 2026
- jpoindexter/theft-kittheir own version, first seen May 20, 2026
Used with
Projects with it also use api-and-interface-design, receiving-code-review and 1 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
LLl0k0laDSkillapi-and-interface-design
Use when designing APIs, module boundaries, or any public interface. Use when creating REST or GraphQL endpoints, defining type contracts between modules, or establishing boundaries between frontend and backend.
Also in 3 projects that use this
CloudflareSkillreceiving-code-review
Use when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation
Also in 3 projects that use this
OpenAISkillrequesting-code-review
Use when completing tasks, implementing major features, or before merging to verify work meets requirements
Also in 3 projects that use this
Other versions8 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 8
- fugazi/test-automation-skills-agents★ 256same name
- JPeetz/agent-skills★ 14same name
- aiqadam/qadam-flow★ 5same name
- Ghosteken/agent-harness★ 2same name
- FutureAtoms/claude-skills-backup★ 1same name
- impeto-ai/claude-skills-impeto★ 1same name
- jpoindexter/theft-kit★ 1same name
- ZeroTokenClaw/agents-skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository23 other files it gives its agents.
- client-document-exportSkill
- cloudflare-turnstile-nextjsSkill
- ga4-analytics-nextjsSkill
- git-repo-privacy-auditSkill
- hardened-contact-form-nextjsSkill
- html-semantic-markupSkill
- multi-step-wizard-flowSkill
- nextjs-api-routesSkill
- nextjs-app-routerSkill
- nextjs-seo-metadataSkill
- nextjs-ui-foundationSkill
- next-themes-dark-modeSkill
- react-components-patternsSkill
- react-hooks-patternsSkill
- recharts-dashboardSkill
- resend-email-nextjsSkill
- server-pdf-playwrightSkill
- shadcn-ui-setupSkill
- specialized-form-inputsSkill
- tailwind-css-v4Skill
- vitest-unit-testingSkill
- web-accessibility-wcagSkill
- zustand-persist-stateSkill
The file
We split this skill into the rules it gives an agent
3 rules. 0 are common, 0 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 5 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 59
Prefer getByRole, getByLabel over CSS selectors.
- Very specific: line 72
Use before goto for dashboard tests requiring completed setup.
- Very specific: line 96
Run build && start in CI via webServer config — avoids dev-server flakiness.
“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Playwright E2E Testing
Install
npm install -D @playwright/test
npx playwright install chromiumConfig (playwright.config.ts)
import { defineConfig, devices } from "@playwright/test";
const baseURL = process.env.PLAYWRIGHT_BASE_URL ?? "http://localhost:3000";
export default defineConfig({
testDir: "./e2e",
fullyParallel: true,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? 1 : undefined,
use: { baseURL, trace: "on-first-retry" },
projects: [{ name: "chromium", use: { ...devices["Desktop Chrome"] } }],
webServer: {
command: process.env.CI ? "npm run build && npm run start" : "npm run dev",
url: baseURL,
reuseExistingServer: !process.env.CI,
timeout: 180_000,
},
});Package scripts
"test:e2e": "playwright test"Basic spec
import { test, expect } from "@playwright/test";
test("homepage navigates to signup", async ({ page }) => {
await page.goto("/");
await page.getByRole("link", { name: /Get Started/i }).click();
await expect(page).toHaveURL(/\/signup/);
});Prefer getByRole, getByLabel over CSS selectors.
Seed client state (localStorage)
// e2e/helpers/seed-store.ts
export async function seedStore(page: Page, snapshot: object) {
await page.addInitScript((data) => {
localStorage.setItem("app-storage-key", JSON.stringify({ state: data, version: 0 }));
}, snapshot);
}Use before goto for dashboard tests requiring completed setup.
Accessibility scan
npm install -D @axe-core/playwrightimport AxeBuilder from "@axe-core/playwright";
const results = await new AxeBuilder({ page }).withTags(["wcag2aa"]).analyze();
expect(results.violations).toEqual([]);CI (GitHub Actions)
- run: npx playwright install chromium --with-deps
- run: npm run test:e2e
env:
CI: trueRun build && start in CI via webServer config — avoids dev-server flakiness.
Tips
| Issue | Fix |
| Parallel workers clash on build | workers: 1 in CI |
| Hydration timing | await expect(locator).toBeVisible() |
| Dialogs | getByRole("dialog") |
| File upload | setInputFiles on hidden input |
Anti-patterns
- Hard-coded
waitForTimeoutinstead of assertions - Testing implementation details (class names) over roles
- Sharing mutable state between parallel tests
- Skipping browser install step in CI
Pair with: web-accessibility-wcag, vitest-unit-testing.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

