In order to create a new job all that you need to do is click on New Job and give it a name. Choose the option to create a Free-style project.
Our job will use git to retrieve the test automation project. This is the project mentioned in Chapter 3, Jenkins and TestLink Integration, and can be found at https://github.com/kinow/jenkins-testlink-plugin-tutorial. In a real world project you probably will use a SCM (SVN, Git, CVS, etc) to store your test automation project.
Click on Add build step button to expand its options and then click on Invoke TestLink. It will show a new form with options to integrate your Jenkins job with TestLink. The plug-in configuration screen contains three sections: TestLink Configuration, Test Execution and Result Seeking Strategy. To fill this form, we will use the configuration created in TestLink throughout Chapter 4, TestLink Configuration.
In this section, you are asked to provide the configuration that the plug-in will use to connect to TestLink and retrieve the data for your automated tests.
Use the following settings for this section:
Table 5.1. TestLink Configuration settings explanation
TestLink Version | Select the version that you created in the global configuration |
Test Project Name | My first project |
Test Plan Name | My first test plan |
Build Name | examples-$BUILD_NUMBER |
Custom Fields | Java Class |
This section contains the configuration to execute your automated tests. You can add Single Build Steps, which are executed once per build, or Iterative Build Steps, which are executed once per automated test found in TestLink.
There is an advanced section, that is hidden by default, with extra hooks.
Use the following settings for this section:
Table 5.2. Test Execution settings explanation
Single Build Steps | Add an Invoke top-level Maven targets build step, and as goals use test -DsuiteXmlFiles=suite.xml |
Iterative Test Build Steps | Leave it the way it is |
Finally, here you can configure the Result Seeking Strategy. The plug-in implements the Strategy pattern for seeking test results. What means that depending on your configuration, the plug-in might use certain algorithm for parsing and updating test results in TestLink.
Each strategy can have different settings. You can use more than one strategy, but you will have to take care to not have the same test in two different strategies.
Use the following settings for this section:
Table 5.3. Result Seeking Strategy settings explanation
Test Result Seeking Strategies | Add the TestNG class name strategy. |
Include pattern | target/**/testng-results.xml |
Key Custom Field | Java Class |
Attach TestNG XML | Leave it the way it is |
Mark skipped test as Blocked | Leave it the way it is |
Save your job.