Behavior-Driven Development (BDD)/Gherkin Cases

AIO Tests allows you to use BDD/Gherkin as a means to define the test cases. By creating BDD/Gherkin cases on AIO Tests, you can not only make the test cases easy to review for managers and other non-programmers, but can also improve collaboration between key stakeholders on the project.

In this documentation, you’ll understand:

Steps to Create a BDD Case

Step 1: To create a BDD Case, simply click on the BDD/Gherkin tab.  

The action to create a BDD/Gherkin case is available at the time of case creation (Steps page) and also while editing a case (Steps tab). The image below is of the Steps tab opened in Edit mode.

Step 2: Click on the Add a Step button. 

Step 3: Create a scenario by selecting the keyword from the drop-down list, entering the description (action), and expected results.

  • Users have the option to choose the keywords- Given, When, Then, And, But, and *. 

    • Given- It is used to set up the context where the scenario happens (Establish context).

    • When- It is used to interact with the system (Perform Action).

    • Then- It is used to check the outcome of the interaction (What we expect).

    • And, But and *- It is used to add more steps to the scenario’s Given, When, or Then section.

  • Already added BDD steps start appearing in the description drop-down as text is being entered helping users choose previously written descriptions and reduce case writing time.

  • Users can add a new step by clicking on the plus icon (+), hitting the TAB key or pressing enter after entering the step description/data.

  • Users can delete a particular step by clicking on the Delete button. The step isn’t deleted permanently but is marked for deletion. The actual deletion takes place with the click of Save/Save & Close.

  • Users can also reorder the steps by using the reorder handle on the left.

Step 4: Finally, click on the Save button.

Steps to Create a Scenario Outline with Examples

Step 1: To create a scenario outline, all you need to do is click on the Edit button. 

The action to create a scenario outline is available at the time of case creation (Steps page) and also while editing a case (Steps tab). The image below is of the Steps tab opened in Edit mode.

Step 2: Click on the Examples button.

Step 3: Click on the plus sign (+) to add the parameter names. Enter the parameter name into the New parameter name field and click on the Add button.

Step 4: Enter the values of the parameters. 

Step 5: Finally, click on the Save button.

Steps to Change a Classic Case to BDD

Step 1: To change a classic case to BDD, you need to click on the Edit button on the Steps page. 

Step 2: Click on the Delete all steps button. 

Step 3: Click on the Save button. 

Step 4: Click on the BDD/Gherkin tab to add steps. 

Steps to Copy Steps from Other Cases

Step 1: To copy steps from other cases, all you need to do is click on the Vertical ellipsis button for the step after which you want to add steps from other cases. 

Step 2: Click on the Copy Steps from Other Cases button.

Step 3: Once you click on the Copy Steps from Other Cases button, a modal window will appear on the screen where you can select a case to copy its steps. Click on the Select a case to copy its steps field and select a test case from the drop-down list from which you want to copy steps.  

Step 4: Once you select the case, it will be displayed on the screen along with its steps from where you can select the step(s) to copy to a case by simply clicking on the checkbox. 

Step 5: Click on the Copy button located at the top right corner of the screen to copy the selected steps to the target case.

Once you click on the Copy button, the steps that you selected will be displayed on the Steps tab.

How to Duplicate Steps

Step 1: To duplicate steps, click on the Vertical ellipsis button for the step that you want to duplicate. 

Step 2: Click on the Duplicate Step button.

Once you click on the Duplicate Step button, the step will be automatically duplicated.

Importing Existing Automated Cucumber Cases

Cases can be directly created in AIO Tests if you have existing cucumber automation via the Import Results option in the Cycles tab or via AIO Tests public REST APIs.

Click here for more information regarding Cucumber integration.

 

For further queries and suggestions, feel free to reach out to our customer support via help@aiotests.com