We're here to help

Behavior-driven development

Provar supports a Behavior-Driven Development (BDD) approach to creating test cases for automation. Provar has a number of BDD test steps as well as a BDD reporting feature.

BDD is useful for ensuring that your automation focuses on business needs while meeting all user requirements. It can also help business stakeholders to understand automated tests at a high level without going into technical detail.

Using these test steps, you can group together test steps based on their behavior to define pre-conditions, actions and checks respectively.

 

BDD Test Steps


Provar provides BDD test steps for Given, When, Then, And and But.

The purpose of Given in BDD is to put your system in a ready state before an interaction or action.

In Provar, the Given test step is used to group the test steps in your test case which define a set of pre-conditions or data setup. For example, “User is on the Contact New Screen”:

 

When 


The purpose of When in BDD is to describe the key actions that a user performs after the preconditions are met.

In Provar, the When test step is used to group the test steps in your test case which perform the actions. For example, “User completes the form and clicks Save”:

 

Then 


The purpose of Then in BDD is to observe the outcomes of the interaction performed by the user.

In Provar the Then test step is used to group the test steps in your test case which carry the result assertions. For example, “Assert that a contact is created and the user is redirected to the contact view screen”.

 

And 


The purpose of And in BDD is to combine two or more same type of action. And can be used with Given, When and Then.

 

But


The purpose of But in BDD is to create a condition statement. But can be used with Given, When and Then.

 

BDD reporting


As of Provar Version 1.8.11, you can use Provar’s BDD Reporting feature to report on BDD test steps only.

 

To use this feature, open the Export Test Run dialog then select the Only BDD checkbox:

Click Finish.

The test report will be generated with only the BDD Test Steps showing:

 

Variable values in BDD reports


When a BDD test step is created with a variable, e.g. {NOW}, this variable will be resolved during the execution so that the actual value is shown in the Test Runner and in reporting.

In Test Runner:

In reporting:

 

Only BDD Reporting now includes sub-step screenshots


From Provar Version 1.9, if you generate a report using the Only BDD option, Provar will include in the report any screenshots captured by test steps that are sub-steps of a BDD step, even if the test step themselves are not visible in the report.

For example, this test step includes screenshots and is a sub-step under a Given test step:

When an Only BDD report is generated, the test step itself is hidden but its screenshots are displayed against the Given test step:

This means that the screenshots of many sub-steps may be included against the same BDD test step, as shown above.