e2e-testing
Skill104 starsChanged 3 days agoApache-2.0View on GitHub
Playwright E2E testing best practices for this project. Use when writing, modifying, or reviewing E2E tests.
We split this skill into the rules it gives an agent
7 rules. 0 are common, 5 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 38 edited versions we read keep these.
5
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 10
Use Playwright helpers from tests/e2e/helpers.ts
- Very specific: line 11
Use data-testid attributes for stable selectors
- Distinctive: line 12
Write descriptive test names that explain user behavior
- Distinctive: line 13
Ensure tests are isolated and can run independently
- Distinctive: line 91
Don't depend on test execution order (unless using serial mode intentionally)
- Distinctive: line 97
Create new helpers for repeated workflows
- Distinctive: line 98
Keep helpers focused and reusable
“Common” is measured: kept by at least 6 in 10 of the 38 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
E2E Testing Best Practices (Playwright)
Setup
- Use Playwright helpers from
tests/e2e/helpers.ts - Use
data-testidattributes for stable selectors - Write descriptive test names that explain user behavior
- Ensure tests are isolated and can run independently
Never Use Hard-Coded Timeouts
// Bad
await element.click();
await page.waitForTimeout(200);
// Good
await element.click();
await expect(otherElement).toBeVisible();Use Playwright's Auto-Waiting
// Bad
if (await element.isVisible()) {
await element.click();
}
// Good
await expect(element).toBeVisible();
await element.click();Never Use Non-Null Assertions
// Bad
const box = await element.boundingBox();
const x = box!.x;
// Good
const box = await element.boundingBox();
if (!box) {
throw new Error("Unable to locate element bounding box");
}
const x = box.x;Don't Await Locators (They're Lazy)
// Bad
const button = await page.getByTestId("submit");
// Good
const button = page.getByTestId("submit");
await expect(button).toBeVisible();Use Consistent Assertion Patterns
// Bad
expect(await element).toHaveText("text");
expect(await element.isVisible()).toBe(true);
// Good
await expect(element).toHaveText("text");
await expect(element).toBeVisible();Prefer Semantic Selectors
Priority order:
getByRole()- Best for accessibilitygetByTestId()- Best for test stability (preferred for this app)getByText()- Good for static contentlocator()with data attributes - When above don't work- CSS selectors - Last resort
Test Isolation
- Each test should set up its own state
- Don't depend on test execution order (unless using serial mode intentionally)
- Clean up after tests in
afterEachorafterAll
Helper Functions
- Leverage existing helpers from
tests/e2e/helpers.ts - Create new helpers for repeated workflows
- Keep helpers focused and reusable
Add Meaningful Error Context
// Okay
await expect(element).toBeVisible();
// Better
await expect(element, "Component should appear after loading").toBeVisible();Test User Behavior, Not Implementation
// Bad - implementation detail
await expect(button).toHaveClass("bg-blue-500");
// Good - user-visible behavior
await expect(button).toBeVisible();
await expect(button).toBeEnabled();
await expect(button).toHaveText("Submit");Other versions89 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 89
- affaan-m/ECC★ 246ksame name
- langflow-ai/langflow★ 156ksame name
- All-Hands-AI/OpenHands★ 92ksame name
- OpenHands/OpenHands★ 92ksame name
- pulsejet/memories★ 3.9ksame name
- xu-xiang/everything-claude-code-zh★ 1.9ksame name
- paradigmxyz/centaur★ 1.4ksame name
- etewiah/property_web_builder★ 644same name
- nodetool-ai/nodetool★ 603same name
- Opentrons/opentrons★ 529same name
79 more not listed
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.
Used alongsideProjects with it also use everything-claude-code, investor-materials and 10 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.
InfopibeSkilleverything-claude-code
Also in 10 projects that use this
InfopibeSkillinvestor-materials
Create and update pitch decks, one-pagers, investor memos, accelerator applications, financial models, and fundraising materials. Use when the user needs investor-facing documents, projections, use-of-funds tables, milestone plans, or materials that must stay internally consistent across multiple fundraising assets.
Also in 28 projects that use this
mryeastcodeSkilleverything-claude-code-conventions
Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.
Also in 8 projects that use this
tpavanipradeepSkillbun-runtime
Bun as runtime, package manager, bundler, and test runner. When to choose Bun vs Node, migration notes, and Vercel support.
Also in 18 projects that use this
niloykumarbarmanSkillagent-sort
Build an evidence-backed ECC install plan for a specific repo by sorting skills, commands, rules, hooks, and extras into DAILY vs LIBRARY buckets using parallel repo-aware review passes. Use when ECC should be trimmed to what a project actually needs instead of loading the full bundle.
Also in 8 projects that use this
niloykumarbarmanSkillproduct-capability
Translate PRD intent, roadmap asks, or product discussions into an implementation-ready capability plan that exposes constraints, invariants, interfaces, and unresolved decisions before multi-service work starts. Use when the user needs an ECC-native PRD-to-SRS lane instead of vague planning prose.
Also in 9 projects that use this
- +1 more from Infopibe
In this repository20 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- accessibilitySkill
- address-pr-commentsSkill
- analytics-trackingSkill
- audit-ticketsSkill
- docs-updateSkill
- gardeningSkill
- list-skillsSkill
- open-sourceSkill
- project-conventionsSkill
- react-patternsSkill
- reviewSkill
- tangle-domainSkill
- tanstack-querySkill
- tanstack-routerSkill
- typescript-standardsSkill
- ui-primitivesSkill
- validateSkill
- vitest-testingSkill
- playwright-testingSkill
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.

