Write a Scenario Test
You just implemented a feature or fixed a bug. Now write a scenario test that validates the user-facing behavior.
Process
- •
Examine what changed:
- •Run
git diff --name-onlyto see modified files - •Read the changed files to understand what user-facing behavior was added or modified
- •Focus on: new routes, new API endpoints, new UI interactions, changed workflows
- •Run
- •
Check existing scenarios:
- •Read all files in
test/scenarios/*.md - •Check if an existing scenario already covers this behavior
- •If yes, update the existing scenario instead of creating a new one
- •Read all files in
- •
Write the scenario:
- •Create a new file in
test/scenarios/<descriptive-name>.md - •Follow the format from existing scenarios (see
test/scenarios/spawn-single-session.mdas reference) - •Sections: title, description paragraph,
## Preconditions,## Verifications - •Write from the user's perspective — what goal are they trying to accomplish?
- •Verifications should mix UI checks and API checks
- •Create a new file in
- •
Generate the test:
- •Invoke the
/generate-scenario-testsskill to regenerate all Playwright tests - •Or manually write the
.spec.tsfile following the template pattern
- •Invoke the
- •
Verify:
- •Run
cd test/scenarios/generated && npx tsc --noEmitto check types - •Present the scenario file and generated test for review
- •Run
Rules
- •One scenario per user goal (not per code change)
- •Keep scenarios focused — a scenario for "spawn a session" should not also test "edit nickname"
- •Use plain English, not code, in the scenario file
- •The scenario file is the source of truth; the generated test is derived from it