Skip to content

paveljandejsek/jbehave-junit-support

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JUnit support for JBehave

Maven Central Build Status Coverage Status codebeat badge Codacy Badge

Support library which should help with running jbehave BDD tests.

Integration to java project

Setup in the maven project:

<dependency>
    <groupId>org.jbehavesupport</groupId>
    <artifactId>jbehave-junit-support</artifactId>
</dependency>

JUnit 5

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();
    }

    ...
}

JUnit 4

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 Step level is default reporting level. For story level you should use:

-Djbehave.report.level=STORY

In the IDE reporting is shown: Story level

Compatibility matrix

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 50.1%
  • Groovy 48.5%
  • Gherkin 1.4%