Creating a pipeline script from Jenkins
You must create a pipeline script to run test assets that are available in the HCL OneTest™ Server project from the Jenkins Pipeline project.
Before you begin
You must have completed the following tasks:
-
Installed the HCL OneTest™ Server Jenkins plugin on the Jenkins server. See Installing the HCL OneTest Server Jenkins Plugin.
-
Generated an offline user token from HCL OneTest™ Server. See Managing access to HCL OneTest Server.
-
Created a Jenkins Pipeline project.
Procedure
- Open your Jenkins Pipeline project from the list.
- Click Configure, and then select the Pipeline tab.
- Click Pipeline Syntax to generate a pipeline script.
- Select the step: General Build Step option from the drop-down list in the Sample Step field.
- Select the Run HCL OneTest Server test option from the drop-down list in the Build Step field.
-
Provide the details about the test run for the fields in the following
table:
Field Description Name Enter a name for the Jenkins build step.
Use Custom Trust Store Select the Use Custom Trust Store checkbox if you used an internal CA certificate and imported the certificate to the custom trust store. You can then enter the file path of your trust store followed by the file name in the Custom Trust Store Path field.
Select the Use Custom Password for the Trust Store checkbox if you modified the trust store password, and then enter the new password in the Custom Trust Store Password field.Note: If you did not modify the trust store password, you must clear the Use Custom Password for the Trust Store checkbox.Server URL Enter the URL of HCL OneTest™ Server.
The format of the URL is as follows: https://hostname.
Offline Token Enter the offline user token that you generated from HCL OneTest™ Server. Team Space Select the name of the team space from the drop-down list.
The Team Space drop-down list displays the names of the team spaces if you are an Owner or a member of the team space.
Project Select a project from the drop-down list.
The Project drop-down list displays the projects that are available in the corresponding team space of HCL OneTest™ Server.
Note: The Project drop-down list displays the projects where you are an Owner or a member of HCL OneTest™ Server. You must be an Owner or a Tester of the project that is available in the team spaces to run the tests from the Jenkins server.Branch
Select the branch from the drop-down list.
The Branch drop-down list displays the branches available in the corresponding project of HCL OneTest™ Server.
Asset Type Select the test asset type that you want to run from the Asset Type drop-down list.
The available options for the Asset Type field are as follows:- AFT Suite
- API Suite
- Compound Test
- Rate Schedule
- VU Schedule
Notes:-
You cannot run the following test assets from the Jenkins server:
- API test
- Functional test
- HCL AppScan CodeSweep
- JMeter Test
- JUnit Test
- Performance test
- Postman resources
-
The Test Environment field is mandatory if you select APISUITE as an asset type to run an API suite.
Test Select the required test from the drop-down list.
The Tests drop-down list displays the available test assets from the corresponding branch in the following format:
Project_name [Path: the path of the test assets] [Repo: URL of the Git repository that the test belongs to]
Test Environment This field is mandatory only if you select Asset Type as APISUITE.
The Test Environment list displays the available test environments from HCL OneTest™ Server.
Note: The following message is displayed when you select any other asset type apart from APISUITE in the Asset Type field:You can select Test Environment only if you are running tests of type APISUITE.
- Click Generate Pipeline Script and copy the script that you created for the build step to use it in the sample script.