Leapwork and Jira Xray Integration
Leapwork and Jira Xray Integration
Leapwork Test Automation is often used in conjunction with Test Management products. This document describes the integration between Leapwork Test Automation and Jira Xray Test Management.
Leapwork
Leapwork’s no-code Test Automation technology makes it quicker and easier for regular business users and IT teams to adopt, so that they can scale automation faster - ultimately empowering quality assurance teams, leading to shorter test cycles and immediate return on investment. This means that enterprises can continue to grow and optimize their performance because they can rely on their business software to work as it should, with test automation as an integral part of their software development lifecycle.
Jira Xray
The role of software testing is becoming increasingly important in the software development lifecycle to ensure that software is released with the highest possible quality. With an increased amount of testing, more advanced test plans and strategies, it is evident that a proper test management tool is needed. Xray for Jira is a Test Management tool that provides the structure to organize, plan, and report with accuracy on the progress of testing as well as the readiness to deploy.
Integration
CI-CD Pipeline implementation of the Continuous Integration/Continuous Deployment software is the backbone of the modern DevOps environment. Most organizations using DevOps practices are using Jenkins. Jenkins is an open-source CI tool that can be used to execute the Leapwork tests. Jenkins is a Continuous Integration tool which does this verification periodically or whenever the developer pushes the code to the repository.
Both Leapwork and Jira Xray integrate natively with Jenkins, and so with each other.
| Picture 1: Example of Leapwork reporting in XRay |
Installation
Both the Jira Xray and Leapwork plugins are installed from within the Jenkins “Plugin” store.
Open Manage Jenkins -> Manage Plugins
| Picture 2: Plugin configuration in Jenkins |
Leapwork plugin for Jenkins: Leapwork Integration
Jira Xray integration: Xray - Test Management for Jira Plugin
| Picture 3: Leapwork Plugin in Jenkins |
Configuration
This section will describe the configuration of the different components in Leapwork, Xray, and Jenkins.
| Picture 4: Architecture of Xray integration and Jenkins. |
| Picture 5: Entity relationships between Xray and Leapwork |
Jira Xray configuration
Before configuring the Jenkins pipe, two things need to be configured in Jira Xray:
One or more test plans which correspond with a run list in Leapwork.
The Jenkins pipeline will map a Test Plan with a Run List in Leapwork. In Jira Xray create an issue of type “test plan.” A logical name could be to use the corresponding name of the Run list in Leapwork.The authentication for Jenkins.
Jenkins will create the tests and update the test plan on behalf of the Leapwork server. It therefore makes sense to create a new user in Xray called “Leapwork Server” or similar. After creating the user, go to the “XRAY API Keys” (Jira settings -> Apps -> Xray API Keys), and create a new key for Jenkins. Note both the “Client ID and Client secret.
NOTE: The Xray API keys are not the same as Jira API Keys!
| Picture 6: API Keys in XRay |
Leapwork Configuration
The Leapwork configuration is limited to:
- Creating an API key. (Settings-> API access Keys). Make a note of the key
- A Runlist. Create a run list with required test (flows).
- A Schedule. Create an “on Demand” schedule and make a note of the name.
| Picture 7: Run list in Leapwork |
Jenkins Configuration
First step in Jenkins is to configure the Jira Xray server instance. In Jenkins go to:
Manage Jenkins -> Configure System
When the Xray plugin is configured correctly you will find an “Xray Configuration section.” Configure the server details and provide an alias. For credentials press “add” and use the Xray Client ID and Xray API key created previously. Use the “test connection” button to test the configuration.
| Picture 8: Xray application configuration in Jenkins |
Then press “New Item” button in Jenkins. A logical name could be similar to the Runlist / Test plan names. Next to optional other configurations, press the “Add build step” button and select “Leapwork integration.” The Leapwork plugin will appear. Configure the following steps:
| Picture 9: Leapwork plugin configuration in Jenkins |
After configuring the Leapwork Plugin you may configure the Xray plugin. Press the button “Add post-build action” and select “Xray: Results Import Task.” Configure the following steps:
| Picture 10: XRay plugin configuration in Jenkins |
Leapwork Jira Xray integration in action
Pre-requisites to be done in Xray:
- Create Test Plan
- Add Tests to a Test Plan
- Associate Test Executions to the Test Plan
- Create Test Executions from the Test Plan
For more information on above, please refer to How to create a Test Plan.
After creating a test plan and configuring the plugins, one or more release pipelines can be configured in Jenkins in order to launch the automated tests and report the results back to Xray.
Step 1: Execution of Jenkins pipeline
The progress of the Jenkins pipeline can be monitored by means of the console output: Pipeline\Instance\Console output
The Leapwork Automated tests could run for quite some time (depending on the test requirements). During this period, the Jenkins job will keep polling the Leapwork server for results. The polling interval is based on the Leapwork plugin configuration.
During each server request the following text will be displayed:
The schedule status is already 'Executing' - wait a minute...
The default polling interval is 5 seconds.
| Picture 11. Sample console output Leapwork automated tests. |
Step 3: Creation or update of Jira Xray “Tests.”
When the Jenkins pipeline is finished, the Xray plugin will create or update a “test” for each flow that was part of the run list.
| Picture 12: Test case in XRay |
The “Test Runs” section will contain an instance for every time the flow (test) was executed:
| Picture 13: Xray Test runs |
For each test run, the flow (test) details can be retrieved:
| Picture 14: Xray Test details page with Leapwork keyframes. |
Step 4: Updated associated Jira Xray “Test Plan”
The associated Jira Xray “Test Plan” will display the latest test results per flow (tests):
| Picture 15: Xray Test Plan |
Step 5: For each run a new “Execution results” ticket will be created
| Picture 16: Execution result in Xray. |
Read the full documentation on the Leapwork Third Party Integration.
For any clarification, please contact our Priority Support.