Stepdocs

The matching of textual steps to Java methods, each representing a candidate step, is a key concept in creating a Domain-Specific Language (DSL). Once the DSL has been defined, we need a way to display the "grammar" of the DSL to enable to scenario writer to exercise that grammar in writing the scenarios.

To this end, JBehave provides the concept of Stepdoc, which represents the documentation on a single candidate step as annotated method in the CandidateSteps instance. This documentation includes:

To generate the stepdocs for a given list of CandidateSteps instances:

Alternatively, given a RunnableScenario instance:

The RunnableScenario. will use the configured StepdocReporter to report the stepdocs found in the CandidateSteps defined for the scenario.

Stepdocs via Ant task

Remember to include jbehave-ant to your runtime classpath.

Stepdocs via Maven Plugin