CI/CD Rules

QTM provides the ability to trigger automation jobs/pipelines for CI/CD tools with a single click. Testers can save remote CI/CD pipeline jobs and launch the jobs directly from QTM. Testers can select and map a configured rule to a test suite, 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 QTM, users can create and trigger the Automation Rules from the Integration module and Test Suites module. Rules added to a project are accessible to all the users of that project.

→ Required Permissions: Users should have CICD Rule View, Manage, Delete, and Execute permissions.

 

The QTM CI/CD Rules feature is described for the Jenkins tool on this page as an example. Refer to sub-pages for details on the configuration of other CI/CD tools.

Create a CI/CD Rule in QTM for Jenkins

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

Note: QTM just facilitates the 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 QTM, is not part of the feature. Though you can import the results back to QTM using multiple methods when configured as part of the Job. Multiple methods are Jenkins Plugin, Maven Plugin, etc.

Steps:

1. In QTM, go to the Integration module.

2. Open the CI/CD Rules section.

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

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 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.

HTTP-Method

Select HTTP-method from POST/GET/PUT.

For example, 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 or request body in the field accordingly.

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

 

CI/CD Rule With Query Parameters

CI/CD Rule With JSON Parameters

 

Once the CI/CD Rule is configured, you can:

  • Trigger CI/CD Rule from the Integration module

  • Trigger CI/CD Rule from the Test Suites module

Trigger CI/CD Rule from Integration module

You can see the configured CI/CD rules in the CI/CD Rules section of the Integration module.

Click on the Trigger icon for the rule using which you want to trigger a job in Jenkins.

The success message appears on the screen. Now check in the CI/CD tool in which the build has been triggered.

Trigger CI/CD Rule from Test Suites module

You can create and trigger CI/CD Rules from the Test Suites module as well. The details of CI/CD Rules will be displayed in the Change Logs tab of the test suite.

When a build is triggered from the test suite, all the actions related to it are captured in the Change Logs. It helps testers track which CI/CD Rule was triggered from particular which test suite.

Steps:

1. Go to the Test Suites module.

2. Open the test suite detail page.

3. Click on the Trigger CI/CD Rule button at the top of the screen.

The Select CI/CD Rule panel opens.

If the CI/CD Rule is not configured from the Integration module:

If you do not have the CI/CD Rule configured in the Integration module of QTM, and you click on the Trigger CI/CD Rule from the test case detail page, the Select CI/CD Rule panel opens blank without any records of CI/CD Rule on it. You can create CI/CD Rules from the Test Suites module.

Create a CI/CD Rule from Test Suites module

Steps:

1. Go to the Test Suites module.

2. Open the test suite details page.

3. Click on the Trigger CI/CD Rule button at the top of the screen.

The Select CI/CD Rule screen opens.

To create a new rule from the Test Suites module, click on the New button.

The New Rule screen opens.

Perform the same steps described in Create a New Rule in QTM for creating a new CI/CD Rule.

Once the rule is added, it is displayed on the Select Rule screen.

The same CI/CD Rule also reflects in the Integration module.

Once the CI/CD Rules are created either in the Integration module or in the Test Suites module, you can view the summary of the configured rule on the screen.

Click on the Key to view more configuration details for the rule.

The configuration details for the rule are displayed on the screen.

You can also make the required changes in the configuration from this screen.

Any changes done in the CI/CD rule configuration here in the Test Suites module will be synced in the Integration module as well.

Follow the steps mentioned below to link the CI/CD Rule with a test suite.

1. Go to the Test Suites module.

2. Open the test suite details page.

3. Click on the Trigger CI/CD Rule button at the top of the screen.

The Select CI/CD Rule panel opens with the list of rules on it.

4. Select the CI/CD Rule that you want to link with the current test suite. You can also apply a filter to search for a particular rule.

The linked CI/CD Rule starts displaying on the test suite details page at the top.

Trigger CI/CD Rule from Test Suite

To trigger the CI/CD rule, click on the rule linked with the test suite.

The CI/CD Rule name gets replaced with the Success label for a while.

Trigger CI/CD Rule from Test Suite List View

Once linked with the test suite, you can also trigger the CI/CD Rule for the test suite from the list view of the Test Suites module.

Edit CI/CD Rule from Test Suite

You can edit the rule configuration details by clicking on the Edit icon for the linked CI/CD Rule on the test suite detail page. Any changes done in the CI/CD Rule configuration here in the Test Suites module will be synced in the Integration module as well.

To unlink the linked CI/CD Rule, click on the Unlink icon (X) for the Rule on the test suite detail page.

Change Logs in Test Suite

When a build is triggered from the test suite, all the actions related to it are captured in the Change Logs. It helps testers track which CI/CD Rule was triggered from particular which test suite.

Open the test suite detail page and open the Change Logs tab.

The Change Logs tab displays all the actions carried out for the CI/CD Rules linked with the current test suite.

View Details and History

Once the CI/CD Rule is configured, it displays in the CI/CD Rules section of the Integration module.

To view more details about the rule, click on the Key of CI/CD Rule on the screen.

The next screen opens with two tabs on it: Detail and History.

→ Detail Tab:

The Detail tab shows configuration details for that CI/CD Rule. You can also edit/delete details from the screen.

 

→ History Tab:

The History tab shows the audit logs for the actions performed on the CI/C Rule in the Integration module as well as in all the test suites with which the rule is linked. The details include Actor, Action, Field, Entity ID, Old Value, New Value, and Date.

When a build is triggered from the test suite, all the actions related to it are also captured in the History tab. It helps testers track which CI/CD Rule was triggered from particular which test suite.

Disable a CI/CD Rule

You can disable the active CI/CD Rule from the Integration module. Once the rule is disabled, it can not be used to trigger a build to the CI/CD tool from the Integration as well as the Test Suites module. When the rule is disabled, the Trigger icon will be disabled in the Integration module. In the Test Suites module, the disabled rule will not be shown on the Select Rule screen to link with the test suite.

Steps:

1. Go to the Integration module.

2. Open the CI/CD Rules section.

3. Turn the Status inactive for the rule that you want to disable.

The CI/CD Rule turns disabled/inactive.

Edit CI/CD Rule from CI/CD Section

You can edit a CI/CD Rule from the Integration module.

Steps:

1. Go to the Integration module.

2. Open the CI/CD Rules section.

3. Click on the config icon and select Edit for the rule that you want to edit.

The details page opens. Make the required changes and click on the Update button.

Delete a CI/CD Rule

You can delete a CI/CD Rule from the Integration module. If the rule is linked with any of the test suites, then all the references with the associated test suite will be removed upon the deletion of the rule.

Steps:

1. Go to the Integration module.

2. Open the CI/CD Rules section.

3. Click on the config icon and select Delete for the rule that you want to delete.

The confirmation message pops up.

4. Click Yes to proceed.

 

Refer to the following pages for details on the configuration of the CI/CD tools.