In this post, we will discuss an overview of JBehave framework with key steps involved. It is a framework for Behavior-Driven Development ( in short BDD)
Step-to-Step overview of JBehave:
First things first, BDD is an evolution of test-driven development (TDD) and acceptance-test driven design. It shifts the vocabulary from being test-based to behavior-based. For more details official JBehave website is : http://jbehave.org
Write Stories in Plain Text, Using bdd we can start defining the stories via scenarios that express the desired behavior in a plain text format.
Map steps to Java POJO: JBehave maps textual steps to java methods via Candidate steps. The scenario writer need only to provide annotated methods that match, by regex patterns, the textual steps.
Configure Stories: JBehave runs the stories with the Embedder, which provides an entry point to all of JBehave’s functionality that is embeddable into launchers( Eclipse, IntelliJ IDEA etc ) . The inject-able Embedder with an Embeddable which represents a runnable facade to Embedder, runs the stories.
JBehave main design feature is to be embedded in different development environments (IDE’s ) such as Eclipse, IntelliJ, JUnit, Maven etc. The JBehave core module contains support for running stories as JUnit tests.
View Run Reports
After all the stories have run, we can view the reports under the project folder. The default path is : target\jbehave\view folder.
The main distributions of Jbehave are:
1. JBehave Core
2. JBehave Web
JBehave Web is an extension of Core distribution, providing support for web functionality.