The AIO Tests Jenkins plugin provides yet another easy to use interface to report test results into AIO Tests for Jira, right after the automated tests have run. The plugin wraps up the AIO public APIs to import test results from TestNG/JUnit or NUnit result XML files or Cucumber.json report. It can be used with any framework capable of generating JUnit files like Robot/Cypress amongst many others.
The plugin gives the following options
- to update existing Cycle case runs or create new execution Cycles on the fly for each run.
- to add cases to an execution Cycle
- to create new Cases in AIO Tests, if they do not exist
AIO Tests Jenkins plugin can be installed from the Jenkins marketplace as below.
- Login to your Jenkins instance.
- Go to Manage Jenkins > Manage Plugins > Available
- Now search for AIO Tests and click Install
- Jenkins 2.235.1 or higher
- Jira cloud instance with AIO Tests for Jira installed
The plugin works in the post build actions
step, after the build steps are run.
Assuming that the tests have run and a results xml (Junit/TestNG/any XUnit framework which generates a JUnit xml report)
has been generated, the AIO Tests plugin can be used as below to report results of cases in the report XML to Jira.
-
Go to project -> Configure
-
Click on the Post Build Actions -> Select Publish Results to AIO Tests
-
Specify the Project for which run results need to be published
-
Choose a framework and specify the path of the file - relative to the workspace eg.
/target/surefire-reports/testng-results.xml
For frameworks other than JUnit or TestNG, if results file is being generated in JUnit format, please select JUnit
-
Select preferences for results reporting
-
Specify the API Key generated from AIO Tests in Jira. Please refer Generating API Key for more information
Field | Details |
---|---|
Cycle Preference | Select between existing, new cycle or search for an existing cycle by name and create if not found |
Cycle Prefix | In case of new cycle, Cycle prefix will be used to prefix the cycle title |
Cycle Key | If existing cycle is selected, AIO Tests cycle key eg. SCRUM-CY-121 |
Cycle Name | If Create if absent cycle is selected, name of cycle to search or to create in its absence |
Add Case | If checked, cases not already in cycle are added, else the cases are reported as errors |
Create New Run | If checked, new run is created for each case execution, else existing run is overwritten |
Create Case | If checked and no case exists with a matching case key or automation key, a new case is created |
Hide Publish Result Details | If checked, it would hide testcase wise details |
Fail build if result publishing fails | If checked, the build result will be updated to failed, in case publishing results fails |
The AIO Tests Jenkins plugin has support for being run as a pipeline task.
For security of API Key, secret text credentials can be used to avoid putting the key in plain text.
Below is an example.
pipeline {
agent any
environment {
AIO_TESTS_API_KEY = credentials('aioTestApiKey')
}
stages {
stage('SCM') {
steps {
git 'https://github.com/org/sample-testng-tests.git'
}
}
stage('Build') {
steps {
sh 'mvn test'
}
}
}
post {
always {
aioImport frameworkType : 'TestNG',
addCaseToCycle :true,
createCase :true,
entry: [$class: 'NewCycle', cyclePrefix: 'Regression Run V1.0'],
//For existing cycles : entry: [$class: 'ExistingCycle', cycleKey: 'SCRUM-CY-191'],
//For createIfabsent cycles : entry: [$class: 'CreateIfCycleAbsent', cycleName: 'Regression Release Alpha'],
apiKey : hudson.util.Secret.fromString(env.AIO_TESTS_API_KEY),
resultsFilePath : '/target/surefire-reports/testng-results.xml',
projectKey: 'SCRUM',
hideDetails: false
}
}
}
If the job is a parameterized build, the plugin supports parametrization for the project key, results file path, cycle prefix, existing cycle key and API key fields.
For any issues or enhancements, please reach out @ AIO issue tracker.
AIO Tests for Jira is a test management tool which aims to simplify the entire test lifecycle with powerful features like simple testcase creation and management, traceability with requirements, modularization of cases, efficient case execution, insightful reporting and agile automation.
To learn more, please have a look at our extensive documentation.
Licensed under Apache License 2.0, see LICENSE