Story Syntax

JBehave supports multiple story syntaxes.

JBehave Syntax

JBehave's syntax is supported by the RegexStoryParser:

A story is a collection of scenarios

Narrative:
In order to communicate effectively to the business some functionality
As a development team
I want to use Behaviour-Driven Development
    
Scenario:  A scenario is a collection of executable steps of different type

Given step represents a precondition to an event
When step represents the occurrence of the event
Then step represents the outcome of the event

Scenario:  Another scenario exploring different combination of events

Given a [precondition]
When a negative event occurs
Then a the outcome should [be-captured]    

Examples: 
|precondition|be-captured|
|abc|be captured    |
|xyz|not be captured|

Gherkin Syntax

Gherkin syntax is supported by the GherkinStoryParser:

Feature: A story is a collection of scenarios

Narrative:
In order to communicate effectively to the business some functionality
As a development team
I want to use Behaviour-Driven Development
    
Scenario:  A scenario is a collection of executable steps of different type

Given step represents a precondition to an event
When step represents the occurrence of the event
Then step represents the outcome of the event

Scenario Outline:  Another scenario exploring different combination of events

Given a [precondition]
When a negative event occurs
Then a the outcome should [be-captured]    

Examples: 
|precondition|be-captured|
|abc|be captured    |
|xyz|not be captured|

The Gherkin syntax is supported via story transformers, that use the Gherkin parser to transform the syntax to JBehave's. Some elements, e.g. Background don't have a direct correspondence.