write-e2e-test
Skill1 starsChanged 3 months agoMITView on GitHub
Use when adding a new browser-level Playwright spec — an end-to-end or journey test that drives a real page. Reads the repo's conventions from .claude/test-profile.md, mirrors the nearest existing spec, keeps interaction behind whatever model layer the repo uses, and verifies the spec actually runs before finishing. Not for API-only or component tests.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- tlolkema/skills-explainedtheir own version, first seen Feb 3, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- tlolkema/skills-explained★ 4same 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 repository13 other files it gives its agents.
- AGENTS.mdAGENTS.md
- audit-changesetSkill
- clarify-scopeSkill
- handoff-notesSkill
- harden-locatorsSkill
- probe-conventionsSkill
- register-fixtureSkill
- run-suiteSkill
- triage-red-suiteSkill
- write-api-clientSkill
- write-api-testSkill
- write-db-testSkill
- write-page-objectSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 8 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
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
- Distinctive: line 8
Add one browser spec that a reviewer would not be able to tell from the specs already in the repo.
- Distinctive: line 39
Search the model layer named in the profile for the screens this flow crosses.
- Distinctive: line 40
Create a new model only when nothing covers the screen — and then via write-page-object, followed by register-fixture so the spec can …
- Distinctive: line 65
No sleeps: Wait on the condition you actually care about — a state, a response, an element — never on a duration.
- Very specific: line 77
Run the new spec alone, using the profile's run one command.
- Distinctive: line 91
Never widen an assertion to make a run pass.
- Distinctive: line 93
Never leave a generated or recorded spec in raw recorder output.
- Distinctive: line 95
Do not introduce a helper, a wrapper, or a config field for a single call site.
- Distinctive: line 96
If the flow needs an auth or seeding step the repo has no pattern for, stop and ask.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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
Skill: write-e2e-test
Add one browser spec that a reviewer would not be able to tell from the specs already in the repo.
Matching the neighbours matters more than matching any external best practice. A spec that is individually elegant and structurally foreign is a maintenance tax on everyone who touches it next.
Preconditions
.claude/test-profile.mdexists. If it does not, run probe-conventions first — without it you would be inventing an import path, and a spec that cannot resolvetestis worse than no spec.- The profile lists a
browsergroup. If it does not, this repo has no browser tests; ask before creating the first one, because it needs a fixture/context decision the user owns. - You know which flow is under test and where it starts. If not, use clarify-scope.
Procedure
1. Read the neighbour before writing anything
Open the two specs closest to the feature you are adding. Note, concretely:
- the exact import block, in order;
- how the test is titled and whether titles carry tags;
- whether the body is flat or divided into steps, and how those step descriptions are phrased;
- how the test reaches its starting state — a navigation call, a stored session, a setup hook;
- what it asserts on, and whether assertions live in the spec or behind a model method.
You are going to copy all six decisions. Deviating from one of them needs a reason you can say out loud.
2. Decide reuse before creating
Search the model layer named in the profile for the screens this flow crosses. Extend what exists. Create a new model only when nothing covers the screen — and then via write-page-object, followed by register-fixture so the spec can actually reach it.
Grep the existing specs for the same flow first. A duplicate journey test that nobody notices is the most expensive kind of test: it doubles the maintenance and finds nothing new.
3. Write the spec
Structure it as arrange → act → assert, in the repo's own idiom:
<the profile's verbatim browser import line>
<the repo's own data import, if it has one>
test('<what the user can do, phrased as an outcome>', async ({ <only the fixtures you use> }) => {
// arrange — reach the state the behaviour starts from
// act — the one interaction under test
// assert — the observable consequence that proves it worked
});Rules that hold regardless of repo style:
- One behaviour per spec. A second
actis a second test unless the steps genuinely cannot be reached independently. - No sleeps. Wait on the condition you actually care about — a state, a response, an element — never on a duration. A fixed wait is either flake or wasted seconds, and usually both.
- Assert something a user could observe. Asserting on internal state proves the test ran, not that the feature works.
- Independence by default. Shared-state ordering (serial mode, or whatever the repo uses) is a deliberate choice with a comment explaining what state is shared — not a default.
- Data from wherever the profile says data lives. Values inline in a spec are fine only when the value is the test: a malformed input, a boundary, a deliberately absent record. Those are clearer inline than hidden in a fixture file.
4. Verify
Run the new spec alone, using the profile's run one command. Then run the lint and typecheck
commands if the profile lists them.
A spec you have not executed is a draft. Say "draft" if you are handing it over unrun — do not report it as done.
5. Confirm it can fail
Once green, break the expectation deliberately — change the asserted value — and confirm it goes red, then restore it. A test that passes against both the correct and the incorrect value asserts nothing, and this ten-second check is the only way to notice.
Guardrails
- Never widen an assertion to make a run pass. If the app disagrees with the test and the test is right, that is a product finding — report it rather than absorbing it.
- Never leave a generated or recorded spec in raw recorder output. The adapted spec is the deliverable.
- Do not introduce a helper, a wrapper, or a config field for a single call site.
- If the flow needs an auth or seeding step the repo has no pattern for, stop and ask. Inventing a second auth mechanism is a structural decision, not a test detail.
Done when
The spec runs green in isolation, has been shown to fail when the expectation is wrong, reads like its neighbours, and you have reported the file path, the target it was verified against, and any new model or context wiring it required.
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.

