/
CI/CD Rules

CI/CD Rules

QTM4J provides an ability to trigger automation jobs for CI/CD tools from QTM4J application to trigger automated testing pipelines with a single click. Testers can save remote CI/CD pipeline jobs and launch the jobs directly from QTM4J. Testers can select and map a configured rule to a test cycle, then trigger the pipeline job and automate the uploading of the results after the successful execution of the job. This feature enables all testers to participate in test automation and also reduces the overhead of navigating between multiple tools by automating the testing process and reporting results.

In QTM4J, users can create and trigger the Automation Rules from Automation module and Test Cycle module. Rules added in a project are accessible by all the users of that project.

Create a CI/CD Rule in QTM4J for Jenkins

You can configure CI/CD Rules in the Automation module and Test Cycle module of QTM4J. This section describes about configuring the CI/CD Rule from the Automation module. For details about configuring CI/CD Rules from the Test Cycle module, refer to Create CI/CD Rules from Test Cycle module.

Note: QTM4J just facilitates triggering of builds to the CI/CD tools. The resultant action or outcome of triggering the build, including the import of test results back to QTM4J, is not part of the feature. Though you can import the results back to QTM4J using multiple methods when configured as part of the Job. Multiple methods are Jenkins Plugin, Maven Plugin, etc.

Steps:

1. In QTM4J, go to the Automation module.

2. Open the CI/CD Rules section.

3. Click on the Create New Rule button on the right screen.

image-20240812-062756.png

The New Rule screen opens with the parameter fields on it.

4. Enter the following parameters to configure an automation job to be triggered in the CI/CD tool.

Parameter

Description

Parameter

Description

Name

Enter your preferred name of the rule.

Webhook URL

Enter the Webhook URL. For Jenkins, refer to How to Construct Webhook URL?

Query Params and Value

Enter the required Query Param and its value.

e.g. TestCycleKey, TestCaseFolderId, TestCycleFolerId, etc.

After adding the Query Params and Value, click on the Add button after entering Query Params and its Value. The entered details will be displayed below the fields.

Headers and Value

Enter Headers and values e.g. “Authorization”. For Jenkins, refer to Authorization.

After entering Headers and Values, click on the Add button after entering Header and its Value. The entered details will be displayed below the fields.

→ Mask Value After Saving: By default, the checkbox will be auto-selected if the system detects keywords such as “Authorization,” “Token,” “PAT,” or “API KEY” in the Header name. This smart detection mechanism helps identify critical or sensitive data and automatically protects the known sensitive parameters.

Once a parameter is tagged with "Mask Value After Saving," its value will be displayed as asterisks after the creation of the CI/CD Rule.

Note: Once a parameter value is set to be masked, the actual value becomes inaccessible after the initial save. You can only delete or overwrite it, as the system blocks any visibility into the existing secret value.

HTTP-Method

Select the HTTP method from POST/GET/PUT.

For example, the remote build trigger API for Jenkins is “POST”.

Webhook Body

Select from the options Raw/JSON/None on the drop-down and enter the Webhook Data or request body in the field accordingly.

→ Mask Value After Saving: You can select or deselect the "Mask Value After Saving" checkbox when creating or editing Webhook Data. Once a parameter is tagged with "Mask Value After Saving," its value will be displayed as asterisks after the creation of the CI/CD Rule.

Note: Once a parameter value is set to be masked, the actual value becomes inaccessible after the initial save. You can only delete or overwrite it, as the system blocks any visibility into the existing secret value.

5. Click Create to save the configuration for Jenkins.

The following are examples of triggering build without params, triggering build with query parameters, and triggering build with raw parameters.

CI/CD Rule Without Parameters