Module:
Tag:
Term:
pytest-given report --report-url re-renders a saved report for another URL
Given
a saved report served from
/dev/When
it is re-rendered with
--report-url set to /1.0/Then
the command succeeds
the copy buttons' citations link the
/1.0/ URLpytest-given report --glossary-only renders only the glossary
Given
a saved report with a scenario and a glossary
When
it is re-rendered with
--glossary-onlyThen
the command succeeds
the page shows only the glossary, and no scenario
the JSON report is unchanged
The
citations exit code says whether a citation finding remains, so CI can gate on it
Given
a document with a citation that is {citation}
a JSON report that is {report_state}
When
pytest-given citations {command} runs on the documentThen
it exits {exit_code}
the document {is rewritten / is left alone}
| citation | document | report_state | command | exit_code | rewritten |
|---|---|---|---|---|---|
| current | readable | check | 0 | False | |
| stale | readable | check | 1 | False | |
| stale | readable | update | 0 | True | |
| of a gone scenario | readable | update | 1 | True | |
| stale | unreadable | update | 2 | False | |
citations refuses documents that never link the report, rather than passing them
Given
a document whose citation links another URL
a JSON report served from https://example.org/report.html
When
pytest-given citations check runs on the documentThen
it exits 2, as for a report it cannot read
the error names the URL it looked for
Without
--report, citations reads the JSON report a bare --given-json writes
Given
a JSON report at
given-report/report-data.jsona document with a stale citation
When
pytest-given citations update runs on it without --reportThen
it exits 0
the citation reads what that report says
citations check --list prints every report link, its findings under it
Given
a document with two citations, one of them stale, and a plain report link
a JSON report of its scenarios
When
pytest-given citations check --list runs on the documentThen
each report link is a line, with each finding indented under its own
it exits 1 for the finding
--covering leaves report links out of the list but still counts their findings
Given
a document whose stale citation cites
test_refund, not test_paya JSON report of its scenarios
When
pytest-given citations check --covering names test_payThen
only the citation of
test_pay is listedthe summary counts the finding it left out
it exits 1 for that finding
skills install removes what no bundled file accounts for, the directories it empties included
Given
installed skills holding a stale file two directories deep
When
skills install runs again
Then
it succeeds
the stale file and both directories it emptied are gone
a bundled file beside them stays in place
A scenario reaches the report with its tags and term refs
Given
a scenario with a tag, whose step names a glossary term
When
the suite runs with --given-json
Then
the test passes
the scenario carries its title, its tag and its three steps
the given step holds a term ref to the term
A chained failure reports the frames of its own error, and its cause apart
Given
a scenario failing through a cause
When
the suite fails and the report is written
Then
the error's frames hold the line that raised it
the cause is reported apart, with the sentence leading on to the error
A scenario failing on a pytest-given refusal points at the test, not at pytest-given
Given
a suite that nests across phases and mistypes a term
When
the suite runs with --given-json
Then
both scenarios fail
each failure ends on its own test function
The report lists scenarios by file, then by line, whatever order pytest ran them in
Given
test_b.py with one scenario
test_a.py with a scenario method above a scenario function
When
the suite runs with test_b.py named before test_a.py
Then
test_a.py's scenarios come first, in the order the file declares them
A test without
@scenario stays out of the report
Given
a suite whose only test is undecorated
When
the suite runs with --given-json
Then
the test itself passes
the report holds no scenario
A step fixture is grafted in as a given step
Given
a scenario consuming a step fixture
When
the suite runs with --given-json
Then
the test passes
the step from the fixture leads the recorded steps
A scenario is timed from past its step fixture setup
Given
a scenario whose step fixture takes half a second
When
the suite runs with --given-json
Then
the test passes
the recorded duration leaves out the half second of setup
The cases of a parametrized scenario become one scenario with a parameter table
Given
a parametrized scenario over two cases
When
the suite runs with --given-json
Then
both cases pass
the two runs collapse into one scenario
the parameter table holds a param column per argument
it holds one row per case, with that row's values
the grouped steps carry a placeholder per matching name
A parameter table names its rows by their case IDs when any is custom
Given
a parametrized scenario whose first case is written {first_case}, the other left to pytest
When
the suite runs with --given-md
Then
both cases pass
the parameter table case ID column is {id_column}
a shown column puts the custom case ID beside the generated one
| first_case | id_column |
|---|---|
| pytest.param(20, False, id="touching-edges") | shown |
| (20, False) | omitted |
A refusal on a run that writes no report does not claim one was skipped
Given
a suite whose narration varies across parametrize cases
When
the suite runs with no --given-* output flag
Then
the refusal is reported without claiming a report was skipped
A refused run discards the previous run's report
Given
a suite whose narration varies across parametrize cases
a report on disk from a previous run
When
the suite runs with those output flags
Then
the run says no report was written, naming the file
the stale files are gone rather than left reading as current
A source link value that cannot work stops the run before it collects
Given
a suite that would otherwise pass
When
the suite runs with --given-source-link={value}
Then
the run ends as a usage error, saying {error}
no test ran
| case ID | value | error |
|---|---|---|
| misspelled-preset | bogus | Unknown --given-source-link preset |
| unknown-variable | {bogus} | Unknown source-link template variable |
An unknown source link preset in an ini reports the ini name
Given
a suite configured through the ini rather than the flag
When
the suite runs with an HTML report
Then
the error names the ini setting, not a flag the user never typed
A report that fails to render leaves no report behind, not even the previous one
Given
a suite with one scenario
a report pair on disk from a previous run
When
the run trips a renderer failure
Then
the run fails, saying no report was written
neither the stale pair nor a half-written new one survives
A fixture failing in teardown fails its finished scenario
Given
a scenario whose fixture raises after its yield
When
the suite runs with --given-json
Then
pytest counts the test passed and its teardown an error
the report marks the scenario failed with the teardown error
A step fixture refuses steps and attachments in its teardown
Given
a step fixture that adds a {late} after its yield
When
the suite runs
Then
the test passes but its teardown errors with a PytestGivenError
| late | suite |
|---|---|
| step | |
| attachment | |
A fixture takes only
@given, never @when or @then
Given
a fixture decorated with @{decorator}
When
the suite runs
Then
a PytestGivenError points at @given
| decorator | suite |
|---|---|
| when | |
| then | |
A scenario that fails as expected keeps its steps, error and reason under its own status
Given
a scenario marked xfail whose body fails
When
the suite runs with --given-json
Then
pytest counts the test xfailed
the report marks the scenario xfailed with its reason, its steps and the error that broke it
The report stores a definition as written, each definition ref a term ref part
Given
a glossary declared in code whose Guest definition bolds Room, a term declared after it
When
the suite runs with --given-json
Then
the definition's text is as written, bold included
its parts hold the definition ref as a term ref to Room
An editor source link opens the file under the rootdir, wherever pytest runs from
Given
a suite whose test sits in a subdirectory, run from inside it
When
the HTML report renders with the vscode preset
Then
the link names the test file's path from the rootdir
A scenario is matched against each of its stories
Given
a scenario binding two stories whose sentence its narration fits
When
the suite runs with --given-json
Then
the test passes
the scenario binds both stories and covers the sentence of each
A declared story appears in the report even when no scenario covers it
Given
a suite declaring a story that no scenario names or pins
When
the suite runs with --given-json
Then
the report lists the story, its sentence covered by nothing
A pinned scenario still counts its step pins
Given
a scenario pinning one sentence, whose steps pin a second and narrate a third
When
the suite runs with --given-json
Then
the scenario covers both pinned sentences and not the one its narration would match
A step pin into a story outside stories= covers it
Given
a step pinning a story its scenario does not name
When
the suite runs with --given-json
Then
the scenario passes and covers the pinned sentence, in the story it did not name
A wide fixture recording keeps its pins in every scenario it is grafted into
Given
a module-scoped step fixture pinning a sentence, set up first by an unannotated test
When
the suite runs with --given-json
Then
every test passes, and both scenarios cover the pinned sentence, whichever story they name
A given annotation's pin lands on the step it adds
Given
a scenario whose given annotation on a plain fixture carries a pin
When
the suite runs
Then
the annotation's step carries the pin
A given annotation retells the pins of the step fixture label it replaces
Given
a story
a, and a given annotation with pins={annotation_pins} over a step fixture pinning a[1]When
the suite runs
Then
the grafted root pins the sentences {root_sentences} of
athe inner step keeps its own pin, a[3]
| case ID | annotation_pins | suite | root_sentences |
|---|---|---|---|
| none-keeps | None | [1] | |
| empty-clears | [] | [] | |
| list-replaces | [a[2]] | [2] | |
A plugin registered from a conftest warns instead of degrading silently
Given
a scenario and a conftest that registers the plugin
When
the suite runs with plugin autoload disabled
Then
the run passes and the report is still written
the scenario keeps its rootdir-relative source
pytest's warnings summary says it loaded too late to prepare capture
A glossary declared in a test module reaches the report without a story
Given
a test module that declares a glossary, with no story and no conftest
When
the suite runs with --given-json
Then
the report carries the glossary
A glossary a test constructs while it runs is not the suite's glossary
Given
a test module with a glossary, whose test constructs another one
When
the suite runs with --given-json
Then
the report carries the module's glossary
A suite's modules may construct only one glossary
Given
a conftest and a test module that each construct a glossary
When
the suite runs with --given-json
Then
the run fails without a report, naming where each glossary was constructed
A
Template given annotation on an unparametrized scenario fails that scenario
Given
a
Template given annotation on a plain fixture parameterWhen
the suite runs with an HTML report
Then
the scenario errors, naming the parameter and the fix
the HTML report is still written
A
Template given annotation may only hold a bare parametrize column
Given
a parametrized scenario over
x, with a plain fixture room whose Template given annotation holds {placeholder}When
the suite runs
Then
the scenario errors, saying {error}
| case ID | placeholder | suite | error |
|---|---|---|---|
| plain-fixture | {room} | '{room}' in the given annotation on parameter 'room' does not match any parametrize column (have: ['x']). A given annotation reads only parametrize columns, not fixture values. To show a fixture value, narrate it in a t-string in the test body. | |
| attribute | {room.number} | only supports bare identifiers as placeholders; got 'room.number' | |
A bare run writes no report at all
Given
a suite with one scenario
When
the suite runs with no output flag
Then
the run passes
no report directory appears in the default location
A bare
--given-md prints the narration to stdout
Given
a suite with one scenario
When
the suite runs with a bare --given-md
Then
the narration is printed between the fence markers
A report is not written over by a run that runs no tests
Given
a suite with one scenario and its written report
When
the suite runs again with {mode}
Then
the run passes
the report on disk is still the one the real run wrote
the summary says no report was written, because {reason}
| mode | reason |
|---|---|
| --collect-only | a --collect-only run runs no tests |
| --setup-only | a --setup-only run stops before the tests |
| --setup-plan | a --setup-plan run plans setup but runs no tests |
The Markdown report leaves the line out of each scenario anchor under
given_md_lines = false
Given
a suite with one scenario, and
given_md_lines = falseWhen
the suite runs with --given-md
Then
the anchor is the node ID, without a line number
--given-md-source ends each scenario of the Markdown report with its test function, under its line numbers
Given
a suite with one scenario
When
the suite runs with --given-md and --given-md-source
Then
the narration is followed by the test function, decorator included, each line numbered as in the file
--given-html alone writes no JSON report
Given
a suite with one scenario
When
the suite runs with --given-html alone
Then
the HTML rendering is written
no JSON lands in the default location
An output flag pointed at a source file is refused before the suite runs
Given
a suite with one scenario
When
a bare --given-html swallows the test path that follows it
Then
the run is refused, naming the path and the flag-order fix
the source file is left exactly as it was, not overwritten
A rejected authoring form fails the run and writes no report
Given
a suite whose narration varies across parametrize cases
When
the suite runs with all three output flags
Then
the run fails, naming the offending form
not one report file is written, and no traceback escapes
--given-title names the report instead of the rootdir
Given
a suite with one scenario
When
the suite runs with --given-title
Then
the test passes
the title reaches the JSON metadata
the title also heads the Markdown rendering
--given-theme sets the theme the HTML report opens in
Given
a suite with one scenario
When
the suite runs with --given-theme=dark
Then
the test passes
the page declares dark as its default theme
A Markdown report printed to stdout is UTF-8, whatever the console's code page
Given
a suite that passes
a console whose code page is cp1252, which has no status glyphs
When
the suite runs with a bare --given-md, in its own process
Then
the scenario heading carries its ✓ glyph, not an escape
An unknown theme stops the run before it collects
Given
a suite that would otherwise pass
When
the suite runs with a misspelled theme, and no HTML report
Then
the run ends as a usage error, naming the flag the user typed
no test ran
A parametrized scenario can decline the grouping and keep one scenario per case
Given
a parametrized scenario over two cases that declines the grouping
When
the suite runs with --given-json
Then
both cases pass
each case is its own scenario, titled with its id, with no parameter table
A run that writes no report still enforces the grouping rules
Given
a suite whose f-string narration records no parts
When
the suite runs with no output flag
Then
the run still fails, naming the offending form
Every scenario carries the
pytest_given marker
Given
a suite with a scenario, a parametrized scenario and a plain test
When
the suite runs with -m pytest_given
Then
the scenario and every case run
the plain test is deselected
Boolean phrases word a Boolean in the step, and the parameter table keeps the Boolean
Given
a parametrized scenario narrating a Boolean with phrases
When
the suite runs with --given-md
Then
both cases pass
the step shows both phrases
the parameter table shows the Booleans
A boolean phrase over a value that is not a Boolean fails that case, and the report is still written
Given
a t-string step with phrases, and a case of
NoneWhen
the suite runs with --given-md
Then
that case fails and the other passes
the failure names the spec and the type of the value
the report is written, with the value in that row
A
Template boolean phrase over a value that is not a Boolean fails the run
Given
a
Template scenario title with phrases, over a passing NoneWhen
the suite runs with --given-md
Then
the run names the slot, the test and the type of the value
no report is written
A markdown glossary's kindless terms reach the report with the kinds the run infers
Given
a markdown glossary of kindless terms and a story whose sentence uses them
When
the suite runs with --given-json
Then
the scenario passes
each term in the report takes the kind of its slot: actor, activity, object
A saved report re-renders with each term's glossary section and avoided words
Given
a suite whose code glossary sorts terms into two glossary sections and gives one avoided words
When
it runs with --given-json and the report is re-rendered
Then
the run passes and the re-render succeeds
the glossary view groups the terms by glossary section
the avoided words survive, note included
the page data carries each avoided word as a plain word
Narration lint is off unless it is asked for
Given
a suite with one flawed step
When
the suite runs without the lint flag
Then
the run passes and says nothing about the lint
no step source is recorded, so the AST surface costs nothing
An error-severity lint finding fails the run
Given
a suite whose given step has an empty body
When
the suite runs with the lint enabled
Then
the run exits failed, naming the lint rule and the step
A narration lint run that finds nothing says so
Given
a suite whose steps are all sound
When
the suite runs with the lint enabled
Then
the run passes
the summary says the lint ran and found nothing
every step source is recorded for the AST rules
A lint rule downgraded to warn reports without failing the run
Given
a suite whose given step has an empty body
When
the suite runs with that lint rule set to warn
Then
the run still passes
the lint finding is printed anyway
An ignore entry suppresses the lint findings it matches, and one that matches nothing fails the run
Given
a suite with {suite}
When
the suite runs with the lint and given_lint_ignore={entry}
Then
the lint outcome is {outcome}, and only a suppressed run passes
an unsuppressed lint finding is reported as an error
an entry that suppressed nothing is reported as stale
| suite | test file | entry | outcome |
|---|---|---|---|
| a flawed step | '' | reported | |
| a flawed step | '*::test_empty_given' | suppressed | |
| a flawed step | 'empty-step: *::test_empty_given' | suppressed | |
| a clean step | '*::test_nothing' | stale | |
Either narration lint flag overrides the ini for one run
Given
a suite with one flawed step
When
the suite runs with the lint enabled by ini but off by flag
Then
the lint does not run
When
the suite runs with the lint disabled by ini but on by flag
Then
the lint runs and its error finding fails the run
An error lint finding leaves a more specific exit code alone
Given
a suite whose lint would fail, under a stale ignore entry
When
the suite runs deselected, so nothing is collected
Then
the lint still reports the stale entry as an error lint finding
the run keeps NO_TESTS_COLLECTED rather than reporting a test failure
A failure inside the lint keeps the report it was handed
Given
a clean suite and a lint pass that raises
When
the suite runs with an HTML report
Then
the failure is summarized as the lint's, rather than raised as a traceback or titled as a report that was not written
the report that was already written is still there
Under pytest-xdist, a report or the narration lint runs on --dist loadfile, which pytest-given picks when no --dist is given
Given
a suite that would otherwise pass
When
pytest starts with {args}
Then
the run settles on --dist {dist}
| case ID | args | dist |
|---|---|---|
| bare | -n 2 --given-json=report.json | loadfile |
| loadfile | -n 2 --dist loadfile --given-lint | loadfile |
| neither | -n 2 --no-given-lint | load |
Under pytest-xdist, a report or the narration lint stops before it collects when another --dist is chosen
Given
a suite that would otherwise pass
When
the suite runs with {args}
Then
it stops with a usage error, before any test runs
| case ID | args |
|---|---|
| load | -n 2 --dist load --given-json=report.json |
| worksteal | -n 2 --dist worksteal --given-lint |
| distload | -n 2 -d --given-json=report.json |
Under pytest-xdist, the report and the narration lint see the same scenarios, storys and glossary as a serial run
Given
two test files, one declaring a story and its glossary
an ignore entry for test_a.py and an empty step in test_b.py
When
the suite runs with --given-lint without -n, and on 2 xdist workers
Then
each file ran on a worker of its own
both reports hold the same scenarios, stories and glossary
both runs flag the empty step in test_b.py, and neither finds the ignore entry stale
A scenario records under its node ID
Given
a fresh collector
When
a scenario starts under its node ID and finishes
Then
it carries its node ID, scenario title, status and tag
The collector records each step with its phase
Given
an active scenario in a fresh collector
When
a given and a when step are pushed
Then
each step carries its phase
Steps pushed during fixture setup record into the fixture recording
Given
a fixture recording under setup
When
a step is pushed inside the fixture body
Then
it is recorded as a child of the recording root
An attachment lands on the step being recorded
Given
a fixture recording under setup
When
an attachment is attached inside the fixture body
Then
the attachment lands on the recording root
Fixture-body steps do not leak into the active scenario
Given
an active scenario with a fixture recording
When
a step is pushed inside the fixture body
Then
the step lives only in the recording, not the scenario
An attachment outside every step is refused
Given
an active scenario with no step open
When
an attachment is made from the test body
Then
it is refused rather than dropped
Each graft gets its own copy of the fixture recording
Given
a fixture recording with a nested child step
When
a graft copies it into the active scenario
Then
the scenario gains a deep copy of the recorded steps
A teardown failure keeps the error the scenario already carries
Given
a scenario that already failed in its body
When
its fixture then also fails in teardown
Then
the body failure is what the report shows
A collector reports which node IDs it recorded
Given
a collector that recorded one scenario
When
the recorded and an unrecorded node ID are both asked about
Then
only the recorded node ID is claimed
A given annotation with no recording behind it is grafted as a childless given step
Given
an active scenario is being recorded
When
a given annotation is grafted on its own
Then
the step is a given with no children
Grafting with a given annotation replaces the root label but keeps children
Given
a fixture recording whose root has a label and a child
When
the graft carries a given annotation
Then
the grafted root shows the annotation's text and keeps its children
Grafting with no active scenario is refused
Given
a collector with no active scenario
When
a leaf graft runs
Then
the invariant is asserted rather than silently dropping the step
A definition ref names its term by canonical name or S-form, in any case
Given
a glossary whose Step definition bolds "phase" and "Attachments"
When
its definition refs resolve at session finish
Then
each bold span is a term ref to the term it names, in the words its author wrote
A markdown glossary looks terms up case-insensitively
Given
a markdown glossary loaded from a Markdown file
When
the same term is looked up in three different cases
Then
every lookup resolves to one handle type and the same id
Repeated lookups return the same handle
Given
a markdown glossary loaded from a Markdown file
When
the same term is looked up twice
Then
both lookups return the one memoized handle
File-loaded terms start kindless
Given
a Markdown glossary file with no kind column
When
a markdown glossary loads it
Then
each term is kindless until kind inference runs
A misspelt name looked up in a markdown glossary gets a spelling hint
Given
a markdown glossary loaded from a Markdown file
When
a misspelt term is looked up
Then
a PytestGivenError is raised with a spelling hint
Handles are usable inline in a sentence
Given
a markdown glossary loaded from a Markdown file
When
its handles build a sentence
Then
each slot becomes a term ref
Calling a handle overrides its display
Given
a markdown glossary loaded from a Markdown file
When
a handle is called to name an instance
Then
the term ref carries the overridden display
An explicit kind column sets term kinds
Given
a Markdown glossary with an explicit Kind column
When
the markdown glossary reads the Kind column
Then
kinds come straight from the file, not kind inference
A kind column can be selected by integer index
Given
a Markdown glossary with the kind in the third column
When
the markdown glossary selects the kind column by index
Then
the kinds are read from that column
A
work_object kind cell maps to the work object kind
Given
a glossary whose Kind cell says work_object
When
the markdown glossary parses the kind
Then
it normalizes to the work object kind
An unrecognized kind value is rejected
Given
a glossary whose Kind cell holds an unknown value
When
the markdown glossary loads the file
Then
a PytestGivenError names the unrecognized kind
A missing glossary file is refused as not found
Given
a path to a file that does not exist
When
a markdown glossary is opened on that path
Then
a PytestGivenError reports the file is not found
A term cell with no alphanumeric characters is rejected
Given
a row whose term cell has no id-able characters
When
the markdown glossary loads the file
Then
a PytestGivenError is raised with file:line context
A markdown glossary error about its tables names the file
Given
a glossary file with {problem}
that file on disk as bad.md
When
a markdown glossary loads it
Then
a PytestGivenError names the file before the problem: {message}
| problem | Glossary file | message |
|---|---|---|
| no table | bad.md: found no Markdown pipe table | |
| a header but no data rows | bad.md: the glossary file's Markdown table has no data rows | |
| no Term column | bad.md: column 'Term' | |
Duplicate rows for one term collapse only when identical
Given
two rows for one term, with {identical definitions / different definitions}
When
the markdown glossary loads the file
Then
the rows yield {outcome}
a refusal points at the second row as the conflict
| identical | Glossary file | outcome |
|---|---|---|
| True | one term | |
| False | refused | |
A blank definition normalizes to undefined
Given
a row whose definition cell is blank
When
the markdown glossary parses it
Then
the term definition is None, i.e. undefined
Calling a markdown glossary looks up a known term
Given
a markdown glossary loaded from a Markdown file
When
a known term is looked up by call
Then
a deferred term is returned
A markdown glossary is a closed vocabulary
Given
a markdown glossary loaded from a Markdown file
When
an unknown name is called
Then
a PytestGivenError is raised
no new term was created
A markdown glossary reads each term's glossary section from the heading above it
Given
a Markdown glossary with a table under each of two headings
When
a markdown glossary loads it
Then
each term names the heading above its table
A term repeated under two headings of a markdown glossary raises, identical rows included
Given
a Markdown glossary with the same row under two headings
When
a markdown glossary loads it
Then
a PytestGivenError names the line of the second row
A markdown glossary reads term paragraphs
Given
a Markdown glossary of term paragraphs under
## LanguageWhen
a
ParagraphGlossary loads itThen
each term takes its definition from the lines under its bold name
the
_Avoid_: line lists the words the term avoids## Language holds the terms rather than naming a glossary section
A term's ID is its name as a URL-safe slug
Given
the name {text}
When
it is slugified into a term id
Then
the id is {slug}
| text | slug |
|---|---|
| 'Guest' | 'guest' |
| 'Order received' | 'order-received' |
| ' Work Object ' | 'work-object' |
| 'do_the_thing' | 'do-the-thing' |
| 'Buy / sell' | 'buy-sell' |
| 'Guest #1' | 'guest-1' |
| 'café' | 'caf' |
| 'booking system' | 'booking-system' |
A term name that leaves no slug is refused
Given
the name {text}
When
it is slugified into a term id
Then
a PytestGivenError reports the derived id is empty
| text |
|---|
| '---' |
| ' ' |
| '' |
| '###' |
Calling an actor names a distinct instance
Given
an actor handle for Guest
When
the actor is called with a name
Then
an instance with a distinct display is returned
Calling an activity records an inflection of the same term
Given
an activity handle for confirm
When
the activity is called with a surface form
Then
an inflection sharing the activity identity is returned
Registering an actor returns a typed handle
Given
an empty glossary
When
an actor is registered with a definition
Then
a handle carrying the actor kind is returned
Re-registering a term is idempotent only with matching fields
Given
an actor already registered with a definition
When
the same name is registered again, with {the same definition / a different definition}
Then
the re-registration yields {outcome}
a refusal reports the conflict with the prior registration
| same_definition | outcome |
|---|---|
| True | one shared term |
| False | refused |
The same name cannot be two different kinds
Given
a name already registered as an actor
When
the same name is registered as an activity
Then
a PytestGivenError reports the conflict with the prior registration
Registering an actor captures its definition site
Given
a rootdir-aware glossary
When
an actor is registered
Then
the term records a source link to this file
Calling the glossary declares a kindless term
Given
an empty glossary
When
a term is declared by call, without a kind
Then
the term is registered as kindless
The lowercase handle form lowercases only capitalized words
Given
a term named {canonical}
When
its lowercase handle form is taken
Then
it reads {lowered}
| canonical | lowered |
|---|---|
| 'Booking Request' | 'booking request' |
| 'LLM Call' | 'LLM call' |
| 'Check-In' | 'check-in' |
| 'Plan B' | 'plan B' |
| 'E-Mail' | 'e-mail' |
| 'LLM-Based Search' | 'LLM-based search' |
| 'iPhone' | 'iPhone' |
| 'McDonald' | 'McDonald' |
The S-form and lowercase handle forms chain, and every reading stays the same term
Given
a term named {canonical}
When
the handle forms {forms} are applied in order
Then
it reads {reading} and refers to the same term
| canonical | forms | reading |
|---|---|---|
| 'Room' | 's' | 'Rooms' |
| 'Room' | 'l.s' | 'rooms' |
| 'Room' | 's.l' | 'rooms' |
| 'Box' | 'l.s' | 'boxes' |
| 'Category' | 'l.s' | 'categories' |
| 'API Key' | 'l.s' | 'API keys' |
| 'API' | 's' | 'APIs' |
| 'book' | 's' | 'books' |
The S-form and lowercase handle forms also apply to a called form
Given
a term named "Room"
When
it is called as "Deluxe Suite" and both forms are applied
Then
it reads "deluxe suites" and refers to the same term
Subscript looks up an already-declared term
Given
a glossary with one declared term
When
the name is looked up by subscript
Then
the returned term is the declared one
Subscripting an unknown name raises with a hint
Given
a glossary with one declared term
When
a near-miss name is subscripted
Then
a PytestGivenError is raised with a spelling hint
A code glossary groups terms into glossary sections
Given
a glossary with a "Booking" section
When
a term is declared through the section and another outside it
Then
only the first term carries the glossary section
the declared term records the line of the call in this file
A kindless term takes its kind from the slots it fills
Given
a kindless term filling the {slots} slots, one story each
When
kind inference runs over the stories
Then
the inferred kind is {kind}
| slots | kind |
|---|---|
| actor | actor |
| verb | activity |
| noun | object |
| actor, noun | actor |
A kindless term filling incompatible slots is refused
Given
a kindless term filling the {slots} slots, one story each
When
kind inference runs over the stories
Then
a PytestGivenError names the term and the conflict
| slots |
|---|
| verb, actor |
| verb, noun |
A declared kind must fit the slot its term fills
Given
a term declared as {declared}
a story putting it in the {slot} slot
When
kind inference runs over the story
Then
the declared kind is {outcome}
a refusal names the declared kind and the slot
| declared | slot | outcome |
|---|---|---|
| actor | actor | kept |
| activity | actor | refused |
| object | actor | refused |
| actor | verb | refused |
| activity | verb | kept |
| object | verb | refused |
| actor | noun | kept |
| activity | noun | refused |
| object | noun | kept |
A term named only in the second clause of a sentence gets its kind inferred
Given
a glossary of kindless term entries
a sentence whose second clause starts at another actor
When
kind inference runs over its story
Then
the first term of the second clause is an actor
A declared kind's conflict names only the stories that put its term in the wrong slot
Given
an actor term that also appears in a verb slot
When
kind inference runs over both stories
Then
a PytestGivenError reports the declared actor in a verb slot
only the offending story is named in the message
An inferred kind's conflict names only the stories whose slots disagree
Given
a kindless term used in verb, actor and noun slots
When
kind inference runs over all three stories
Then
a PytestGivenError reports the verb-vs-actor conflict
only the verb and actor stories are named, not the noun one
Slot positions alternate verb/noun after the actor
Given
the five positions of a short clause
When
the slot rule is applied to each position
Then
position 0 is the actor slot, then verb and noun alternate
A pipe table parses into term and definition rows
Given
a Markdown document with one pipe table
When
the parser reads it into rows for a markdown glossary
Then
each row carries a term, definition and source line
Multiple tables in one file are merged
Given
a document containing two separate pipe tables
When
the parser reads the whole document
Then
every table contributes its term rows
Columns can be selected by header name
Given
a table with custom, differently-cased header names
When
the parser selects columns by header name
Then
the named columns are matched case-insensitively
Escaped pipes are preserved in cells
Given
cells containing escaped pipe characters (\|)
When
the parser splits the row
Then
the escaped pipe survives as a literal pipe
A markdown glossary table the parser cannot read is refused, saying what is wrong
Given
a Markdown document with {document}
the columns selected as {columns}, the rest left at their defaults
When
the parser reads the document
Then
a PytestGivenError says {message}
| document | Markdown document | columns | message |
|---|---|---|---|
| no pipe table | {} | found no Markdown pipe table | |
| one pipe table | {'term_column': 'Nope'} | column 'Nope' not found | |
| one pipe table | {'definition_column': 5} | column index 5 is out of range | |
A markdown glossary reads the tables a GFM renderer shows, and no others
Given
a Markdown document with {document}
When
the parser reads the document
Then
it reads the term and definition rows {rows}
| document | Markdown document | rows |
|---|---|---|
| a table in a blockquote | [('Quoted', 'yes')] | |
| a table in an indented code block | [('Real', 'yes')] | |
| a separator row narrower than its header | [('Real', 'yes')] | |
| a data row narrower than its header | [('Short', '')] | |
| a table in a fenced code block | [('Real', 'yes')] | |
| a pipe line with no separator row | [('Real', 'yes')] | |
A term or kind cell is read as its plain text, with emphasis unwrapped
Given
a {column} cell written as {cell}
When
the parser reads the row
Then
the {column} is {plain}
| column | cell | plain |
|---|---|---|
| term | **Scenario** | Scenario |
| term | *Step* | Step |
| term | `given` | given |
| term | work_object | work_object |
| term | `a*b*c` | a*b*c |
| term | __Scenario__ | __Scenario__ |
| kind | **Actor** | Actor |
| kind | `activity` | activity |
Definition markdown is left intact
Given
a definition cell rich with inline code
When
the parser reads the row
Then
the definition keeps its markup for the tooltip
A step pairs its narration with a phase
When
a given step descriptor is created
Then
it carries the given phase and its narration
A step opened outside a scenario warns rather than raising
Given
a collector recording inside an undecorated test
When
a given step is opened against it
Then
a
PytestGivenWarning is raised, not an errorit names the missing
@scenario, so a suite can filter it
when_then records the action and its outcome as siblings
Given
an active scenario in a local collector
When
a when_then block exits cleanly
Then
a when and a sibling then step are recorded
when_then pairs with an inner
pytest.raises
Given
an active scenario in a local collector
When
the when_then body raises and an inner pytest.raises swallows it
Then
both sibling steps are still recorded
when_then omits the then when the body raises uncaught
Given
an active scenario in a local collector
When
the when_then body raises with nothing catching inside
Then
only the when step is recorded — the outcome never held
Inside a when_then body only a when may open, as a child of the action
Given
an active scenario in a local collector
When
a {phase_name} step opens inside the when_then body
Then
the inner step is {outcome}
a refusal reports the cross-phase nesting
the step stack is left balanced
| phase_name | outcome |
|---|---|
| when | nested |
| given | refused |
| then | refused |
@scenario marks the test function without wrapping it
Given
a test function taking one fixture
When
the function is decorated
Then
the very same function comes back, keeping its signature
it is recognized as a scenario, with its title; a plain function is not
An attachment label must be plain text
Given
a non-str attachment label of kind {label_kind}
When
it is attached
Then
a PytestGivenError says attachment labels are plain text
| label_kind |
|---|
| deferred-template |
| t-string |
| not-a-string |
A
Template narration is refused in a test body
Given
an active scenario in a local collector
When
a {phase_name} step opens on a
TemplateThen
a PytestGivenError says a template is not supported in a test body
| phase_name |
|---|
| given |
| when |
| then |
A pin takes a sentence handle from its story, never a bare number or name
Given
the bare sentence reference {written}
When
a step is declared with it as its pin
Then
a PytestGivenError shows the handle form
| written |
|---|
| 2 |
| cancel |
| [1, 2] |
An actor handle in a clause becomes a term ref
Given
a Guest actor
a search activity
a Room work object
When
a clause is built from three glossary handles
Then
the actor slot becomes a term ref
An inflected activity keeps its term identity but shows the inflection
Given
a Guest actor
a search activity
a Room work object
an activity handle called with an inflection
When
it takes the verb slot of a clause
Then
the term ref shows the inflection over the same activity
A bare string in a clause becomes a connective word
Given
a Guest actor
a search activity
a Room work object
When
a clause is built with a bare word between term nodes
Then
the bare word becomes a clause part word, not a term ref
A clause needs at least an actor, an activity and a node
Given
a Guest actor
a search activity
When
a clause of only two parts is built
Then
a PytestGivenError rejects it as too short, counting the parts
A clause position takes only the kinds its slot accepts
Given
a Guest actor
a search activity
a Room work object
a term declared as {kind}
When
a clause is built with it at position {position}
Then
the term is {outcome}
a refusal names the position and the declared kind
| kind | position | outcome |
|---|---|---|
| actor | 0 | accepted |
| actor | 1 | refused |
| actor | 2 | accepted |
| object | 0 | refused |
| object | 1 | refused |
| object | 2 | accepted |
| activity | 0 | refused |
| activity | 1 | accepted |
| activity | 2 | refused |
| None | 0 | accepted |
| None | 1 | accepted |
| None | 2 | accepted |
A bare string may fill any slot of a clause, as a word
Given
a Guest actor
a search activity
a Room work object
the bare string "plain"
When
a clause is built with it at position {position}
Then
it becomes a clause part word there
the other parts stay term refs
| position |
|---|
| 0 |
| 1 |
| 2 |
A clause may be fully bare words
Given
three plain words with no glossary handles
When
a clause is built from them
Then
every part is a clause part word
A connective word may join a second actor onto a clause
Given
an actor, an activity, a work object and a second actor
When
they form a five-part clause joined by a connective
Then
even positions are term-ref nodes and the connective stays a word
A clause may not end on a dangling edge
Given
an actor, activity and work object plus a connective
When
a clause ending on a connective edge is built
Then
a PytestGivenError names the trailing arrow with no target
A sentence built from loose parts holds them as one clause
Given
a Guest actor
a search activity
a Room work object
When
a sentence is built from handles directly
Then
it wraps a single clause
A sentence may hold several clauses
Given
a Guest actor
a search activity
a Room work object
two clauses
When
they are combined into one sentence
Then
the sentence carries both clauses
Mixing loose parts and prebuilt clauses is rejected
Given
a Guest actor
a search activity
a Room work object
a prebuilt clause
When
it is combined with loose handles in one sentence
Then
a PytestGivenError rejects the mix
A story auto-numbers its sentences from one
Given
a Guest actor
a search activity
a Room work object
When
a story is built from two sentence rows
Then
the sentences are numbered 1 and 2
A story derives its id from its title
Given
a human-readable story title
When
a story is built from it
Then
its id is the slugified title
A sentence handle is looked up by name or by number
Given
a Guest actor
a search activity
a Room work object
a story whose second sentence is named
When
the sentence is looked up by its name and by its number
Then
both handles name sentence 2 of that story
Iterating a story yields its sentence handles
Given
a Guest actor
a search activity
a Room work object
a story of two sentences
When
the story is iterated
Then
it yields each sentence handle in order
Looking up a missing sentence lists the ones the story has
Given
a Guest actor
a search activity
a Room work object
a story with an unnamed and a named sentence
When
an unknown name is looked up
Then
a PytestGivenError lists the story's sentences
Two sentences of one story cannot share a name
Given
a Guest actor
a search activity
a Room work object
two sentences both named "cancel"
When
a story is built from them
Then
a PytestGivenError names the duplicate and both numbers
A sentence name must be non-empty and unpadded
Given
a Guest actor
a search activity
a Room work object
the sentence name {name}
When
a sentence is built with that name
Then
a PytestGivenError says what a name must be
| name |
|---|
| '' |
| ' cancel' |
| 'cancel ' |
Two stories with the same id collide
Given
a story already declared under an id
When
a second story is declared with the same slug
Then
a PytestGivenError reports the id was already declared
A clause may chain a second verb-object pair
Given
an actor, two activity and two work object handles
When
they form a five-node clause (actor verb object verb object)
Then
every slot is a term ref, with no bare words
A markdown glossary's declared kind is checked when a clause is built
Given
a markdown glossary declaring Room a work object
When
Room is placed in the verb slot
Then
a PytestGivenError names the term and its declared kind
A slot error names the term, not its repr
Given
a Guest actor
a Room work object
a search activity
When
a work object is placed in the verb slot
Then
the message names the term without dumping the glossary
the message is short and free of dataclass reprs
A non-handle clause part names its type
Given
a Guest actor
a Room work object
When
an int is passed where an activity handle belongs
Then
a PytestGivenError names the offending type and the clause
A
Template parses a bare placeholder
Given
a deferred
Template with one placeholderWhen
the template is parsed
Then
it splits into literal and placeholder narration parts
A
Template substitutes parametrize values
Given
a
Template referencing a parametrize columnWhen
a parametrize value is substituted in
Then
the placeholder is filled with that value
Identical boolean phrases are refused, since the step would read the same in every row
Given
a text with the same phrase on both sides of its format spec
When
a
Template is created from it, with no value boundThen
a
PytestGivenError quotes the spec
A
Template accepts bare identifiers only
Given
the placeholder {text}
When
a
Template is built from itThen
a PytestGivenError says bare identifiers only
| case ID | text |
|---|---|
| attribute | count={obj.attr} |
| indexing | {d[key]} |
| expression | {x + 1} |
A t-string interpolation records its rendered value and its expression
Given
a t-string step with one interpolated value
When
the t-string is parsed at runtime
Then
the interpolation becomes a narration value part
A t-string can interpolate an arbitrary expression
Given
a t-string step interpolating a computed expression
When
the t-string is parsed
Then
it renders the result, its value part recording the full expression
A handle in a t-string becomes a term ref showing what it was called with
Given
the {name} handle from the glossary, called with {called_with}
When
the handle is interpolated into a t-string step
Then
the step carries one term ref, to {term_id}
it shows {display}
| name | called_with | term_id | display |
|---|---|---|---|
| Guest | None | guest | Guest |
| Guest | Alice | guest | Alice |
| Room | None | room | Room |
| Room | Deluxe Suite | room | Deluxe Suite |
| search | None | search | search |
| search | searches for | search | searches for |
A term ref may not carry a format spec
Given
an actor handle interpolated with a format spec
When
the t-string is parsed
Then
a PytestGivenError says a term ref takes no format spec
A markdown glossary handle works in a t-string step
Given
a deferred term from a markdown glossary
When
it is interpolated into a t-string step
Then
the step carries a single term ref
A span holding a value, a placeholder or a term ref is refused
Given
a code span around a t-string value, bold around a term ref and italics around a
Template placeholderWhen
the narration of each is built
Then
each is refused, naming the part its span holds
each says the span would not render
citations update rewrites a stale citation to its target's glyph, text and summary
Given
a report where the tag
checkout has a passed and an xfailed scenarioa document citing the tag under another name, as all passed
When
the document is updated
Then
its glyph, text and summary read what the report says
no finding remains
citations update refuses a document that changed while it ran
Given
a stale citation to rewrite
When
another writer saves the document while the update analyzes it
Then
the update refuses, saying the document changed
the other writer's save is what is on disk
A plain report link claims only that its target exists
Given
a report whose one scenario fails
a document linking it, and a deleted test, in its own words
When
the document is updated
Then
only the link to the deleted test is a finding
the document is left as written
A citation whose target left the report is marked ❓ and recovers once it is back
Given
a citation of a passing scenario
When
it is updated against a report that lacks the scenario
Then
it is marked ❓, keeping its target and text
it stays a finding
When
it is updated once the report holds the scenario again
Then
it reads as current again
A citation of any case cites the grouped scenario holding it
Given
a report where the cases
[a] and [c] of test_pour group into one scenarioa document citing the case
[c]When
the document is updated
Then
the citation names its scenario by the node ID of
test_pourno finding remains
A citation keeps the emphasis its scenario title renders with
Given
a report whose scenario title sets a word in bold
a document with a placeholder citation of it
When
the document is updated
Then
its link text sets the word in bold too
citations update repoints the citation of a renamed test by its unchanged scenario title
Given
a report where
test_pay was renamed test_pay_by_card, still titled "Pay by card"a document whose citation still names
test_payWhen
the document is checked
Then
the citation is a citation finding
update fixes, naming test_pay_by_cardWhen
the document is updated
Then
the citation names
test_pay_by_cardno finding remains
A relative report link resolves from its document to where
--report-path places the report
Given
a report that stores no URL, placed at
examples/r.htmla stale citation in
guide/doc.md linking ../examples/r.htmlWhen
the document is updated with that
--report-pathThen
the citation is read as one and its glyph rewritten
--covering keeps each report link whose target counts the scenario, and each it cannot rule out
Given
a report where
test_pay is tagged checkout/card and in a story, test_refund tagged checkout/refunda document holding the report link {link}
When
its links are checked, covering
test_payThen
the report link {is kept / is dropped}
| link | kept |
|---|---|
| ✅ [Pay by card](https://example.org/report.html#scenario=t.py::test_pay) | True |
| [paying](https://example.org/report.html#scenario=t.py::test_pay) | True |
| ✅ [Refund](https://example.org/report.html#scenario=t.py::test_refund) | False |
| ✅ [checkout/card](https://example.org/report.html#tag=checkout/card) (1 ✅) | True |
| ✅ [checkout](https://example.org/report.html#tag=checkout) (2 ✅) | True |
| ✅ [checkout/refund](https://example.org/report.html#tag=checkout/refund) (1 ✅) | False |
| ✅ [s](https://example.org/report.html#view=stories&story=s) (1 ✅) | True |
| ✅ [Gone](https://example.org/report.html#scenario=t.py::test_gone) | True |
| ✅ [search](https://example.org/report.html#q=pay) | True |
citations update writes a narrated citation's body from the report
Given
a report whose scenario has two steps
a document holding a narrated citation of it, copied with an empty body
When
the document is updated
Then
its body holds the scenario's narration between blank lines
no finding remains
citations check reports a narrated citation whose body differs from the report
Given
a report whose scenario ends in "it is paid"
a document whose narrated citation of it still ends in "it is charged"
When
the document is checked
Then
one stale narration is the only citation finding
it names the first line that differs, written and expected
A narrated citation of a tag or story is a citation finding
update leaves
Given
a report whose scenario is tagged
checkout and covers the story checkouta document with a narrated citation of the {target}, its glyph and body stale
When
the document is updated
Then
a stray narration is the only citation finding, one
update cannot fixthe document is left as written
| target | document |
|---|---|
| tag | |
| story | |
A
<details> block citing the report in any other shape is a mistyped citation finding, never skipped
Given
a document whose
<details> block cites the report with {shape}When
the document is updated
Then
a mistyped citation finding, saying {reason}, is the only one
the document is left as written
| shape | document | reason |
|---|---|---|
| an anchor with a class | its <a> takes attributes besides href | |
| a single-quoted href | its href is not in double quotes | |
| no closing tag | no </details> closes it | |
| no blank line above it, below another one | a blank line must separate it from the HTML above it | |
A narrated citation copied from the report is current once
citations update fills its body
Given
a report whose scenario title holds a code span and an ampersand
the narrated citation the copy menu copies, pasted into a document
When
the document is updated
Then
its body holds the scenario's narration
When
the updated document is checked
Then
no finding remains
A failing narrated citation has its body rewritten and stays a citation finding
Given
a report whose scenario fails
a document holding a narrated citation of it, copied with an empty body
When
the document is updated
Then
its glyph reads ❌ and its body holds the narration
the failure is the only finding that remains
citations update adds markdown="1" to a narrated citation's opening tag, keeping its other attributes
Given
a current narrated citation whose opening tag is {opening}
When
the document is checked
Then
a stale opening tag is the only citation finding, naming its fix
When
the document is updated
Then
the opening tag reads {expected}
| opening | expected |
|---|---|
| <details open> | <details markdown="1" open> |
| <details open markdown="0"> | <details open markdown="1"> |
| <details markdown='block'> | <details markdown="1"> |
| <details markdown> | <details markdown="1"> |
| <details title="see markdown here"> | <details markdown="1" title="see markdown here"> |
A narrated citation in a list item or blockquote has its body written under that prefix
Given
a narrated citation copied with an empty body into a {container}
When
the document is updated
Then
each body line carries the container's prefix
a check of the updated document finds nothing
| container | document | updated document |
|---|---|---|
| list item | ||
| blockquote | ||
A citation of a term rolls up the scenarios that reference it
Given
a report with a passed and an xfailed scenario holding a term ref to the term
Guest, and a failed one holding nonea document with a citation of the term, its glyph typed
When
the document is updated
Then
it reads the canonical name, and the rollup of the two scenarios
no finding remains
A term no scenario references reads as having no scenarios
Given
a report whose glossary holds an unused term
a document with a citation of the term
When
the document is updated
Then
it reads
🟠 and (no scenarios)no finding remains
A term missing from the report is a citation finding, for a citation and a plain report link alike
Given
a report whose glossary lacks the term
Guesta document with a citation of the term and a plain report link to it
When
the document is updated
Then
each link is a
missing findingthe citation's glyph becomes
❓ and its summary goescitations update writes a defining citation's body from the term's definition
Given
a report with a defined term
a document holding a defining citation of it, copied with an empty body
When
the document is updated
Then
its body holds the definition between blank lines
no finding remains
An undefined term's defining citation has an empty body, and
citations update empties one that holds text
Given
a report whose term has no definition
a document with a defining citation of it whose body holds an old definition
When
the document is updated
Then
a stale definition is reported
its body is empty
the emptied block has no citation finding
A defining citation's body shows the definition as the report shows it
Given
a term whose definition has a code span, emphasis, a link, an HTML tag and a line break
When
a defining citation of it is updated
Then
the spans stay markup, and the link and the tags stay literal text
rendered, the body reads as the report renders the definition
the updated document is current
--covering keeps a citation of a term that counts the scenario
Given
a report with two terms, one used by the scenario
test_staya document citing both terms, and plainly linking the used one
When
the document is checked with
--covering that scenarioThen
the used term is listed, as a citation and as a plain link
A failed scenario holding a term ref fails the citation of its term
Given
a report where a failed scenario uses
Guesta document with a citation of the term, read as passed
When
the document is updated
Then
its glyph and summary read
❌a
failed citation finding remains, blaming a scenario using the term
A parametrized scenario takes the status of its worst case: failed, then xfailed, then passed, then skipped
Given
Cases of one parametrized scenario that ended {statuses}, each xfailed one for the reason "planned"
When
the grouping pass collapses them
Then
the scenario is {status}
its xfail reason is {reason}
| statuses | status | reason |
|---|---|---|
| passed, failed, skipped | failed | None |
| xfailed, failed | failed | None |
| passed, xfailed | xfailed | planned |
| skipped, xfailed | xfailed | planned |
| skipped, passed | passed | None |
| skipped, skipped | skipped | None |
A parametrized scenario carries a skip or xfail reason only when its cases all give it
Given
two {status} cases, one saying {first} and one saying {second}
When
the cases are grouped
Then
the parametrized scenario is {status}, with the reason {shared}
| case ID | status | first | second | shared |
|---|---|---|---|---|
| skipped-different | skipped | needs a database | needs a service | None |
| skipped-shared | skipped | needs a database | needs a database | needs a database |
| xfailed-different | xfailed | flaky | slow | None |
| xfailed-shared | xfailed | flaky | flaky | flaky |
A parametrized scenario keeps its place among the scenarios around it
Given
a plain scenario between two parametrized ones
When
the grouping pass runs and the report orders its result
Then
the report lists them in the order the file declares
Same-named parametrized scenarios on different test functions stay apart
Given
two test functions whose cases share one name
When
the grouping pass runs
Then
each function keeps its own scenario and parameter table
The grouped tree comes from the first passed case
Given
a skipped first case and a second one that ran
When
the cases are grouped
Then
the tree is the one the passed case recorded
A plain-str narration that varies across cases is refused
Given
two cases whose text differs but records no parts
When
the cases are grouped
Then
the grouping is refused
the error names the test, the missing parts and the t-string fix
it names the case whose values were baked in, and the per-case opt-out
A narrated value that varies becomes a derived parameter table column
Given
two cases narrating a value that differs
When
templatizing walks the cases
Then
the value becomes a derived column beside the parametrize one
the step keeps a placeholder pointing at that column
the placeholder keeps the format spec and conversion it narrated
A narrated value that is the same in every case stays inline as a value highlight
Given
two cases narrating the same value
When
templatizing walks the cases
Then
the parameter table gains no column for it
the step keeps the value inline, as a value highlight
A varying interpolation that is not a bare name is refused
Given
two cases narrating a computed expression
When
the cases are grouped
Then
the grouping is refused
the error quotes the expression and shows the bind-a-local fix
A varying expression in a then is refused with the fix of an expected-outcome column
Given
two cases whose then narrates an outcome derived from an input
When
the cases are grouped
Then
the grouping is refused
the error first suggests parametrizing the expected outcome
A parameter table cell reads the way the scenario title formats it
Given
a Template scenario title formatting its parameter
When
the cases are grouped
Then
the cells carry the formatting the title declared
A scenario title formatting a parameter unlike a step gets its own column
Given
a title formatting the parameter and a step reading it plainly
When
the cases are grouped
Then
the title points at a column holding what it renders
the title renders the disambiguated token, text and parts agreeing
A step formatting a parameter unlike the scenario title gets its own column
Given
a step formatting the parameter and a title reading it plainly
When
the cases are grouped
Then
the step points at a column holding what it renders
the step renders the disambiguated token, text and parts agreeing
A step whose narrated value differs from its parameter column is refused
Given
two cases narrating a value their column lacks
When
the cases are grouped
Then
the grouping is refused
the error names the column and what the case actually narrated
A term ref whose display differs between cases is refused
Given
two cases whose term ref reads differently
When
the cases are grouped
Then
the grouping is refused
the error names the term ref and the split-it-out fix
A term ref whose display varies is refused even when a parametrize value binds it
Given
two cases whose term ref is the parameter itself
When
the cases are grouped
Then
the grouping is refused
the error points at the per-case scenario opt-out
A parameter table orders its columns the way the narration first shows them
Given
two cases whose given attaches a varying log and whose later step narrates the parameter
When
templatizing walks the cases
Then
the given's attachment column comes first
each case row follows the same order
An attachment whose payload varies becomes an attachment column
Given
two cases attaching a label with differing payloads
When
templatizing walks the cases
Then
the payload moves into an attachment column
the step keeps a content-less badge pointing at it
A step whose set of attachment labels differs between cases is refused
Given
an attachment label only one case attaches
When
the cases are grouped
Then
the grouping is refused
the error names the label, the case, and asks for a constant one
A parameter table cell holds the text the step pointing at it narrated
Given
two cases narrating a parameter with a format spec
When
grouping builds the parameter table
Then
each cell carries the formatted text, under one column
the step keeps its placeholder, which that cell substitutes into
Cases that narrate different steps are refused rather than grouped
Given
two cases whose step trees differ
When
the cases are grouped
Then
the grouping is refused
the error names the divergence and the opt-out that answers it
A failed case must narrate the steps it shares with the passed ones the same way
Given
two cases whose step texts differ
When
the cases are grouped
Then
the grouping is refused
the error names the failed case and its difference from the baseline
A failed case that stops early or takes another path still groups
Given
a passed case that loads its items, then checks it is hot
a failed case that loads its items, then {retries instead of checking it is hot / stops}
When
the cases are grouped
Then
they make one scenario, with a row for each case
| case ID | retries | failed steps |
|---|---|---|
| stops-early | False | |
| parts-from-the-baseline | True | |
A step narrating a glossary term parameter keeps pointing at its parameter table column
Given
a step narrating a parameter bound to a glossary term instance
When
the cases are grouped
Then
the parameter table holds the term displays alone
the step still points at that column
Steps that word one Boolean with different boolean phrases share its parameter table column
Given
two steps wording
pinned with different phrasesWhen
templatizing walks the cases
Then
the table holds one column, with the Booleans
both steps point at that column
A varying local worded with boolean phrases becomes a derived column of Booleans
Given
two cases that word a local
flag as "on" and "off"When
templatizing walks the cases
Then
the local gets a derived column beside the parametrize one
that column holds the Boolean behind each phrase
the step shows both phrases
Steps that word one varying local with different boolean phrases share its derived column
Given
two steps wording a local
flag with different phrasesWhen
templatizing walks the cases
Then
the table holds one derived column, with the Booleans
each step still shows its own phrases
A per-case scenario title ends with its case ID as a value
Given
a parametrized scenario titled "Split" that declines the grouping, with the case ID abc
When
its case becomes a scenario of its own
Then
the title reads "Split [abc]"
the case ID is a value part, and its asterisks are not read as emphasis
Narration lint flags a step whose body does nothing
Given
a given step whose body is only
passWhen
the AST lint rules parse that source
Then
an empty-step lint finding points at the step line
its severity is error
Narration lint flags a then step that checks nothing
Given
a then step whose body only calls
When
the AST lint rules parse that source
Then
a then-without-check lint finding reports the unchecked then
Narration lint flags a then step that checks only on some runs
Given
a then step whose only assert sits under an
ifWhen
the AST lint rules parse that source
Then
a conditional-check lint finding reports the guarded then
its severity is warn
Narration lint flags an assert outside a then step
Given
a {phase} step whose body asserts
When
the AST lint rules parse that source
Then
the warn lint findings say {messages}
| phase | step body | messages |
|---|---|---|
| given | ["assert inside given 'a stocked machine'"] | |
| when | ["assert inside when 'a stocked machine'"] | |
| then | [] | |
Narration lint flags a then step that folds in the action
Given
a scenario with no when, acting inside its then
When
the AST lint rules parse that source
Then
a warn lint finding points at the then and says no when acts
Narration lint flags a narration interpolating a name the body never uses
Given
a given step whose body never loads the name
When
the AST lint rules parse that source
Then
a warn lint finding names the interpolation the body ignores
Narration lint flags a passed scenario that skips a phase
Given
a passed scenario narrating only given and then
When
the runtime lint rules run
Then
one missing-phase lint finding names the absent when and the scenario source
its severity is the catalog default, warn
Narration lint flags a tag that duplicates a term
Given
a glossary defining one term
two scenarios carrying that word as a tag
When
the runtime lint rules run
Then
a single warn lint finding names the tag and the term it shadows, counting the scenarios and naming one
Narration lint flags a term referenced by no scenario title, step or story
Given
a glossary holding one unreferenced term
When
the runtime lint rules run over no scenarios and no stories
Then
the lint finding names the unreferenced term
its severity is off — the rule is opt-in
Narration lint counts a term named only in the second clause of a sentence as referenced
Given
a story whose one sentence names the term only in its second clause
When
the runtime lint rules run over that story
Then
dead-term flags none of its terms
Narration lint flags a bold span in a term's definition that names no term
Given
a glossary whose Handle definition bolds a term and a word naming none
When
the runtime lint rules run
Then
one lint finding names the bold word, not the term
its severity is warn by default
The narration lint flags an avoided word in step text
Given
a glossary where Guest avoids Customer
a scenario whose step text says Customer
When
the runtime lint rules run
Then
the lint finding names the word and the step
its severity is warn by default
A sentence references its terms, whatever surface form they take
Given
a sentence written with an instance and an inflection
When
coverage collects the sentence references
Then
they are the term ids alone; words contribute nothing
A multi-clause sentence unions references across its clauses
Given
a sentence with two clauses
When
coverage collects the sentence references
Then
the terms of both clauses are present
A sentence whose clauses start at different actors builds and is covered
Given
a sentence of two clauses: a guest signs the register, and a clerk signs the register
a step naming both actors, the activity and the register
When
coverage is computed against the story
Then
the sentence is covered
A step references its terms, whatever surface form they take
Given
a step naming an instance and an inflection
When
coverage collects the step references
Then
they are the term ids alone
An instance and its bare term cover each other
Given
a sentence naming a bare actor
the same sentence naming an instance of that actor
a step naming the instance, and one naming the bare actor
When
coverage is computed for each pairing
Then
the instance step covers the bare sentence
the bare step covers the instance sentence
A sentence is covered by one step naming all its terms, never by several steps together
Given
a story whose sentence names guest, search and room
a scenario whose steps name {steps_naming}
When
coverage is computed against the story
Then
the sentence {is covered / is not covered}
| steps_naming | covered |
|---|---|
| [['guest', 'search', 'room']] | True |
| [['guest', 'search'], ['room']] | False |
| [['guest'], ['guest', 'search', 'room']] | True |
Promoting a bare word to an activity ref drops coverage from a step that matched
Given
a step naming two term refs
the same sentence with that middle slot a bare word, then an activity ref
When
coverage is computed against each story
Then
the two-ref sentence is covered
the widened sentence is no longer covered
A pin on a step or its scenario replaces narration matching
Given
a scenario with pins={scenario_pins}
a step matching sentence 1, with pins={step_pins}
When
coverage is computed against the story
Then
the scenario covers the sentences {covered}
| case ID | scenario_pins | step_pins | covered |
|---|---|---|---|
| nothing-pinned | None | None | [1] |
| step-pinned | None | [2] | [2] |
| scenario-pinned | [] | None | [] |
| both-pinned | [] | [2] | [2] |
| scenario-pins-elsewhere | [2] | None | [2] |
| scenario-and-step-pinned | [1] | [2] | [1, 2] |
A sentence is coverage-eligible only with two distinct terms
Given
a sentence referencing the terms {term_ids}
When
its coverage eligibility is checked
Then
it {is eligible / is not eligible}
| term_ids | eligible |
|---|---|
| ['guest', 'room'] | True |
| ['guest', 'guest'] | False |
| ['guest'] | False |
| [] | False |
A nested step covers a sentence like a top-level one
Given
a story with one canonical sentence
the covering term refs in a nested child step
When
coverage is computed against the story
Then
the nested step still counts and the sentence is covered
The glossary view aggregates instances and activity forms
Given
a report whose story and scenario reference instances of an actor and a work object, and an inflection
When
the glossary aggregations are built
Then
the actor and the work object collect their instances
the activity collects its inflection but not its canonical form
Terms referenced by a sentence record the story
Given
a story whose sentence references an actor and an activity
When
the glossary aggregations are built
Then
the actor and the activity each list that story
A story referencing a term twice lists it once
Given
a story whose two sentences repeat the same term and the same inflection
When
the glossary aggregations are built
Then
the story and the inflection appear once each
A canonical reference to an actor or work object is not an instance, whatever its case
Given
a story sentence referencing an actor and a work object by canonical name, and a step referencing one in lowercase
When
the glossary aggregations are built
Then
neither the actor nor the work object records an instance
An S-form reference is the term itself, not an instance or an inflection
Given
a story sentence referencing a work object and an activity by their s-forms, each lowercase and capitalized
When
the glossary aggregations are built
Then
the work object records no instance and the activity no inflection
A kindless term records only its story ref
Given
a kindless term referenced by a story sentence
When
the glossary aggregations are built
Then
the term lists the story but no instance and no inflection
An instance seen in a fixture step records its fixture provenance
Given
a scenario whose fixture-sourced step names an instance
When
the glossary aggregations are built
Then
the instance carries the fixture name
The term index maps each term to its scenarios once
Given
a scenario referencing one term in two steps and another in its name
When
the term-scenario index is built
Then
each term maps to the scenario exactly once
The Glossary tab renders each definition ref as a term ref to the term it names
Given
a glossary whose Step definition bolds Phase, attachments, Steps itself and a word naming no term
When
the Glossary tab renders the Step definition
Then
Phase and attachments are term refs, in the words its author wrote, and neither Steps nor the other bold word links anywhere
Parameter coloring ties each placeholder to its column header
Given
a report holding a parametrized scenario with a parameter table of the columns euros and expect
When
the renderer renders the HTML page
Then
the grouped step shows its placeholder, keyed to the euros column
each column header carries its own column key
A report without scenarios leaves out the Scenarios tab and opens on its glossary
Given
a report with terms and no scenarios
When
it is rendered as HTML
Then
the glossary is its only view
The renderer treats a parameter table column narrated with !r or !a as a repr column
Given
a step whose placeholder has the conversion {conversion}
When
the renderer picks the repr columns
Then
the column {is one of them / is not one of them}
| conversion | repr_column |
|---|---|
| 'r' | True |
| 'a' | True |
| 's' | False |
| None | False |
A passed scenario renders as a checked heading with step bullets
Given
a report holding a passed scenario with three steps
When
the Markdown report is rendered
Then
the heading is checked and each step is a phase bullet
A line break in a scenario title or step reads as a space in the Markdown report
Given
a scenario whose title, and a value in its step, break across lines
When
the Markdown report is rendered
Then
the heading reads on one line
so does the step bullet
Structured narration renders terms, values and placeholders
Given
a step whose narration carries a term ref, a value and a placeholder
When
the Markdown report is rendered
Then
the term ref renders in guillemets, the value verbatim and the placeholder in braces
A parametrized scenario renders its parameter table
Given
a parametrized scenario with a two-case parameter table
When
the Markdown report is rendered
Then
the heading counts the cases and the parameter table lists each row
The parameter table shows a status column only when its cases differ in status
Given
a parameter table whose first case is {first_status} and whose second is {second_status}
When
the Markdown report is rendered
Then
the table header reads {header}
| first_status | second_status | header | Rendered Markdown |
|---|---|---|---|
| passed | passed | | coin | | |
| skipped | skipped | | coin | | |
| failed | failed | | coin | | |
| passed | skipped | | coin | | | |
| passed | failed | | coin | | | |
A failed scenario ends with a minimal error digest
Given
a failed scenario carrying a two-line error and an internal frame
When
the Markdown report is rendered
Then
the heading is crossed and the error follows the steps
only the first message line and the non-internal frame are quoted
A multi-line attachment renders as a fenced block
Given
a step carrying a multi-line attachment
When
the Markdown report is rendered
Then
the attachment content sits in an indented fence, not inline
A skipped scenario shows its skip reason
Given
a skipped scenario with a reason
When
the Markdown report is rendered
Then
the heading is marked skipped and the reason follows the node ID
Failure notes below a parameter table that would share a key add their row number
Given
three failed cases: one with the custom ID 11, one with no ID whose value is 11, and one with the ID 3
When
the Markdown report is rendered
Then
the two notes keyed 11 each add their row number
the note with a key of its own keeps it bare
The Markdown report nests steps by four spaces
Given
a step with a child whose attachment is multi-line
When
the Markdown report is rendered
Then
each level, its attachment and the attachment fence indent four more
A narrated citation's body is the scenario's Markdown narration without heading, anchor line or errors
Given
a failed grouped scenario with a tag, a skip reason and a failed case
When
its narration body is taken
Then
it holds the steps and the parameter table only
the full Markdown report contains it verbatim
The JSON report carries each sentence's coverage
Given
a story with a covered, an uncovered, an untracked sentence
When
the JSON report is rendered
Then
a top-level
coverage lists every sentence oncethe rest of the report is the input dict, unchanged
A source link config value resolves to its template
Given
the source link config set to {value}
When
the config value is resolved
Then
the template is {template}
| value | template |
|---|---|
| vscode | vscode://file/{path}:{line} |
| cursor | cursor://file/{path}:{line} |
| zed | zed://file/{path}:{line} |
| pycharm | pycharm://open?file={path}&line={line} |
| https://github.com/o/r/blob/{sha}/{relpath}#L{line} | https://github.com/o/r/blob/{sha}/{relpath}#L{line} |
| none | None |
An unknown preset name is refused, with the valid ones listed
Given
a bareword that is neither a known preset nor a template
When
the config value is resolved
Then
the value is refused
the error names the offender and lists every valid preset
The github preset prefers
GITHUB_REPOSITORY over the git remote
Given
GITHUB_REPOSITORY naming one repository
an origin remote naming a different one
When
the github preset is resolved
Then
the template points at the environment's repository
The github preset derives org and repo from the git origin remote
Given
no GITHUB_REPOSITORY, and an https origin remote
When
the github preset is resolved
Then
the blob-URL template names the remote's org and repo
The github preset refuses a remote that is not on GitHub
Given
no GITHUB_REPOSITORY, and an origin remote on another host
When
the github preset is resolved
Then
the preset is refused
the error points at the env var and the raw-template escape hatch
An under-anchored sentence reads as untracked until a pin covers it
Given
a story whose only sentence names a single term
a scenario whose step narrates that term, and {carries a / carries no} pin for the sentence
When
the story rollups are built
Then
it {reads as untracked / stays tracked}
| pinned | untracked |
|---|---|
| False | True |
| True | False |
A scenario bound to two stories is listed under each
Given
two stories each with a guest-search-room sentence
a scenario bound to both whose step names those terms
When
the story rollups are built
Then
the scenario is listed under, and covers, both stories
A sentence is labeled by the prose of its clauses
Given
a story with a two-clause sentence
When
the sentence labels are built
Then
the label gives the number, then reads as prose under a story-scoped key, with the clause texts joined
A scenario title's emphasis renders the same in every output
Given
a scenario title with a bold word and a code span
When
the HTML, the Markdown report and a citation show it
Then
the HTML renders the word bold and the code as code
the Markdown keeps the same markers, so a viewer renders the same
A span crossed by a term ref stays literal in every output
Given
a scenario title whose
** markers enclose a term refWhen
the HTML, the Markdown report and a citation show it
Then
the HTML shows both markers as written
the Markdown escapes them, so a viewer shows them as written
Adopt pytest-given
Domain ExperttellsStoryto theDeveloper
tell
no coverage
DevelopercapturesStoryasSentence
capture
DeveloperbuildsGlossarywith theDomain Expert
build
AgentwritesScenariowithTagagainst theGlossary
write
AgentnarratesStepwith aPhase
narrate
AgentattachesAttachmentto aStep
attach
CollectorrecordsStepon theStep stack
record
CollectorgraftsFixture recordingfrom aStep fixture
graft
CollectorgroupsParametrized scenariointo aParameter table
group
RenderermatchesScenarioto aSentence
match
RendererrendersReportwithParameter coloring
render
Narration lintflagsScenarioagainst aLint rule
flag
Domain ExpertreviewsScenarioin theReport
review
no coverage
Scenarios
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Covers:
Glossary
Core test model
Scenario
A test that narrates the rule it demonstrates, marked with
@scenario. Tests without the mark stay out of the report.
Scenario title
The statement of the rule a Scenario demonstrates. Not the test function's name, which the Node ID carries.
Step
A unit of narration in one Phase. Steps nest and may carry Attachments, but have no status or error of their own: a failure belongs to the Scenario, and to its Case in a Parameter table.
Narration
The human-readable text on a step or scenario title, which may mix plain text with values, placeholders and term refs.
Phase
The category of a step:
given, when, or then. A step has exactly one phase.
when_then
One block that narrates a
when action and its then outcome as two sibling steps. Used mainly to narrate an expected raise, so the action and its outcome stay distinct steps.
Tag
A free-form label on a scenario. A
/ nests it: ticket/ABC-123 sits under ticket.
Attachment
A labeled piece of text or JSON bound to the step being narrated.
Parametrization
Parametrized scenario
A Scenario whose test is parametrized, so it runs once per Case. pytest-given groups the results.
Case
One row of a parametrized scenario: its node ID, its parameter values, its status and any error.
Case ID
A Case's pytest ID: its Node ID's parametrize tail without the brackets (
touching-edges), as the terminal prints it. Custom when it is more than its values' generated parts, as from pytest.param(..., id=...) or ids=.
Parameter table
The per-scenario table of cases and columns. A column is a
param (a parametrize input), a derived (a narrated value that varies across cases) or an attachment (an attachment whose payload varies).
Boolean phrase
Either of the two texts that word a Boolean in a step. Written as a phrase spec, a format spec holding the true phrase, a
| and the false phrase: {pinned:pins it|does not pin it}. The step shows both phrases, and the Parameter table keeps the Boolean.
Group
Collapsing the cases of a parametrized scenario into one logical scenario carrying a Parameter table. Cases group when they share both the same name and the same Node ID without its parametrize tail — one test function; two same-named scenarios on different test functions stay separate.
@scenario(group_parametrized=False) declines the merge, so each case lives on as its own scenario.
Templatize
Derive the grouped-template step text by comparing every comparable case: what all of them share stays inline, and anything that varies points at a parameter-table column. The baseline comes from the first passed case, and every other passed case must narrate that same template — a failed case too, over the steps it shares with the baseline.
Fixtures and recording
Step fixture
A pytest fixture that narrates its setup as a
given Step. A fixture cannot narrate when or then.
Plain fixture
A pytest fixture without a pytest-given decorator. It produces no step in the report unless a Given annotation on the test's parameter narrates it.
Given annotation
A
given(...) in a test parameter's Annotated[...] type: def test(room: Annotated[int, given('a room')]). On a parametrize value or a Plain fixture it adds a childless given step; on a Step fixture it replaces the fixture's root label and its pins. Only given is allowed, and a Template in it may only hold a bare parametrize column.
Fixture recording
The steps and attachments a step fixture narrates during setup. A generator fixture's teardown records nothing — it refuses steps and attachments.
Graft
Attaching a fixture recording into the active scenario's step tree at the moment its host test starts.
Collector state
Collector
What gathers a session's scenarios, fixture recordings and parameter info.
Active scenario
The scenario currently being recorded into.
Node ID
A pytest test identifier (e.g.,
tests/test_x.py::test_y[a-b]).
Step stack
The chain of currently-open steps. Opening a step adds it, and leaving its block removes it.
Report
Report
The output artifact: a JSON data file and optional self-contained HTML and Markdown renderings derived from it. The JSON is the source of truth.
Renderer
Converts a JSON report into a rendering — a self-contained HTML page or a Markdown document.
Parameter coloring
Each parametrize column gets a stable highlight color; placeholders and matching values share that color wherever they appear in step text and the parameter table.
Value highlight
A neutral highlight applied to t-string interpolation values that don't correspond to a parametrize column and are constant across every case (e.g., a computed expression like
price * 1.2). One that varies becomes a derived column instead.
Source link
A link to a file and line: a scenario's test function, or the declaration of a Story or Term.
Report link
A Markdown link to a scenario, tag, story or term in the HTML Report. Without a glyph it is a plain one, which claims only that its target exists.
Citation
A Report link led by its target's status glyph, citing a scenario, tag, story or term from a Markdown document:
✅ [title](<report URL>#scenario=…). A tag, story or term citation adds a summary after it, (5 ✅ · 2 🔵). A target the Report lacks reads ❓.
Narrated citation
A Citation of a scenario written as a collapsible block, the citation as its summary and the scenario's Markdown narration as its body.
Defining citation
A Citation of a term written as a collapsible block, the citation as its summary and the term's definition as its body.
Citation finding
One problem
pytest-given citations check reports on one Report link: its kind (stale, missing, failed, mistyped, …), the document location and a message.
Theme
The HTML report's colour scheme —
light, dark, or auto (follow the viewer's system).
Narration lint
Narration lint
The
--given-lint pass that checks recorded scenarios against the Lint rule catalog. It enforces the structural subset of the narration conventions — it cannot check whether a Step's text is semantically true.
Lint rule
One named check, carrying a surface and a default Severity. A
runtime rule reads the recorded scenarios; an ast rule parses the step bodies' source.
Lint finding
One Lint rule firing on one subject: the rule id, the Severity it fired at, the subject, a Source link location and a message naming the offender.
Severity
A Lint rule's level —
off, warn or error. Only error fails the run, warn reports in the terminal summary, and an off rule is not evaluated at all.
Domain Storytelling
Glossary
The shared vocabulary a domain speaks in: its Ubiquitous Language.
Markdown glossary
A glossary loaded from a Markdown file: a
TableGlossary from GFM pipe tables, or a ParagraphGlossary from term paragraphs.
Term paragraph
A term in a
ParagraphGlossary, written as one paragraph: **Term**:, its definition, and an optional _Avoid_: line, the format of Matt Pocock's skills.
Glossary section
A named group of terms: the heading a Markdown glossary term sits under, or the
g.section(...) a code glossary declares it through. The Glossary tab groups and filters by it.
Avoided word
A rejected synonym a term lists, which the
avoided-word lint rule flags in narration. An avoid entry may add a parenthesized note, which the report shows and the lint ignores.
Deferred term
A term handed over before its kind is settled: what
g('foo') and g['foo'] on a code glossary return, and a Markdown glossary lookup of a row with no declared kind. Kind inference settles it later.
Term
A glossary entry: an Actor, Work Object, Activity, or kindless term. Each carries an id (slug), a canonical name, a kind unless kindless, an optional definition, an optional glossary section and any avoided words.
Handle
What a glossary hands back for a term, the same from every accessor (
g.actor(...), g('foo'), g['Guest'], a captured guest = ...). It is what steps, scenario titles and sentences interpolate, in one of four surface forms: bare (room — the canonical display), .l (room.l — capitalized words lowercased, acronyms kept), .s (room.s — the S-form), or called (room('Deluxe Suite') — an instance on an Actor or Work Object, an inflection on an Activity). .l and .s also apply to a called form and chain (room.l.s reads rooms). Each form renders as a term ref. A story hands out a sentence handle the same way: book_a_room['cancel'] by name or book_a_room[3] by number, which pins= takes.
S-form
A term's name with the regular English -s ending, from the
.s handle form: the plural of an Actor or Work Object (rooms), the third person singular of an Activity (books). It adds -s to the last word, -es after s, x, z, ch or sh, and turns a consonant + y into -ies, but an acronym takes a plain -s (APIs); anything else, such as people or checks in, needs the called form. An S-form reference, in any case, is a reference to the term itself — not an instance or an inflection.
Actor
A glossary term for a participant in the domain (e.g., Guest).
Work Object
A glossary term for a thing acted on (e.g., Room, Booking).
Activity
A glossary term for what an actor does (e.g., book, confirm), which Domain Storytelling draws as an arrow labelled with a verb. Activities accept inflections: calling
search('searches for') records searches for as a surface form of the canonical search.
Term ref
An occurrence of a term inside narration, a clause or a definition.
Definition ref
A bold span in a glossary definition that names a term of the same glossary, by its canonical name or S-form in any case. The report renders it as a term ref.
Instance
A named refinement of an Actor or Work Object (e.g.,
guest('Alice') is an instance of the Guest actor).
Inflection
A surface form of an Activity term other than its canonical name or S-form (e.g., searches for as an inflection of search).
Story
A named flow modeled as a sequence of sentences. Stories are the unit of coverage.
Sentence
What Domain Storytelling calls a sentence: an actor, an activity and its work objects, plus connective words. One row in a story, numbered by its position and optionally named, a name that stays put when rows are inserted. Usually one clause; several when the sentence has several arrows under one number.
Clause part
A piece of a clause's prose: a term ref, or a bare clause word. A bare clause word — a node label or edge connective — carries no kind or id, is never classified by inference, and never reaches the glossary. That last is what separates it from a kindless term, which has an id and is tracked.
Clause
One linear walk through a sentence's arrows, a node/edge alternation starting actor → verb → noun. A sentence with several arrow chains under one number, such as an actor handing a work object to two recipients, takes one clause per chain. Domain Storytelling names no such unit.
Slot
A position role in a clause, from its node/edge alternation: position 0 is the actor slot, odd positions are verb slots, and even positions ≥ 2 are noun slots.
Scenario↔sentence binding
The link between a scenario (or step) and story sentences.
@scenario(stories=...) names the stories a scenario is narration-matched against; a pin (pins= on @scenario or on given/when/then) binds sentences explicitly, in any story, whether stories= names it or not.
Pin
What a sentence's Handle passed to
pins= is recorded as, the way a term handle in narration is recorded as a term ref: a reference to a story and a sentence number. A pin binds explicitly and replaces narration matching — a step pin for that step, a scenario pin (@scenario(pins=...)) for every step of the scenario, which then covers its own pins plus its steps'. pins=[] pins nothing but still opts out of narration matching. A pin reaches under-anchored sentences too.
Coverage
The "did this scenario touch that sentence" relation. A sentence is covered when the set of terms it references is a subset of the terms a single step references — matching is per step, not against the union across steps, and on terms, not surface forms: an instance or inflection counts as its term. A pin covers its sentences directly instead, regardless of narration or term count.
Kind inference
The pass that assigns each undeclared term a kind from the slot positions it occupies across all story sentences; declared kinds are verified against observed positions instead. A term used in incompatible slots (or conflicting with its declared kind) raises. A term never referenced by any sentence stays kindless.
Kindless
A term with no kind, because kind inference finds no story slot to infer from (a term used only in t-string steps, never in a sentence).
Undefined
A term with no definition. Orthogonal to kindless.
Collaboration
Developer
Person who writes the application code and — together with the Agent — the scenarios; curates the glossary with the Domain Expert.
Domain Expert
Person who owns the domain knowledge and the ubiquitous language; source of domain stories and reviewer of scenarios and reports. A stakeholder in the broad sense.
Agent
AI coding agent that authors and maintains scenarios alongside the Developer, guided by the pytest-given skills.
Actors
Work Objects
Activities
Uncategorized
No terms match this filter.