HCL OneTest API and Jenkins

When you use Jenkins for the continuous integration (CI) of your application, you can run tests for testing your application. You can run tests created in HCL OneTest API for your application in Jenkins by using the Integration Tester Jenkins Plugin.

For more information about the Jenkins Pipeline, refer to the Jenkins documentation.

Prerequisites

Before you can test by using the Integration Tester Jenkins Plugin, you must complete the following tasks:
  • You must configure a Jenkins primary server and a Jenkins secondary server. This configuration provides a single Jenkins installation on the Jenkins primary server to host multiple Jenkins secondary servers for building and running tests. For more information about the Jenkins primary and secondary server relationship, refer to the Jenkins documentation.
  • You must install the Integration Tester Jenkins Plugin on the Jenkins primary server, and install HCL OneTest API on the Jenkins secondary server, where you can create tests.
  • You must decide the type of Jenkins project that you want to use for running the integration tests. You can use any of the following project types:
    • Freestyle project
    • Pipeline project
    In a Freestyle project, you can create a build step from the Jenkins UI to run the test assets, whereas in the Pipeline project you can use simple text scripts based on the Groovy programming language to run the tests.
    You can define pipeline scripts during the configuration of the Pipeline project by using any of the following methods:
    Method Description
    Pipeline script In this method, you can directly enter a script in the field provided within the Jenkins UI or you can select a sample Pipeline script from the drop-down list.
    Pipeline script from SCM In this method, you can create a script with a Groovy editor and then commit the script file into the Git repository.
  • The Integration Tester Jenkins Plugin supports viewing of the test results by using the Test Results Analyzer Jenkins plugin. You must install the Test Results Analyzer plugin on the Jenkins primary server. You can view the test results in the Test Results Analyzer for the tests run from a Jenkins Freestyle project or from the Jenkins Pipeline project.

Task Flow: Testing with the Integration Tester Jenkins Plugin

You can follow the tasks that are listed in the following table when you want to use the Integration Tester Jenkins Plugin to run tests that you create on HCL OneTest API. The table also provides you the links to the information about the tasks.

Task Location More Information
1 Setting up Jenkins
1.1 Download and install Jenkins. Jenkins servers
1.2 Configure the relationship between the Primary and Secondary Jenkins servers. Jenkins servers Managing nodes
1.3 Create Jenkins agents. Jenkins secondary server Creating agents
1.4 Download and install the Test Results Analyzer plugin, if you want to view the test results by using this plugin. Jenkins primary server
2

Install HCL OneTest API on the Jenkins secondary server.

Jenkins secondary server Installation
3

Create tests for your application.

HCL OneTest API Creating and running a test
4 Generate a Jenkins project configuration file for the test. HCL OneTest API Generating a Jenkins project configuration file for running tests or suites
5 Set up the integration with Jenkins by using the Integration Tester Jenkins Plugin. Jenkins primary server Setting up the integration with Jenkins
6 Configure a Jenkins environment to view test results. Jenkins primary server Configuring a Jenkins environment for viewing test results
7 If you want to use a Freestyle project, continue with the following tasks:
7.1

Configure the Freestyle project to run a test by using the Integration Tester Jenkins Plugin.

Jenkins primary server Configuring the Freestyle project by using the Integration Tester Jenkins Plugin
7.2

Alternatively, configure the Freestyle project to run a test by using the Ant script from HCL OneTest API.

Jenkins primary server Configuring the Freestyle project by using the Ant script
7.3 Run HCL OneTest API tests on Jenkins. Jenkins primary server Running tests from Jenkins
7.4 View results of the test run by using any of the following methods:
  • Jenkins Dashboard
  • Test Results Analyzer plugin
Jenkins primary server Viewing test results in Jenkins
8 If you want to use a Jenkins Pipelines project, continue with the following tasks:
8.1 Create a pipeline script from the Jenkins UI. Jenkins primary server Creating a pipeline script from Jenkins
8.2 Configure the Pipeline project to use scripts from any of the following sources:
  • Scripts for the build step that you created in Jenkins.
  • Scripts for the build step that is available in a source control repository such as Git.
Jenkins primary server
8.3 Run HCL OneTest API tests on Jenkins. Jenkins primary server Running tests from Jenkins
8.4 View results of the test run by using any of the following methods:
  • Jenkins Dashboard
  • Test Results Analyzer plugin
Jenkins primary server Viewing test results in Jenkins