Share this page

# Gherkin tests

Gherkin is a syntax for writing tests using behavior-driven development (BDD).

Note: When creating new tests, we recommend using the BDD testing entities instead of the Gherkin Test entity. For details, see BDD testing framework. Existing Gherkin tests are still supported as legacy entities.

In this topic:

## Create Gherkin tests

Before adding scenarios and steps to a Gherkin test, create the tests.

To create a Gherkin test:

1. In the Backlog or Quality modules, or the Tests tab of a test suite, click + Gherkin Test.

2. Assign test attributes. Make sure to enter values for the following fields.

   Field | Details
   --- | ---
   Test type | The type of test, such as Acceptance, End to End, Regression, Sanity, Security, or Performance.
   Backlog coverage | Select the backlog items the test covers. This helps you track release quality.
   Application modules | The product's application modules. This helps you track product quality, regardless of release.

3. Click Add & Edit.

4. Select the Script tab.

   The script is generated with the Test ID (TID) and revision number (REV). If you automate the test, these lines help identify the Gherkin test for the test results.

   1 #Auto generated Octane revision tag

   2 @TID1001REV0.1.0

   3 Feature:

   Caution: Do not delete the Test ID tag. It is used to map the automation results.

5. In the Feature line, add a description of the feature.

6. Use the following buttons to automatically add template blocks to the script.

   Button | Description
   --- | ---
   Add scenario | Inserts a scenario block.
   Add scenario outline | Inserts a scenario outline block with a table of Examples.
   Add rule | Inserts a rule block with multiple scenarios.

7. Click Format script to automatically format the Gherkin script for increased readability.

   Click Save Version to save the current version of the script. Enter a label and click Save.

8. Click Versions to view, sort and compare the saved versions of the script.

Back to top

## Localization

You can localize Gherkin test feature files and BDD specs using any language supported by Gherkin.

You define the language at the top of the feature file or script, using the standard Gherkin notation, `# language`. For example, the "fr" notation is an instruction to use the French language.

# language: fr

When you click Add scenario or Add scenario outline, text is added in the language that you specified.

If no language is specified, the default English is used. Admins can set the language using the GHERKIN_SCRIPT_DIALECT parameter. For details, see Configuration parameters.

The last language used is remembered, so that when you create a new document, it will be in your specified language.

Back to top

## Prepare Gherkin tests for automation

By default, when you create a Gherkin test, the test's automation status is Not automated.

To prepare Gherkin tests for automation:

1. On the test Details tab, set the Automation status to Ready for automation.

2. Download the Gherkin script and automate it in your preferred Java development environment. For details, see Automate Gherkin tests.

3. When you complete the automation process in your IDE and CI server environment, and the script in OpenText Software Delivery Management matches that in the IDE, the Automation Status changes to Automated.

   If the script version in your IDE does not match or is not synchronized with the script version, adjust depending on the status.

   Status | Details
   --- | ---
   Requires update | The script was modified in OpenText Software Delivery Management and is not up-to-date in the automation code. Download the new version of the script. Merge the script with the previous version in the IDE. Update the automation code. The CI server uses the latest version of the script from the automation code. If the script version in the automation code is not up-to-date, the test runs with an older script version than the one in OpenText Software Delivery Management.
   Requires approval | The script was modified in the IDE and is not up-to-date in OpenText Software Delivery Management. Click the Script changed externally link to compare script versions. Decide which script version you want to approve. Click Accept to update the script in OpenText Software Delivery Management according to the external version from the automation code. Click Decline to reject the externally modified script and to keep the OpenText Software Delivery Management script version. The script is now the same, and the test's Automation status is displayed as Automated.

Back to top

## Copy tests to another workspace

You can copy tests from one workspace to another one, within the same shared space.

For details, see Copy and move across workspaces.

Back to top

Next steps:

- Test script versioning
- Plan and run manual tests
- Automate Gherkin tests

https://admhelp.microfocus.com Software Delivery Management 8942
Tips to improve your search results... OpenText™ Software Delivery Management Help Center OpenText™ Software Delivery Management Help 26.1 All View Local Help Center View Online Help Center Version: