Recipes
Every recipe shows one scenario twice: the test you write, and the documentation it generates. Pick your framework in the tab strip on any recipe and the rest of the site follows that choice.
Step structure
Section titled “Step structure”How Given, When, and Then read when you repeat them. A repeated keyword renders as And from the second occurrence onward.
Contrast and explicit keywords
Section titled “Contrast and explicit keywords”story.and() and story.but() never auto-convert, so use them when the wording matters more than the keyword arithmetic.
Attaching data to a step
Section titled “Attaching data to a step”Tables, JSON, and code blocks travel with the step they belong to, so a reader sees the payload rather than a description of it.
Scenario outlines
Section titled “Scenario outlines”Loop over your cases and register one scenario per row. No Examples table, no placeholder syntax, just the language you already write.
Shared setup and business rules
Section titled “Shared setup and business rules”Where this code lives
Section titled “Where this code lives”Each snippet is lifted from a suite that runs in CI, so none of it drifts:
| Adapter | Source |
|---|---|
| Vitest | apps/vitest-example/src/replicate.story.test.ts |
| Jest | apps/jest-example |
| Playwright | apps/playwright-example |
| Cypress | apps/cypress-example |
| Go, Python, Rust, Kotlin, C# | packages/executable-stories-* |
For the full API behind these recipes, see the story and doc API reference.