In recent years, Continuous Integration (CI) has become a best practice for software development. Build automation and automated testing form the core of CI.
AIO Tests supports automated testing with AIO public APIs and integration with frameworks like JUnit and TestNG.
The AIO Tests Jenkins plugin provides another easy to use interface to report test results right after the automated tests have run, thus helping in CI. The plugin wraps the AIO public APIs to import test results from TestNG or JUnit result XML files.
AIO APIs and Jenkins plugin can be used to publish results from any framework capable of generating JUnit files like Robot/Cypress/NUnit amongst many others.
Installing the plugin
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
The following options need to be configured for publishing results to AIO Tests
Specify the Project for which run results need to be published eg. SCRUM
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
Specify the API Key generated from AIO Tests in Jira. Please refer Generating API Key for more information.
The below table defines the rest of the field options
Select between existing and new cycle
In case of new cycle, Cycle prefix will be used to prefix the cycle title
If existing cycle is selected, specify AIO Tests cycle key eg. SCRUM-CY-121
If checked, cases not already in cycle are added, else the cases are reported as errors
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 of results to AIO Tests fails
Reporting results in pipeline
The AIO Tests Jenkins plugin has support for being run as a pipeline task. Below is an example.
For security of API Key, secret text credentials can be used to avoid putting the key in plain text. Plain text API Key would work as well.