agentleFS
bartstcbartstc/vite-ts-react-template/.agents/skills/e2e-testing/SKILL.md

e2e-testing

Skill123 starsChanged 3 days agoMITView on GitHub

Use when writing, reviewing or refactoring Playwright E2E tests — journey tests and the page objects, component objects, fixtures and forms they use. Not for unit or Storybook tests (test-building-blocks).

96 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects 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.
  • InfopibeSkill

    everything-claude-code

    Also in 10 projects that use this

  • InfopibeSkill

    investor-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

  • mryeastcodeSkill

    everything-claude-code-conventions

    Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

    Also in 8 projects that use this

  • tpavanipradeepSkill

    bun-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

  • niloykumarbarmanSkill

    agent-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

  • niloykumarbarmanSkill

    product-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

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 2 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 44 edited versions we read keep these.

  • 2

    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
  1. Distinctive:

    Write the journey test: Read journey-test.md.

    line 24
  2. Distinctive:

    Build the pieces it needs: Read the reference for each piece you add or change.

    line 25
  3. Very specific:

    No transport details: No API URLs, status codes or waitForResponse.

    line 59
  4. Very specific:

    Do not run the suite unless asked.

    line 81

“Common” is measured: kept by at least 6 in 10 of the 44 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

E2E Testing

How to write a Playwright E2E test in this repo: the journey test, and the pieces it is built from. This skill is self-sufficient for writing and reviewing tests. The reasoning behind it (tier ownership, data isolation, mocking, flakiness) is in docs/e2e-testing.md — read it only for a case this skill does not cover. When the doc, this file and a reference disagree, fix whichever is wrong.

How to use

  1. Choose the tier. E2E only for a critical path (one whose breakage would trigger a rollback) that crosses pages or depends on the real API: routing and guards, auth, the UI-to-API contract, state surviving navigation or reload. A branch, a validation rule, an empty/error state or a variant of one screen is a story or unit test — say so and stop. Walking through a screen a story also covers is fine; re-enumerating its states is not.
  2. Write the journey test. Read journey-test.md.
  3. Build the pieces it needs. Read the reference for each piece you add or change. Read the UI under test for its roles and accessible names.
PieceWhenReference
Journey testEvery test in a *.spec.tsjourney-test.md
Waiting and assertionsEvery step and readiness checkwaiting-and-assertions.md
Page / component objectA page or shared UI the test drivespage-objects.md
FixtureProviding a page object, or seeding data via the APIfixtures.md
FormsA page object fills or submits a formforms.md
Anti-patternsReviewing or refactoringanti-patterns.md

Journey principles

  1. One test per critical path, phases as test.step, each step ending with a web-first assertion; the final one fails if the path broke.
  2. Fixtures, not new. Specs import test/expect from the fixtures module and receive page objects and seeded data as fixtures.
  3. Arrange through the API, act through the UI. Preconditions come from data fixtures and saved auth state; only the path under test is clicked.
  4. Wait for what the user sees. Locator actions and web-first assertions are the waiting mechanism. When no UI reflects a result, wait for it in the test, never in a page object (see waiting-and-assertions.md).
  5. Fill and check only what the path needs. State and field matrices belong in stories.

Page object principles

  1. Readonly locators, tests own assertions. Page objects expose Locators; tests assert with toBeVisible, toHaveText, toHaveURL, …. No value getters (isVisible(), textContent()) feeding expect.
  2. Readiness checks only. The one assertion a page object may contain ends a navigation method.
  3. Navigation returns the target page object; plain actions return Promise<void>.
  4. Shared UI is a component object scoped by a root locator and composed into pages.
  5. Separate pages by workflow. List and details are different page objects.
  6. Private internals. Helpers and sub-locators tests should not use are private.
  7. No transport details. No API URLs, status codes or waitForResponse.
  8. Cohesive, not small. One page object per coherent piece of UI. A growing class is a signal to check whether it mixes workflows, not a limit — a complex screen may justify a large page object.

Locator priority

page.getByRole("button", { name: /add to cart/i }); // 1. preferred
page.getByLabel(/email/i); //                           2. form controls
page.getByText(/welcome back/i); //                     3. non-interactive content
page.getByPlaceholder(/search/i); //                    4. no label (an a11y smell)
page.getByTestId("cart-badge"); //                      5. escape hatch — comment why

Never

waitForTimeout, networkidle, waitForSelector, page.$, one-shot expect(await …) checks, .first() to silence strict mode, page.route on our own API, force: true without a reason comment. Details and fixes are in anti-patterns.md.

Agent rules

  • Do not run the suite unless asked. When asked, run pnpm test:e2e alone — Playwright starts the app and the local API itself. Never run the --ui, --headed or --debug variants.
  • Report, don't paper over. If a test only passes with a sleep, a retry, force or a routed own-API call, stop and report the cause instead of writing it.
  • A role or accessible name you cannot select is an accessibility finding in the component — report it.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.