Pending Steps

JBehave is designed to allow textual stories to be written before the implementation, i.e. to let the specification of the behaviour drive the development. For this reason, with steps that do not match any method in the Steps class, which are called pending steps, it does not fail by default. By marking a step as pending, it's simply telling the scenario writer that it's not yet implemented and correspondingly it will not execute any steps that following in the same scenario.

In some cases, thought, it may be useful to make the scenarios fail when steps are pending. The behaviour is controlled by configuring the PendingErrorStrategy via the StoryConfiguration

   StoryConfiguration storyConfiguration = new MostUsefulStoryConfiguration();
   storyConfiguration.usePendingErrorStrategy(PendingErrorStrategy.FAILING);

Dry Run Mode

It may be sometimes useful to run in dry-run mode, checking if any steps are pending but without actually executed any of the steps, as this may take a considerable time. The dry-run mode may be enabled via the StepsConfiguration:

StepsConfiguration stepsConfiguration = new StepsConfiguration()
	.useMonitor(new PrintStreamStepMonitor()) // default is SilentStepMonitor()
	.doDryRun(true); // default is "false"
new StepsFactory(stepsConfiguration, new MySteps());

We've here configured the steps to use a verbose monitoring, so that the use can see that in dry-run mode the step that is about to be performed will be followed by a "(DRY RUN)" additional tag. When dry-run mode is activated, it will also be shown in the reporters' output.