Create BDD specifications
This topic describes how to create BDD specifications in the Backlog module. You then create and run scenarios as described in Create and run BDD scenarios.
Create a BDD spec
Use the Backlog module to add BDD specifications.
To create a BDD specification:
-
In the Backlog module, open the BDD Specification tab, and click the Add BDD Specification button .
Tip: You can also do this from within a feature, which is convenient if you need to add a specification for a certain feature.
-
Enter the required values.
-
Click the Customize fields button to show more fields in the Add BDD Specification dialog box.
-
Click Add & Edit.
-
In the Script tab, create or edit the scenarios. For details, see Add test scenarios.
-
Click Add Scenario or Add Scenario Outline and edit the scenario scripts. For details on the syntax, see Gherkin test syntax.
-
Click Save Version to save the current version of the script. Enter a label and click Save.
-
Click Versions to view, sort and compare the saved versions of the script.
-
-
Open the Details tab to add any other relevant information for the BDD specification, such as owner or linked backlog item.
-
Click Save to save the specification.
-
Run scenarios as described in Create and run BDD scenarios.
Tip: If your tests are automated, you can inject their results without having to manually create the BDD specification and scenarios. After the tests are injected, you can link items like application modules and backlog items to them. For details, see Automated scenario injection.
Reuse steps using the auto-complete mechanism
You can reuse test steps from a BDD specification. This enhances consistency and readability, and provides for more efficient code by preventing duplication.
To enable reuse, you first define which BDD specifications are included in the auto-complete mechanism. You can assign a spec to a reuse category based on your workflow. After specs are defined as contributing to auto-complete, you can then reuse test steps.
To create an auto-complete library for reuse:
-
Open a BDD specification's Details tab and add the fields Contributes to Auto-Complete and Auto-Complete category.
-
Define Contributes to Auto-Complete as Yes.
-
Define the Auto-Complete category according to your testing environment needs. The default is Main.
The site admin can add categories using Settings > Lists > Auto-Complete categories.
To reuse test steps using the auto-complete mechanism:
-
Create a spec. When you start typing a step, press CTRL+space to see a list of related steps available in the spec's category. Select the step you want to reuse.
-
If there is only one relevant step available, it is automatically filled in.
An icon indicates how many times each test step has been reused in the workspace.
-
When a step contains parameters, the auto-complete options do not display the exact parameter names, to enable reuse with other parameters.
Note: Auto-complete supports multiple languages. Tests written in one language are not provided suggestions from tests written in other languages.
Code alignment on the BDD spec
The Code alignment field describes whether the script on the BDD spec is aligned with the external automation script, as follows:
-
The Code alignment status of new BDD specs that are created starts as N/A.
-
After automated results start being received for one or more of the scenarios, the external script version is compared to the version in OpenText Core Software Delivery Platform.
-
If they are the same, the field value is Aligned.
-
If the script was changed externally, those changes need to be approved, the value is Approve external updates.
-
If someone makes a change in the BDD spec and the automation should be updated accordingly, the value is Update external code.
-
Next steps: