playwright-e2e-tests
Skill4 starsChanged 27 days agoMITView on GitHub
Use when writing, fixing or stabilizing end-to-end or UI tests with Playwright, automating a browser user flow, replacing Cypress or Selenium tests, or setting up Playwright in a web project.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- onyx-dot-app/onyx-fosstheir own version, first seen Oct 8, 2026
- onyx-dot-app/onyxtheir own version, first seen Oct 8, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- onyx-dot-app/onyx★ 33ksame name
- onyx-dot-app/onyx-foss★ 320same 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 repository30 other files it gives its agents.
- accessibility-auditSkill
- api-design-reviewSkill
- api-test-writerSkill
- architecture-diagramSkill
- bug-debuggerSkill
- bug-report-writerSkill
- changelog-writerSkill
- codebase-onboardingSkill
- code-reviewSkill
- database-schema-designSkill
- dependency-upgradeSkill
- design-handoff-specSkill
- design-reviewSkill
- dockerize-appSkill
- figma-design-compareSkill
- flaky-test-fixerSkill
- git-commit-writerSkill
- github-actions-ciSkill
- prd-writerSkill
- proof-of-done-liteSkill
- readme-writerSkill
- refactor-plannerSkill
- security-auditSkill
- seo-auditSkill
- test-case-generatorSkill
- test-plan-writerSkill
- test-writerSkill
- ux-research-synthesisSkill
- ux-writingSkill
- web-performance-auditSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 47
No fixed sleeps. Wait on a visible condition or a network response (page.waitForResponse).
- Distinctive: line 49
Use the Page Object pattern only when the same page is used in many specs.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Playwright E2E Tests
Overview
End-to-end tests prove that real user journeys work in a real browser. Write few of them, make each one reliable, and locate elements the way users find them.
Method
- Setup (if missing):
npm init playwright@latest. ConfigurebaseURL,webServerto start the app,trace: "on-first-retry", and the browsers you support inplaywright.config.ts. - Pick journeys by risk: sign up / log in, the core purchase or create flow, payments, permissions. One spec file per journey.
- Set up state through the API or storage state, not through the UI, except in the test that covers that UI (log in once in a setup project and reuse
storageState). - Write steps with user-facing locators and web-first assertions (table below).
- Run
npx playwright test, thennpx playwright test --repeat-each=5on new tests to catch flakiness. Usenpx playwright show-traceon failures.
Locators and assertions
| Prefer | Avoid |
page.getByRole("button", { name: "Pay now" }) | page.locator(".btn-primary:nth-child(2)") |
getByLabel("Email"), getByPlaceholder, getByText | XPath, deep CSS chains |
getByTestId("cart-total") when no accessible name exists | IDs generated at runtime |
await expect(locator).toHaveText("₹900") (auto-waits) | expect(await locator.textContent()).toBe(...) |
await expect(page).toHaveURL(/\/orders\/\d+/) | page.waitForTimeout(3000) |
Example
import { test, expect } from "@playwright/test";
test("user applies a coupon at checkout", async ({ page }) => {
await page.goto("/cart");
await page.getByLabel("Coupon code").fill("SAVE10");
await page.getByRole("button", { name: "Apply" }).click();
await expect(page.getByText("Coupon applied")).toBeVisible();
await expect(page.getByTestId("cart-total")).toHaveText("₹900");
});Rules
- Each test is independent: its own data, no order dependence, runs in parallel.
- No fixed sleeps. Wait on a visible condition or a network response (
page.waitForResponse). - Mock only third parties you do not control (
page.route); keep your own backend real. - Use the Page Object pattern only when the same page is used in many specs.
- Visual comparisons (
toHaveScreenshot) only for stable, important screens, with masks for dynamic content.
Common mistakes
- Testing every edge case end to end; push those down to unit and API tests.
- Logging in through the UI in every test.
- Selectors tied to styling classes that change with design updates.
- Shared test accounts mutated by parallel tests.
- Retrying flaky tests instead of fixing the wait condition.
Made by Wageesha Tripathi · LinkedIn · Email · More skills
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.

