Index: shared/scripts/configuration/config.py =================================================================== diff -u -rfd1d376554fc2c396d99e84975c2c8c0deab09c3 -r4c7da7b76580595a20681353543bc99573f94f69 --- shared/scripts/configuration/config.py (.../config.py) (revision fd1d376554fc2c396d99e84975c2c8c0deab09c3) +++ shared/scripts/configuration/config.py (.../config.py) (revision 4c7da7b76580595a20681353543bc99573f94f69) @@ -33,6 +33,20 @@ SALINE_UNIT = "mL" BLOOD_PRIMING_DEFAULT_VALUE = "0 mL" +#tst_pretreatment_screens +PRE_TREATMENT_SCREENS = ["Create" , "Sample" , "Consumables" , "Disposables" , "Prime" , "Ultrafiltration" , "BP/HR" , "Connection" , "Start"] + +#tst_pretreatment_screens color palettes +CURRENT_COLOR = '#000000' +COMPLETE_COLOR= '#4290ec' +ENABLED_COLOR = '#fcfcfc' +INCOMPLETE_COLOR = '#607a91' + +CONSUMABLE_SELF_TEST_TEXT = "Consumables Self Test" +BICARB_PUMP_CHECK_TEXT = "BiCarb Pump Check" +ACID_PUMP_CHECK_TEXT = "Acid Pump Check" +SELF_TEST_COMPLETE_TEXT = "Self Test Complete!" + #pre-treatment_priming NOT_VISIBLE = False VISIBLE = True @@ -48,3 +62,5 @@ MINIMUM_COUNTDOWN_TIME = 0 ENABLED = True DISABLED = False + + Index: shared/scripts/configuration/utility.py =================================================================== diff -u -r28e268fdcfd271ac31cd03f9e2d496ff87989dd9 -r4c7da7b76580595a20681353543bc99573f94f69 --- shared/scripts/configuration/utility.py (.../utility.py) (revision 28e268fdcfd271ac31cd03f9e2d496ff87989dd9) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision 4c7da7b76580595a20681353543bc99573f94f69) @@ -158,4 +158,65 @@ #Since progress value is equal maximum count down value - current count down value expected_progress = MAXIMUM_COUNTDOWN_TIME - count_down test.compare(current_progress, expected_progress, "{} should be the current progress".format(expected_progress)) - test.endSection() \ No newline at end of file + test.endSection() + + +def page_step_indicator_verification(screen_obj, pre_treatment_step): + """ + Method to verify the Page Step indicators [the object on top of the screen which indicates the steps passed, current, remained] + @param pre_treatment_step : indicates the Current pre-treatment step + """ + + for page in range(len(PRE_TREATMENT_SCREENS)): + bullet_children = object.children(squish.waitForObjectExists(get_bullet_object(screen_obj, page))) + bullet_circle_color = bullet_children[0].color.name + bullet_border_color = bullet_children[0].border.color.name + step_title = squish.waitForObjectExists(get_text_object(screen_obj, PRE_TREATMENT_SCREENS[page])) + #To verify the step indicators of the completed pre treatment screens + if page < pre_treatment_step: + test.verify(squish.waitForObjectExists(get_bullet_object(screen_obj, page)).complete) + test.verify(not squish.waitForObjectExists(get_bullet_object(screen_obj, page)).current) + test.compare(bullet_circle_color, COMPLETE_COLOR) + test.compare(bullet_border_color, COMPLETE_COLOR) + test.compare(step_title.color.name, ENABLED_COLOR) + #To verify the step indicators of the current pre treatment screen + elif page == pre_treatment_step: + test.verify(squish.waitForObjectExists(get_bullet_object(screen_obj, page)).current,) + test.verify(not squish.waitForObjectExists(get_bullet_object(screen_obj, page)).complete) + test.compare(bullet_circle_color, CURRENT_COLOR) + test.compare(bullet_border_color, COMPLETE_COLOR) + test.compare(step_title.color.name, ENABLED_COLOR) + test.verify(step_title.font.bold) + #To verify the step indicators of the remaining pre-treatment screens + else: + test.verify(not squish.waitForObjectExists(get_bullet_object(screen_obj, page)).current,) + test.verify(not squish.waitForObjectExists(get_bullet_object(screen_obj, page)).complete,) + test.compare(step_title.color.name, INCOMPLETE_COLOR) + test.compare(bullet_circle_color, CURRENT_COLOR) + test.compare(bullet_border_color, INCOMPLETE_COLOR) + + +def verification_of_missing_object(object_to_check): + """ To verify the given object is invisible or is not present on the screen + @param object_to_check: the object whose invisbility must be verified + """ + try: + squish.testSettings.objectNotFoundDebugging = False + squish.waitForObject(object_to_check,3000) + test.fail("Given object should not be present initially") + except LookupError as _: + test.passes("object is not present as expected") + + squish.testSettings.objectNotFoundDebugging = True + + +def get_text_object(screen_obj, txt): + names.o_text_object["container"] = screen_obj + names.o_text_object["text"] = txt + return names.o_text_object + + +def get_bullet_object(screen_obj, num): + names.o_bullet_object["container"] = screen_obj + names.o_bullet_object["occurrence"] = num + 1 + return names.o_bullet_object Index: shared/scripts/names.py =================================================================== diff -u -r413641e6ddad8b6dbedf22b9d2f40fa319dd1bc2 -r4c7da7b76580595a20681353543bc99573f94f69 --- shared/scripts/names.py (.../names.py) (revision 413641e6ddad8b6dbedf22b9d2f40fa319dd1bc2) +++ shared/scripts/names.py (.../names.py) (revision 4c7da7b76580595a20681353543bc99573f94f69) @@ -63,4 +63,7 @@ o_self_test_dry_progress_circle = {"container": o_PreTreatmentPrimeStack_PreTreatmentBase_TreatmentFlowBase, "id": "_progressCircle", "type": "ProgressCircle", "unnamed": 1, "visible": True} #start prime button and continue button o_start_prime_btn = {"container": o_PreTreatmentPrimeStack_PreTreatmentBase_TreatmentFlowBase, "text": "Start Prime", "type": "Text", "unnamed": 1, "visible": True} -o_continue_btn = {"container": o_PreTreatmentPrimeStack_PreTreatmentBase_TreatmentFlowBase, "text": "CONTINUE", "type": "Text", "unnamed": 1, "visible": True} \ No newline at end of file +o_continue_btn = {"container": o_PreTreatmentPrimeStack_PreTreatmentBase_TreatmentFlowBase, "text": "CONTINUE", "type": "Text", "unnamed": 1, "visible": True} +#text and bullet object +o_text_object = {"type": "Text", "unnamed": 1, "visible": True} +o_bullet_object = {"type": "StepBullet", "unnamed": 1, "visible": True} \ No newline at end of file Index: tst_pre_treatment_priming/test.py =================================================================== diff -u -r923e0245388dc99d9e98a4b49f49df083cff88f9 -r4c7da7b76580595a20681353543bc99573f94f69 --- tst_pre_treatment_priming/test.py (.../test.py) (revision 923e0245388dc99d9e98a4b49f49df083cff88f9) +++ tst_pre_treatment_priming/test.py (.../test.py) (revision 4c7da7b76580595a20681353543bc99573f94f69) @@ -8,6 +8,7 @@ from dialin.ui.hd_simulator import HDSimulator hd_simulator = HDSimulator() +PRE_TREATMENT_STEP = 4 SELF_TEST_DRY_STATES = {"DRY_SELF_TESTS_STATE" : 0, "DRY_SELF_TESTS_WAIT_FOR_DOOR_CLOSE_STATE" : 1, "DRY_SELF_TESTS_USED_CARTIDGE_CHECK_STATE": 2, "DRY_SELF_TESTS_OCCLUSION_SENSORS_STATE": 3, @@ -37,6 +38,7 @@ navigate_to_pretreatment_screen(5) 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)) + page_step_indicator_verification(names.o_PreTreatmentStack_PreTreatmentPrimeStack_PreTreatmentPrimeStack, PRE_TREATMENT_STEP) test.endSection() @@ -50,6 +52,7 @@ navigate_to_pretreatment_screen(6) 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)) + page_step_indicator_verification(names.o_PreTreatmentStack_PreTreatmentPrimeStack_PreTreatmentPrimeStack, PRE_TREATMENT_STEP) test.endSection()