How to use Callback after a cloud execution

Introduction

In this quick read, I will show how you would take advantage of the callback mechanism in cloud executions. Once you have multiple tests to execute as a batch, you may want to notify or do something with the result. For example, you can post the results on a dashboard or add them to a JIRA ticket for everyone to see. 

 

Main Idea

Start a cloud execution, add comments to a JIRA ticket as the test execution is completed. As part of the comment, we will add all info regarding the test cases and the entire execution.

Possible levels for callbacks

Test Case Level: Upon completion of each test case ion the execution set.  For example, if you have an execution set with 4 test cases (t1, t2, t3, t4), as soon as each test case execution is complete, system will make a callback to the REST endpoint specified. 

Execution Level: Upon completion of the entire execution. The same example as above, however, in this case, the callback will be triggered after ALL tests are completed. 

mceclip0.png

 

Related Execution Data

For the execution level, here are the dynamic variables that can be used in the Rest Connection callback:

 

@execution_passed_on_retry

@execution_build

@execution_state

@execution_pending

@execution_failed

@execution_total

@pass_rate

@execution_result

@execution_set_id

@execution_id

@execution_set_name

 

For test case level, here are the dynamic variables that can be used in the Rest Connection callback:

 

@test_case_name

@test_case_suite_name

@test_case_execution_id

@test_case_description

@test_case_execution_start_timestamp

@test_case_execution_end_timestamp

@test_case_execution_video_url

@test_case_execution_image_url

@test_case_execution_log_url

@test_case_execution_status

@test_case_execution_duration

@test_case_execution_actual_duration

@test_case_execution_start_date_time

@test_case_execution_end_date_time

@test_case_execution_failed_messages

@test_case_execution_defect_tracking_id

 

For example, if you have a Rest Connection called add_comment_to_jira_for_test_case, in the body of the rest connection you can reference the above variables. 

 

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

Please sign in to leave a comment.