Installation⚓︎
Run the following command to add the plugin to your Cypress project:
This plugin easily handles:
- Cypress test executions: JavaScript/TypeScript specs
- Cucumber test executions: Cucumber feature files
Below you will find the two ways to setup the plugin's basics, one for Cypress tests only (when not running Cucumber feature files) and for added Cucumber support.
Cypress tests⚓︎
Modify the setupNodeEvents()
function in your Cypress configuration file as follows:
Tip
Check out the configuration for more information on how you should configure the plugin to make it work within your infrastructure. You can also shoot a glance at the examples for a more hands-on approach.
Cucumber tests⚓︎
For Cucumber support, this plugin builds upon the cypress-cucumber-preprocessor
plugin for executing Cucumber feature files.
With added Xray synchronization, this plugin allows you to automatically upload feature files to Xray when running your Cypress tests and to track their execution results in Xray.
Run the additional following commands to handle Cucumber test executions as well:
Note
Package cypress-on-fix
is required for registering multiple event handlers to Cypress's events (see here).
To enable the plugin, modify the setupNodeEvents()
function in your Cypress configuration file as follows:
Order matters here!
The Cucumber plugin must be added first so that its event listeners will run before those of the Xray plugin.
Otherwise, the Xray plugin won't be able to find the result report generated by the Cucumber plugin, because it won't exist yet.
The highlighted lines are the ones addressing Xray support.
Lines 11-23
Here you should configure the Xray plugin the way you want it to work with your Xray instance. Read this for more information.
Line 25
This line enables upstream synchronization of your feature files with your Xray instance. See here for more information.