e2e-test-fixture
Skill0 starsChanged 5 months agoMITView on GitHub
Makes flow-frontend Playwright tests runnable against the real stack — seeds employee + capabilities, authenticates through the authtest OIDC flow, and points the runner at flow-factory:3001 or flow-global:3000. Use when the user says "set up an e2e fixture", "my Playwright test won't authenticate", "seed state for e2e", "run e2e against the local stack", or "/e2e-test-fixture".
- Reads credentials
In this repository11 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- add-server-actionSkill
- brainstormingSkill
- buf-bumpSkill
- frontend-testingSkill
- new-componentSkill
- new-pageSkill
- proto-migrationSkill
- receiving-code-reviewSkill
- systematic-debugSkill
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
- Distinctive: line 45
Seed domain state the scenario needs: before the test acts — create the work order, part, or PO through the same backend services, not by …
- Very specific: line 60
If sign-in flakes with a proxy 502, the auth helper already retries.
≈ “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
/e2e-test-fixture
The Playwright planner and generator agents produce tests that assume an authenticated user and seeded state. This skill supplies that scaffolding so generated tests actually run against the running stack. Without it they fail at the sign-in redirect.
Runs in flow-frontend. E2E lives in packages/playwright-flow-factory (targets
flow-factory on port 3001) and packages/playwright-flow-global (targets flow-global on
3000). Shared auth/seeding helpers live in packages/playwright-shared (support/ modules,
re-exported from index.ts). Read that index.ts for the current fixture API — do not rely
on a memorized list of exports. Names drift.
Prerequisites
- The target app and its backing services are running locally (see
local-clusterin the workspaceCLAUDE.md). Identity service must be reachable for seeding. - The app is configured to authenticate against the local
authtestmock OIDC: setOKTA_ISSUER=http://localhost:9000in the app's.env.development.
Steps
- Pick the app package.
playwright-flow-factory(3001) orplaywright-flow-global(3000). Each has its ownplaywright.config.tsand asetupproject that runssupport/auth.setup.tsbefore the test project, saving storage state to.auth/user.json. - Seed the user and capabilities in
auth.setup.tsusing the capability helper exported by@hadrian-mtv/playwright-shared(it talks to the identity service —IDENTITY_SERVICE_URL, defaulthttp://localhost:2341). Readpackages/playwright-shared/index.tsandsupport/capabilities.tsfor the current API and the shared test user id rather than trusting a remembered signature. Upsert the test employee, then grant the minimum capabilities the scenario exercises — broad grants hide permission-gating bugs. - Authenticate via the auth helper from
@hadrian-mtv/playwright-shared(support/auth.ts). It walks the NextAuth + authtest redirect chain (/api/auth/signin→ authtest → callback → home), verifies the session, and writes storage state to.auth/user.json. The test project reuses it viastorageStateso tests start logged in. - Seed domain state the scenario needs before the test acts — create the work order, part, or PO through the same backend services, not by stubbing the UI. The test should drive the real stack; faked state is the mock-heavy anti-pattern the team rejects.
- Point the runner at the stack. Leaving
PLAYWRIGHT_BASE_URLunset makes the config auto-startpnpm dev:flow-<app>on the right port; set it (e.g. in CI/Docker) to run against an already-running server and skip the auto-start. - Run.
pnpm test:e2e:flow-factoryorpnpm test:e2e:flow-global. On failure, open the report with the matching:reportscript and check the trace.
Notes
- The shared test user id and the auth/capability helpers live in
playwright-shared— reuse them; do not hardcode a new user id per package. - If sign-in flakes with a proxy 502, the auth helper already retries; a persistent failure
means the app isn't up or
OKTA_ISSUERisn't pointed at authtest.
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.

