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.
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.
Callback Results
In case your callback was not performed for any reason, you can review the results by clicking Details icon under State column of the Execution Results report:
This will open a window where you can click the 3 dots next to Callback Results
-
By clicking on the link under Rest Connection, you will be directed to the Rest Connection you created where you specified your dynamic variable names.
-
By clicking on the link under Request, you will be directed to a window which shows what your Payload will look like after resolving the variable names.
-
By clicking on the Response link, you will be directed to a window which shows you the response of the server. This is mainly the window which will assist you in case your callback has failed and you can review what needs to be fixed.
Comments
Please sign in to leave a comment.