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