Adding additional properties in test results

When you want to add additional properties to be included in test results after the test is run, you can do so by configuring a webhook to receive the customized results and defining the parameters in HCL DevOps Test Hub (Test Hub).

Before you begin

You must have completed the following tasks:

About this task

You can set up webhooks to send notifications to various messaging apps such as Microsoft Teams or Slack, or to any application that can receive an HTTP POST request, whenever specific events happen on Test Hub. For instance, a webhook can be triggered when a test run fails. After the event, the payload that is received by the application contains the details of the event, including the additional parameters that are added. If you want the result events to be correlated when using systems such as DevOps Velocity, you must add the properties that are present in the webhook template as additional parameters in the Execute test asset window.

Procedure

  1. Navigate to your project in Test Hub.
    The Overview page of the project is displayed.
  2. Click Manage > Webhooks.
    The Templates tab is displayed.
  3. Click New Template.
    The New template page is displayed.
  4. Perform the following actions on the DETAILS tab.
    1. Enter a unique name for the template.
    2. Create a new channel type by clicking Create new channel type ... option.

      The New channel type dialog is displayed.

    3. Enter a unique name for the channel type, and then enter a description for the channel type.
  5. Click Apply.
    The channel type is created and added to the Channel Type list.
  6. Click This template is suitable for events and select the events from the Execution Events list.
  7. Click the Template tab.
  8. Click one of the following icons to select a predefined template sample in the Template body:
    • The infinity icon Measure template to insert a DevOps Velocity template
    • The cloud icon cloud templateto insert a cloud event JSON template
    • The Microsoft Teams icon Teams template to replace a template with a Microsoft Teams template
    • The Slack icon slack template to replace a template with a Slack template
    A message is displayed about the action that inserts a text in the template body.
  9. Click Ok.
  10. The text is inserted in the Template body.
  11. Click Apply.
    The template is created and added to the Templates tab.
  12. Click the Webhooks tab, and then click New Webhook.
    The New Webhook page is displayed.
  13. Enter a name for the webhook in the Name field.
  14. Enter the callback URL of the application or channel for which you are configuring a webhook in the Webhook URL field.
  15. Click the Channel Type, and then select the channel type that you just created from the list.
  16. Enter a description for the webhook in Description.
  17. Select the template that you just created from the drop-down list.
  18. Click Apply.
    The webhook is created and added to the Webhooks tab.
  19. Click Execution, in the navigation pane.
  20. Select the test that you want to run and click image of execute icon in the Actions column to open the Execute test asset window.
  21. Click Advanced settings.
  22. Enter a parameter name that starts with result.property in the first edit field under Additional Configuration Parameters.
    For example, result.property.test_version.
  23. Enter a value for the newly added parameter in the second edit field under Additional Configuration Parameters. For example, v1.5.14.
  24. Click Add for the added parameter.
    You can add multiple parameters.
  25. Click Execute.

Results

The additional parameter values are captured while your test is running. You can see the values in the response notification that you get for the webhook after the test run is complete.

What to do next

Navigate to the application or channel for which you have configured the webhook for receiving test result notifications, and then view the results.