Create Gherkin tests
Create Gherkin tests to test from a user perspective and to help transition manual testing to automated testing.
Gherkin tests overview
Gherkin is a syntax for writing tests using behavior-driven development (BDD). This syntax lets you test from the user perspective by using use-case scenarios.
Using Gherkin tests has the following advantages.
Advantage | Details |
---|---|
Gherkin tests help transition from manual to automated testing |
By creating Gherkin tests, you can move them to automated tests:
|
Using Gherkin scenarios, add parameter-like functionality |
Because Gherkin tests use scenarios, change the values used in the test run. |
Create Gherkin tests
Before adding scenarios and steps to a Gherkin test, create the tests.
To create a Gherkin test:
-
In the Backlog or Quality modules, or the Tests tab of a test suite, click + Gherkin Test.
-
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. -
Click Add & Edit.
-
In the Script tab, add the required feature and test scenarios. For details, see Add test scenarios.
Tip: If your tests are automated, you can inject their results and don’t have to manually create the tests. After the tests are injected, you can link items like application modules and backlog items to them. For details, see Automate Gherkin tests.
Add test scenarios
Add features and scenarios to provide the content of the test. For details about the syntax, see Gherkin test syntax.
To add Gherkin test scenarios:
-
In the test, open 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.
Copy code1 #Auto generated Octane revision tag
2 @TID1001REV0.1.0
3 Feature:Note: Do not delete the Test ID tag; it is used to map the automation results.
-
In the Feature line, add a description of the feature.
-
In the toolbar, click the Add Scenario button or the Add Scenario Outline button . Enter the details in the scenario or scenario outline template.
- Add scenarios or scenario outlines as required.
The script is saved as a text file. Edit the file or download it to your IDE.
Note: Renaming the feature file in the Git repository may break the link between the feature file and the relevant Gherkin test or BDD Scenario.
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:
-
On the test Details tab, set the Automation status to Ready for automation.
-
Download the Gherkin script and automate it in your preferred Java development environment. For details, see Automate Gherkin tests.
-
When you complete the automation process in your IDE and CI server environment, and the script in OpenText Core Software Delivery Platform 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 Core SDP 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 Core SDP.
Requires approval The script was modified in the IDE and is not up-to-date in OpenText Core SDP.
- 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 Core SDP according to the external version from the automation code. Click Decline to reject the externally modified script and to keep the OpenText Core SDP script version.
The script is now the same, and the test's Automation status is displayed as Automated.
Copy tests to another workspace
You can copy tests from one workspace to another one, within the same shared space.
For details, see Copy items to another workspace.
Next steps: