About
You might want to launch ReadyAPI functional and security tests in TestEngine as a part of your CI/CD flow in Jenkins. The ReadyAPI TestEngine Jenkins Plugin allows you to easy do that.
Requirements
-
The 1.7.0 plugin version requires Jenkins 2.222.4 or later.
-
You require a license to run tests using the plugin. See here for licensing.
ReadyAPI TestEngine Jenkins Plugin
Install or update the plugin
The plugin version 1.2.0 no longer supports specifying project password and user credentials in the corresponding fields. It uses the Credentials plugin instead.
Modify test jobs that use the plugin after you update it to version 1.2.0.
To install the plugin:
-
Download the Jenkins plugin from our website:
https://support.smartbear.com/downloads/readyapi/ -
Open Jenkins and select Manage Jenkins > Manage Plugins:
-
In the Advanced tab, go to the Upload Plugin section, click Choose File and select the .hpi file with the plugin.
-
Click Upload:
Global settings
To configure global settings of the plugin, select Manage Jenkins > Configure System:
You will find the settings in the ReadyAPI TestEngine Plugin section:
Option | Description | ||
---|---|---|---|
Server URL |
The URL of the TestEngine server. |
||
Credentials |
Select credentials of a TestEngine user. |
||
Username |
The username that will be used to log in to the TestEngine instance. |
||
Server password |
The user's password |
||
JUnit Report directory |
The directory in your workspace to which JUnit reports will be saved. If it is not specified, no reports will be saved. |
Click Test Connection to check whether Jenkins can connect to TestEngine using the specified URL, username and password.
Run tests
By using a freestyle project
To run ReadyAPI test in TestEngine by using Jenkins:
-
Make sure the ReadyAPI TestEngine Jenkins Plugin is installed.
-
In Jenkins, select a job and click Configure.
-
In the Build section on the General tab, click Add build step > Run ReadyAPI Projects in TestEngine:
-
Jenkins will add the step to the build. Configure the build step options and click Save:
By using a pipeline project
The ReadyAPI TestEngine Jenkins Plugin supports launching tests from Jenkins Pipeline. To do this, use the testEngine
step:
-
Make sure the ReadyAPI TestEngine Jenkins Plugin is installed.
-
In Jenkins, select a job and click Pipeline.
-
In the Pipeline section, add the
testEngine
step to your Pipeline script. For example:Jenkins pipeline
pipeline {
agent any
stages {
stage('Tests') {
steps {
testEngine (
pathToProjectFile: '/home/user/work/my-ready-api-project.xml', projectFileCredentialsId: 'i5n70i1i-b392-69l3-c047-5l183b89icj7' )
}
}
}
}
Build test step options
You can configure the following build step options:
Option | Description |
---|---|
Path to project file or directory |
The fully-qualified path to the ReadyAPI project you want to run. Pipeline option: |
Project options
Test suite name |
The test suite to run. To run all the test suites of your project, leave the field blank. Pipeline option: |
||
Test case name |
The test case to run. If you leave the field blank, the runner will execute all the test cases of the specified test suite, or, if you have not specified a test suite, all the test cases of your project. Pipeline option: |
||
Security test name |
The security test to run. Pipeline option:
|
||
Active environment |
The environment configuration for the test run. Pipeline option: |
||
Callback URL |
The URL to which Jenkins will post the results of the test run.
Pipeline option: |
||
Priority Job |
Enable this option to skip all non-priority jobs in the queue. Pipeline option:
|
Click Advanced to see more options.
Advanced project options
Project file password |
The encryption password. It is needed if you have encrypted the entire project or some of its custom properties. See Protecting Sensitive Data. In plugin version 1.2.0 or later, select a credentials instance containing the desired password. Pipeline option: |
||
Endpoint |
The endpoint in the Pipeline option: |
||
Tags |
A comma-separated list of tags to filter test cases and test suites by. Only the test cases and test suites matching all the tags will be run. Pipeline option: |
||
JUnit Report directory |
The directory in your workspace where JUnit reports will be saved.
Pipeline option: |
Custom Properties
In the Custom Properties section, you specify values of the custom properties to be used in the test run.
-
Select the test suite or test case that contains the custom property to override. Click Add to create the needed target if needed.
-
Click Add to add a custom property. Specify the name of the property in the Property Key column and the needed value in the Property Value column:
TestEngine Connection Options
Server URL |
The URL of the TestEngine instance.
Pipeline option: |
||||
Credentials |
Select credentials of a TestEngine user.
Pipeline option: |
||||
Username |
The username that will be used to log in to the TestEngine instance.
|
||||
Password |
The user’s password.
|
Click Test Connection to check whether Jenkins can connect to TestEngine using the specified URL, username and password.
Specify credentials
For specifying sensitive data - the encryption project password and credentials of a TestEngine user - the ReadyAPI TestEngine plugin uses the Credentials Jenkins plugin.
To specify new credentials:
-
Click Add next to the credentials drop-down list and select the needed provider (Jenkins by default):
Alternatively, you can go to the Credentials section and click Add credentials in the needed domain:
-
Specify the needed values:
Option Description Domain Select the domain where you want to store the credentials.
Kind Select the kind of the credentials:
-
Username and password to store the username and password of a TestEngine user.
-
Secret text to store the encryption project password.
Scope Select the scope for the new credentials.
Username
PasswordSpecify the username and password of a TestEngine user.
Secret text Specify the encryption project password.
ID The credentials id.
You need the id to specify credentials when specifying a TestEngine test step in the pipeline project.
Leave the field blank to assign a randomly generated id.
Description Specifies the description to help distinguish one credentials instance from another in the selection drop-down list.
-
-
Click Add to create credentials.
After that, Jenkins shows the created credentials in the corresponding drop-down list: