test-standards
Skill1 starsChanged 3 months agoMITView on GitHub
Use when writing a new spec file, structuring functional vs e2e tests, choosing tags, or deciding what belongs in a test. Defines spec structure, tagging, and independence.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- idavidov13/agentic-playwrighttheir own version, first seen Nov 8, 2026
- BackToCimaCoppi/Praxistheir own version, first seen Sep 23, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- idavidov13/agentic-playwright★ 294same name
- BackToCimaCoppi/Praxis★ 6same 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 repository23 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- ai-native-workflowSkill
- api-testingSkill
- bootstrapSkill
- common-tasksSkill
- configSkill
- data-strategySkill
- debuggingSkill
- enumsSkill
- fixturesSkill
- page-objectsSkill
- salesforce-authSkill
- salesforce-dataSkill
- salesforce-locatorsSkill
- salesforce-metadata-contractSkill
- salesforce-personasSkill
- salesforceSkill
- salesforce-waitsSkill
- security-testingSkill
- selectorsSkill
- type-safetySkill
- wait-strategySkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 2 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 39
Import from fixtures/test-options only.
- Very specific: line 65
Keep a test under ~50 lines and to one behavior (SRP).
- Very specific: line 70
Use the structured tag option (Playwright 1.42+) — test('name', { tag: '@smoke' }, async …) — not a tag baked into the title.
- Distinctive: line 86
Create your own data (factory/helper fixture).
- Distinctive: line 91
Prefer API/fixture teardown over UI cleanup (faster, runs on failure).
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 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
Test Standards (spec structure)
Which project / folder
| Type | Folder → project | The SUT |
| One screen/feature in isolation | tests/functional/ → functional | a single page |
| Full multi-feature journey | tests/e2e/ → e2e | the whole flow |
| Backend endpoint | tests/api/ → api | the API |
Functional = many small tests, one behavior each. E2E = ONE test for the whole journey (not one per step).
Structure
import { test, expect } from '../../fixtures/test-options';
test.describe('Products', () => {
test.beforeEach(async ({ productsPage }) => {
await productsPage.goto();
});
test('creates a product', { tag: '@smoke' }, async ({ productsPage, page }) => {
await test.step('When I add a product', async () => {
await productsPage.addProduct('Widget');
});
await test.step('Then it appears in the list', async () => {
await expect(page.getByText('Widget')).toBeVisible();
});
});
});- Import from
fixtures/test-optionsonly. describeper feature;beforeEachfor shared arrange;test.stepto label the beats.
AAA or Given/When/Then — both fine
test.step labels are for the human reading the report. Use either vocabulary — they are the
same three-beat shape, so pick whichever reads better and stay consistent within a file:
| Arrange | Act | Assert | ← AAA (the api specs use this) |
| Given | When | Then | ← BDD (the UI specs use this) |
// AAA
await test.step('Act: create the user', async () => { … });
await test.step('Assert: 201 and body matches the contract', async () => { … });
// BDD
await test.step('When I submit wrong credentials', async () => { … });
await test.step('Then I see an error and stay on /login', async () => { … });- Steps are optional. Use them when a test has distinct beats worth labeling; skip them on single-action tests (a one-line GET + status check reads fine without a wrapper) — don't pad.
- The
Actstep canreturnthe call's result so theAssertstep uses it (seetests/api/users.spec.ts). - Web-first assertions only. No
waitForTimeout, nonetworkidle. - Keep a test under ~50 lines and to one behavior (SRP). Descriptive names (
creates X when Y, nottest1). - For several independent checks in one test, use soft assertions (
expect.soft(...)) so all failures report at once instead of stopping at the first. (docs)
Tagging — exactly one per test
Use the structured tag option (Playwright 1.42+) — test('name', { tag: '@smoke' }, async …) — not a tag baked into the title. It's the modern form and keeps titles clean. (A @tag in the title still works with --grep, but prefer the option.)
@smoke (critical, fast) · @sanity · @regression (broad) · @api · @e2e · @security ·
@contract (a shape/metadata snapshot, not behavior) · @persona (who can see/do what) ·
@destructive (mutates shared state — runs --workers=1, wins over any other tag, requires cleanup).
Tag the test, never the describe. npm run test:smoke etc. filter by tag via --grep.
(tag docs)
@contract and @persona exist mainly for the salesforce profile, where metadata drift and the
permission matrix are distinct test types you want to run on their own cadence — contract checks on every
push, the persona matrix before a permissions release. They're profile-agnostic though: any app with a
generated contract or a role model can use them. See salesforce-metadata-contract / salesforce-personas.
Independence (parallel-safe)
- Tests run in any order, in parallel. No test depends on another's side effects.
- Create your own data (factory/helper fixture); clean it up in teardown (runs on failure).
@destructivetests that touch shared state must restore it inafterEach/afterAll.
Cleanup
Prefer API/fixture teardown over UI cleanup (faster, runs on failure). Never leave data behind.
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.

