Index: tst_pre_treatment_priming/test.py =================================================================== diff -u -r40cfd285729c8aefd9c66f78d70ada6078951013 -r5fc2cf1333ef13de0a5b547e8b029f664b263941 --- tst_pre_treatment_priming/test.py (.../test.py) (revision 40cfd285729c8aefd9c66f78d70ada6078951013) +++ tst_pre_treatment_priming/test.py (.../test.py) (revision 5fc2cf1333ef13de0a5b547e8b029f664b263941) @@ -22,7 +22,7 @@ """ test.startSection("Navigating to self test dry screen and verify the 'Begin Prime' title is displayed") navigate_to_pretreatment_screen(mode=5) - title = (waitForObject(names.o_begin_prime_text)).text + title = (waitForObjectExists(self_test_dry_check_list_text(BEGIN_PRIME_TITLE))).text test.compare(title, BEGIN_PRIME_TITLE, "{} title should be displayed when user is navigating to self test dry screen".format(BEGIN_PRIME_TITLE)) test.endSection() @@ -35,18 +35,18 @@ """ test.startSection("Navigating to priming screen and verify the begin 'Priming' title is displayed") navigate_to_pretreatment_screen(mode=6) - title = (waitForObject(names.o_begin_prime_text)).text - test.compare(title, BEGIN_PRIME_TITLE, "{} title should be displayed when user is navigating to 'Priming' screen".format(BEGIN_PRIME_TITLE)) + title = (waitForObject(self_test_dry_check_list_text(PRIMING_TITLE))).text + test.compare(title, PRIMING_TITLE, "{} title should be displayed when user is navigating to 'Priming' screen".format(PRIMING_TITLE)) test.endSection() -def get_time(): +def get_time(screen_title): """ - Method to return the current priming - time in the application - @return time_text - (str) current time in the application + Method to return the current count down + in the application + @return time_text - (str) count down in the application """ - parent_object = object.parent(waitForObjectExists(names.o_begin_prime_text)) + parent_object = object.parent(waitForObjectExists(self_test_dry_check_list_text(screen_title))) time_parent_children = object.children(parent_object) progress_circle_parent = time_parent_children[4] progress_circle_parent = object.children(progress_circle_parent) @@ -57,16 +57,19 @@ return time_text.time -def verify_the_countdown_in_self_test_dry_screen(): +def verify_the_countdown(screen_title): """ Method to verify the count down time in application """ test.startSection("Verify the count down time in application") for count_down in range(MINIMUM_COUNTDOWN_TIME, MAXIMUM_COUNTDOWN_TIME+1): - hd_simulator.cmd_send_pre_treatment_self_test_dry_progress_data(total=300, countdown=count_down) + if screen_title == BEGIN_PRIME_TITLE: + hd_simulator.cmd_send_pre_treatment_self_test_dry_progress_data(total=300, countdown=count_down) + else: + hd_simulator.cmd_send_pre_treatment_disposables_prime_progress_data(timeout=300, countdown=count_down) + actual_time = get_time(screen_title) expected_time = convert_seconds_into_min_and_sec(count_down) - actual_time = get_time() if count_down > MAXIMUM_COUNTDOWN_TIME or count_down < MINIMUM_COUNTDOWN_TIME: test.xcompare(actual_time, expected_time, "{} should not display on progress circle".format(expected_time)) else: @@ -92,9 +95,10 @@ startApplication(AUT_NAME) navigate_self_test_dry_screen() - verify_the_countdown_in_self_test_dry_screen() + verify_the_countdown(BEGIN_PRIME_TITLE) navigate_to_priming_screen() + verify_the_countdown(PRIMING_TITLE) snooze(20) # hd_simulator.cmd_send_pre_treatment_disposables_prime_progress_data(self, timeout: int, countdown: int)