Support library which should help with running jbehave BDD tests.
Setup in the maven project:
<dependency>
<groupId>org.jbehavesupport</groupId>
<artifactId>jbehave-junit-support</artifactId>
</dependency>
Very simple java class used by the JUnit 5 compatible test engine:
public class BasicStory extends JUnit5Story {
public BasicStory() {
EmbedderConfiguration.recommendedConfiguration(configuredEmbedder());
}
@Override
public Configuration configuration() {
return new MostUsefulConfiguration();
}
...
}
To use JUnit4 runner please add a dependency for junit
or junit-vintage-engine
to your project explicitly.
Very simple java class with runner implementation:
@RunWith(JUnitRunner.class)
public class BasicStory extends JUnitStory {
public BasicStory() {
JUnitRunnerConfiguration.recommendedConfiguration(configuredEmbedder());
}
@Override
public Configuration configuration() {
return new MostUsefulConfiguration();
}
...
}
Stories can be run in two modes:
- step
- story
Reporting level can be chosen by jvm environment variable for step level:
-Djbehave.report.level=STEP
In the IDE reporting is shown: Step level is default reporting level. For story level you should use:
-Djbehave.report.level=STORY
In the IDE reporting is shown:
jbehave-junit-support | jbehave |
---|---|
1.0.1 | 4.0.5 |
1.2.7 | 4.1.3 |
4.3.5 | 4.3.5 |
4.6.1 | 4.6.1 |
4.8.0 | 4.8 |
4.8.3 | 4.8.3 |
5.0.0 | 5.0 |