Upload test results⚓︎
Setup⚓︎
To upload your test results to Xray, make sure you have enabled the results upload in your configuration file:
Afterwards, simply run Cypress:
Note
Don't forget to provide your authentication credentials.
How it works⚓︎
The plugin will only upload results for tests you have linked to existing test issues.
The plugin will also create a new test execution issue, unless you tell it to reuse a specific test execution issue.
Xray Documentation
You can find more information on the mechanisms and constraints regarding imports of test execution results here for Xray server and here for Xray cloud.
Uploading Cypress test results⚓︎
The following example consists of three test cases for https://example.org:
The first one tries to find an
<h1>
element with textExample Domain
.The second one asserts that the page contains an
<a>
element with ahref
attribute.The third one tries to find an
<img>
element, which does not exist on the page.
When uploading the results, the plugin will create a test execution issue containing the three executed test issues. Since Cypress automatically takes screenshots on failure, the execution will also contain the screenshot as evidence for the failed test case.
A corresponding video can be seen here.
Data-driven results⚓︎
The plugin fully supports data-driven test execution in the following form:
If an issue key is detected in more than one test result, all corresponding test results are mapped to parameterised test results in Xray.
By default, the plugin simply adds a single parameter containing the iteration index:
To actually define concrete iteration parameters, a Cypress task can be used:
Using enqueueTask
(with or without PluginTask
) allows for type safe task calls.
Xray Documentation
You can find more information on parameterised test executions here for Xray server and here for Xray cloud.
Note
The parameter values have a maximum allowed length.
On Xray server, the length can be configured by your Xray admins to be anywhere between 64 and 255 (see section Datasets).
On Xray cloud, the maximum allowed length is simply 255.
Uploading Cucumber test results⚓︎
The following example consists of three scenarios for https://example.org, wrapping the tests described above. Since we know that the image test will always fail, we'll mark it as skipped to make use of custom Xray statuses (see here for more information).
Note
The Cucumber preprocessor plugin reports skipped scenarios by marking all the steps they contain as skipped. To mark a Cucumber test as skipped in Xray, you need to specify the respective step status. Xray will then combine the steps' statuses according to your status settings into an overall test status (e.g. if at least one step was skipped, the entire test will be considered skipped).
When uploading the results, the plugin will create a test execution issue containing the three executed scenarios. As the third scenario has been marked as skipped and a custom status has been provided for skipped steps, the entire test for the image verification will also be marked as skipped.
Note
Please read the Cucumber setup guide if you're confused about what's going on below.