Index: shared/scripts/configuration/utility.py =================================================================== diff -u -r4c7da7b76580595a20681353543bc99573f94f69 -r2a19cd281aed2c1f5ff192e1d147a35ba571ccc6 --- shared/scripts/configuration/utility.py (.../utility.py) (revision 4c7da7b76580595a20681353543bc99573f94f69) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision 2a19cd281aed2c1f5ff192e1d147a35ba571ccc6) @@ -18,6 +18,7 @@ import test import squish from configuration.config import * +from configuration import config from builtins import int as pyInt from dialin.ui.hd_simulator import HDSimulator @@ -167,56 +168,70 @@ @param pre_treatment_step : indicates the Current pre-treatment step """ - for page in range(len(PRE_TREATMENT_SCREENS)): + test.startSection("verification of page step indicators") + for page in range(len(config.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 + step_title = squish.waitForObjectExists(get_text_object(screen_obj, config.PRE_TREATMENT_SCREENS[page])) + if page < pre_treatment_step: + test.log("To verify the step indicator of the completed pre-treatment screen " + config.PRE_TREATMENT_SCREENS[page]) 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 + test.compare(bullet_circle_color, config.COMPLETE_COLOR, " the bullet color must be " + str(config.COMPLETE_COLOR)) + test.compare(bullet_border_color, config.COMPLETE_COLOR," the bullet border color must be " + str(config.COMPLETE_COLOR)) + test.compare(step_title.color.name, config.ENABLED_COLOR, " the text color must be " + str(config.ENABLED_COLOR)) + elif page == pre_treatment_step: - test.verify(squish.waitForObjectExists(get_bullet_object(screen_obj, page)).current,) + test.log("To verify the step indicators of the current pre-treatment screen " + config.PRE_TREATMENT_SCREENS[page]) + 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 + test.compare(bullet_circle_color,config.CURRENT_COLOR," the bullet color must be " + str(config.CURRENT_COLOR)) + test.compare(bullet_border_color,config.COMPLETE_COLOR, " the bullet border color must be " + str(config.COMPLETE_COLOR)) + test.compare(step_title.color.name,config.ENABLED_COLOR, " the text color must be " + str(config.ENABLED_COLOR)) + test.verify(step_title.font.bold, " the current text must be in bold") + else: + test.log("To verify the step indicators of the remaining pre-treatment screen " + config.PRE_TREATMENT_SCREENS[page]) 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 + test.compare(step_title.color.name,config.INCOMPLETE_COLOR, " the text color must be " + str(config.INCOMPLETE_COLOR)) + test.compare(bullet_circle_color,config.CURRENT_COLOR," the bullet color must be " + str(config.CURRENT_COLOR)) + test.compare(bullet_border_color,config.INCOMPLETE_COLOR, " the bullet border color must be " + str(config.INCOMPLETE_COLOR)) + test.endSection() - def get_text_object(screen_obj, txt): + """ + To obtain a text object based on text provided + @param screen_obj: provides the container on which the txt must be present + @returns a real name object + """ 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): +def get_bullet_object(screen_obj, num): + """ + To obtain a bullet object based on occurrence provided. + @param screen_obj: provides the container on which the bullet must be present + @param num: provides the occurrence value + @returns a real name object + """ names.o_bullet_object["container"] = screen_obj names.o_bullet_object["occurrence"] = num + 1 return names.o_bullet_object + +def get_indicators(screen_obj, txt): + """ + Verifying the busy indicators for BiCarb Pump Check and Acid Pump Check. + indicator object of expected txt + @param step - (str) expected txt + @return indicators - (obj) list of busy and check indicator + """ + parent_obj = object.parent(squish.waitForObjectExists(get_text_object(screen_obj,txt))) + children_obj = object.children(parent_obj) + indicator_parent = children_obj[2] + indicators = object.children(indicator_parent) + return indicators