Index: shared/scripts/configuration/utility.py =================================================================== diff -u -r03b5230f7cecbb728de9357e4582cf381b24cba2 -ra4f1e264727015d92baa065dde52c33c0bc33ef3 --- shared/scripts/configuration/utility.py (.../utility.py) (revision 03b5230f7cecbb728de9357e4582cf381b24cba2) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision a4f1e264727015d92baa065dde52c33c0bc33ef3) @@ -172,8 +172,7 @@ squish.mouseWheel(ScreenObj, (screenWidth-100), -(screenHeight-700), 0, 200, squish.Qt.NoModifier) - raise LookupError("zone object is not in view to the user after " + \ - "trying 100 times") + raise LookupError("zone object is not in view to the user after trying 100 times") def get_alarm_id_obj(id): names.o_alarm_id["text"] = id @@ -185,9 +184,47 @@ def rejection_msg(text): names.o_rejection_msg["text"] = text - return names.o_rejection_msg + return names.o_rejection_msg + + +def verify_page_step_indicator(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 + """ + 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, 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, 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.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,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,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() + #Methods for create custom treatment def set_venous_ranges_min_val(ven_low): """ @@ -556,8 +593,7 @@ test.compare(actual_time, expected_time, "Actual count down time: {} should be equal to expected count down time {}".format(actual_time, expected_time)) verify_the_progress(count_down, screen_title) test.endSection() - - + def verify_the_progress(count_down, screen_title): """ Method to verify the current progress @@ -630,7 +666,7 @@ 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 @@ -662,7 +698,7 @@ elif (entry >= config.HEART_RATE_LOWER_LIMIT) and (entry <= config.HEART_RATE_UPPER_LIMIT): test.compare(input_field_color, config.IN_RANGE_COLOR, "Heart Rate value {} is in range of {} and {}".format(entry, config.HEART_RATE_LOWER_LIMIT, config.HEART_RATE_UPPER_LIMIT)) test.endSection() - + def get_bullet_object(screen_obj, num): """ To obtain a bullet object based on occurrence provided. @@ -715,4 +751,3 @@ test.compare(str(input_field.text), "", "Input field should be empty") test.endSection() - \ No newline at end of file