Page History
...
In this tutorial, we will create some tests in Cucumber for Ruby (or JRuby).
In this case, the The test (specification) is initialy initially created in JIRA Jira as a Cucumber Test and afterwards, it is exported using the UI or the REST API.
Requirements
- install Install Ruby or JRuby
- install Install the "cucumber" gem
Description
After creating a Cucumber Test, of Cucumber Type "Scenario Outline", in JIRAJira, we you can export the specification of the test to a Cucumber .feature file (e.g. by via the REST API or by the UI action "Export to Cucumber" UI action from within the Test Execution issue).
The created file will be similar to the following one.:
Code Block | ||
---|---|---|
| ||
@REQ_CALC-889 Feature: As a user, I can calculate the sum of 2 numbers @TEST_CALC-908 @UI @core Scenario Outline: Cucumber Test As a user, I can calculate the sum of 2 numbers Given I have entered <input_1> into the calculator And I have entered <input_2> into the calculator When I press <button> Then the result should be <output> on the screen Examples: | input_1 | input_2 | button | output | | 20 | 30 | add | 50 | | 2 | 5 | add | 7 | | 0 | 40 | add | 40 | | 4 | 50 | add | 54 | |
...
After running the tests (see bellow) and generating the Cucumber JSON report (e.g., data.json), it can be imported to Xray (either by via the REST API or through "the Import Execution Results" action within the Test Execution).
No Format |
---|
cucumber -x -f json -o data.json |
...
The execution screen details will not just only provide information of on the test run result, but also of each of the examples provided in the Scenario Outline.
...
Info |
---|
The Cucumber Scenarios Example/Result details (i.e., Hooks, Backgrounds and Steps) , are only available for executions made with executions done in Xray v2.2.0 and above. |
...
Info |
---|
The icon( HooksHook, Backgrounds Background and Steps) , but are but is only available for executions made with executions done in Xray v2.3.0 and above. represents the evidences ("embeddings") for each |
Info | ||
---|---|---|
| ||
Please see Testing with Cucumber for a high level an overview on how to use Cucumber Tests with Xray. |
...
References
- https://cucumber.io/docs/reference/ruby
- Automated Tests (Import/Export)
- Exporting Cucumber Tests - REST
...