Index: shared/scripts/configuration/utility.py =================================================================== diff -u -r62dc52916b959f1657b065a4c84a9e10d865f073 -r99a045c3d2fb4c017fe9132d13406830b9469308 --- shared/scripts/configuration/utility.py (.../utility.py) (revision 62dc52916b959f1657b065a4c84a9e10d865f073) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision 99a045c3d2fb4c017fe9132d13406830b9469308) @@ -50,7 +50,7 @@ names.o_text_object["text"] = txt return names.o_text_object - + def get_bullet_object(screen_obj, num): """ To obtain a bullet object based on occurrence provided. @@ -104,8 +104,24 @@ def pressure_pop_up_text_obj(text): names.o_pop_up_pressure_text_obj["text"] = text return names.o_pop_up_pressure_text_obj + return names.o_bullet_object +def verify_missing_object(object_to_check): + """ + Method to verify the given object is invisible or is not present on the screen + @param object_to_check: the object whose invisibility 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 pressure_text_obj(text): names.o_pressure_text_obj["text"] = text return names.o_pressure_text_obj @@ -544,57 +560,7 @@ test.compare(current_progress, expected_progress, "{} should be the current progress".format(expected_progress)) test.endSection() -def verify_page_step_indicator(screen_obj, treatment_step, treatment_screens): - """ - Method to verify the Page Step indicators [the object on top of the screen which indicates the steps passed, current, remained] - @param treatment_step : indicates the Current treatment step - """ - test.startSection("verification of page step indicators") - for page in range(len(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, treatment_screens[page])) - - #To verify the step indicators of the completed treatment screens - if page < 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, config.COMPLETE_COLOR) - test.compare(bullet_border_color,config.COMPLETE_COLOR) - test.compare(step_title.color.name,config.ENABLED_COLOR) - #To verify the step indicators of the current treatment screen - elif page == 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, config.CURRENT_COLOR) - test.compare(bullet_border_color, config.COMPLETE_COLOR) - test.compare(step_title.color.name, config.ENABLED_COLOR) - test.verify(step_title.font.bold) - #To verify the step indicators of the remaining 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, config.INCOMPLETE_COLOR) - test.compare(bullet_circle_color, config.CURRENT_COLOR) - test.compare(bullet_border_color, config.INCOMPLETE_COLOR) - test.endSection() - -def verify_missing_object(object_to_check): - """ - Method to verify the given object is invisible or is not present on the screen - @param object_to_check: the object whose invisibility 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 verify_color_of_entry(entry, vital_parameter, input_field): """ Method to verify the color of entry @@ -912,3 +878,32 @@ except: test.fail("log file is not created during application interaction") return False + + +def verify_bullet_navigation(num, num_of_instructions, screen_obj): + """ + Method to verify status of bullets based + on number of instruction screen + @param num - (int) number of indicator + @param num_of_instructions- (int) count the number of instructions + @param object - screen_obj - (str) Screen object + """ + test.startSection("instruction bullet verification for screens") + for instruction in range(1, num_of_instructions): + bullet_children = object.children(squish.waitForObjectExists(get_bullet_object(screen_obj,(0 + instruction) - 1))) + bullet_circle_color = bullet_children[0].color.name + bullet_border_color = bullet_children[0].border.color.name + if instruction <= num: + test.compare(bullet_circle_color, config.COMPLETE_COLOR) + test.compare(bullet_border_color,config.COMPLETE_COLOR) + test.log(str(instruction) + " Complete bullet") + else: + test.compare(bullet_circle_color, config.CURRENT_COLOR) + test.compare(bullet_border_color,config.INCOMPLETE_COLOR) + test.log(str(instruction) + " Incomplete bullet") + test.endSection() + +def rinseback_rejection_msg(text): + names.o_rinseback_rejection_msg["text"] = text + return names.o_rinseback_rejection_msg +