api library

StoryD presents a State Machine to represent user stories in multiple software development paradigms, and helps to apply Behaviour-Driven Development as an extension to Test-Driven Development.

Several Story styles are available:

role-feature-benefit         : AsA  IWant  SoThat
benefit-role-action          : InOrderTo  AsA  ICan
persona-action-benefit       : AsA  IWant  InOrderTo
situation-motivation-outcome : When  IWant  SoThat
feature-benefit-role         : IWant  SoThat  AsA

The fluent DSL can be customised and extended as needed. However, the following pathways are most commonly used and should suit most developer's needs.

Story -> AsA Story -> SoThat Story -> InOrderTo Story -> When Story -> IWant Story -> WithScenario

AsA -> IWant AsA -> ICan AsA -> WithScenario

SoThat -> AsA SoThat -> WithScenario

InOrderTo -> AsA InOrderTo -> WithScenario

When -> IWant

IWant -> SoThat IWant -> InOrderTo IWant -> Because

ICan -> WithScenario

Because -> WithScenario

WithScenario -> Given WithScenario -> When WithScenario -> Then

Given -> And Given -> When Given -> Then

When -> And When -> Then

Then -> And Then -> WithScenario

And -> And And -> Given And -> When And -> Then

Classes

StepInput
Holds the configuration, executable callback, parameters, and expected assertion outcomes for a single BDD scenario step.
Story
This class is the heart of the StoryD fluent API. It is both the entry point for creating BDD-style stories and test scenarios, and the execution point for running tests and generating test reports. It also behaves as a wrapper for a Dart test's Group() method, ensuring all of the story's test scenarios are kept together during test execution.
StoryContext
A proxy class that allows Story and StoryBuilder objects to be passed along the fluent DSL without the need to write overly complex traversal code.

Extensions

FunctionStepExt on Function
Convenience extensions on functional primitives to initialize fluently chained steps.
StringStepExt on String
Convenience extensions on string literals to initialize fluently chained steps.

Functions

getCallbackName(StepInput stepInput) String
Extracts or derives a human-readable display name for a scenario step callback.
story(String text) Story
A convenience lambda function that wraps the Story class constructor and call method to provide a more concise and readable entry point for creating BDD-style stories and test scenarios using the StoryD fluent API.