Page History
Table of Contents |
---|
...
Info | ||
---|---|---|
| ||
This app was tested against Jenkins v2.32.x and it may not work properly with previous versions. |
Manual Installation
Info | ||
---|---|---|
| ||
You may download the latest version of the Jenkins plugin from the latest Release Notes. |
If you have the actual xray-for-jira-connector.hpi
file,
- Go to the Update Center of Jenkins in Manage Jenkins > Manage Plugins.
- Select the advanced tab
- In the Upload Plugin section, click upload and select the file
xray-for-jira-connector.hpi
file.
...
...
title | Download the latest version of the Jenkins Plugin |
---|
...
You may download the latest version of the Jenkins plugin here: Integration with Jenkins.
Configuration
Xray for Jenkins 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 app, you should configure a "Freestyle project". In the home page, clicking New Item > Freestyle project, provide 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.
...
This build step 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.
It invokes Xray's Export Cucumber Tests REST API endpoint (see more information here).
Configuration
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 the saved filter in Jira.
...
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.
Once all configurations are done, click Save at 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.
Once all configurations are done, click Save at 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 Cucumber natively, Xray enables you to take advantage of many other testing frameworks like JUnit. In this sense, Xray for Jenkins lets you import 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 JUnit XML format is chosen.
After running the plan, the expected result is a new Test Execution issue created in the JIRA instance.
Troubleshooting
...
When you check the log, it has the following:
By default, when you successively try to log into Jira with the wrong credentials, the Jira instance will prompt you to provide a CAPTCHA the next time you try to log in. 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 into Jira via the browser and provide the CAPTCHA.
If you are a Jira administrator, you can go to Jira administration > User Management and reset the failed login.