Page History
Table of Contents |
---|
...
Info | ||
---|---|---|
| ||
Please take a look at the general guidelines for Working with automated Tests for Xray for JIRA Jenkins Plugin and also the specifics for Testing with Cucumberfor Xray for JIRA Jenkins Plugin. |
Release Notes
Children Display |
---|
...
Info | ||
---|---|---|
| ||
You may download the latest version of the Jenkins plugin here: xray-for-jira-connector.hpi. Xray for JIRA Jenkins Plugin. |
Configuration
Xray for JIRA Jenkins Plugin is configured in the global settings configuration page Manage Jenkins > Configure System > Xray for JIRA configuration.
...
- Configuration alias;
- Server Address: The address of the JIRA Server where Xray is running;
- Authentication:
- User: Username;
- Password.
Creating a new Project
...
For this add-on you should configure a "Freestyle project". In the home page, start by clicking on the option "New Item", then select "Freestyle project", provide it a name and then click "OK".
Build Steps
Build steps are the building blocks of the build process. These need to be defined in the project configuration.
...
By using this build step, it will export the Cucumber Tests (i.e. Scenario/Scenario Outlines) in .feature or bundled in a .zip file. The rules for exporting are defined here.
This build step corresponds to invoke Xray's Export Cucumber Tests REST API endpoint (more info here).
Configuration fields
Some fields need to be configured in order to export the Cucumber Tests. As input you can either specify issue keys (see the endpoint documention here) or the id of saved filter in JIRA.
field | description |
---|---|
JIRA instance | The JIRA instance where Xray is running |
Issue keys | Set of issue keys separated by ";" |
Filter ID | A number that indicates the filter id |
File path | The relative path of the directory where the features should be exported to; normaly this corresponds to the "features" folder of the cucumber project that has the implement steps. Note: the directory will be created if it does not exist. |
...
The add-on provides easy access to Xray's Import Execution Results REST API endpoints (more info here), and therefore it mimics the endpoints input parameters.
...
To start the configuration, add the build step Xray: Cucumber Features Export Task.
After that, configure it.
In this example we configured the task to extract the features from a set of issues (PROJ-78 and PROJ-79), to the folder that holds the Cucumber project.
Importing the execution results
To start the configuration, add the post-build action Xray: Results Import Task.
After that, configure it.
In this example, we configured the task to import the Cucumber JSON results back to JIRA.
Finished all configurations, hit the save button in the bottom of the page.
After running the job, the expected result is a new Test Execution issue created in the JIRA instance.
Importing the execution results with user-defined field values
...
And configured the task to import the Cucumber JSON Multipart results back to JIRA
Finished all configurations, hit the save button in the bottom of the page.
After running the job, the expected result is a new Test Execution issue created in the JIRA instance, with the Test Execution fields as specified in the Jenkins build step configuration.
JUnit
Apart from supporting natively Cucumber, Xray for JIRA enables you to take advantage of many other testing frameworks, for instance JUnit. In this sense, Xray for JIRA Jenkins Plugin lets you to import other results in other formats besides Cucumber JSON.
...
To start the configuration, add the post-build action Xray: Results Import Task.
After that, configure it.
In this example we have a configuration where the format JUnit XML is chosen.
After running the plan, the expected result is a new Test Execution issue created in the JIRA instance.
Troubleshooting
...
Your build process is failing and when you check its log , it presents you the following:
By default, when the user successively tries to log in to JIRA with wrong credentials, the next time you try to log in, JIRA instance will prompt you to provide a CAPTCHA. It is not possible to provide this information via the build process, so it will fail with status code 403 Forbidden.
You will need to log in to JIRA via browser and provide the CAPTCHA.
In case you are a JIRA administrator, you can go to JIRA administration > User Management and reset the failed login for the user who failed to log in.