Index: shared/scripts/configuration/utility.py =================================================================== diff -u -r571936f8ececab602e4b5cecc030d2571d62f5a4 -r454470a94a58be24a6fcec1263ee4af64f51a2d5 --- shared/scripts/configuration/utility.py (.../utility.py) (revision 571936f8ececab602e4b5cecc030d2571d62f5a4) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision 454470a94a58be24a6fcec1263ee4af64f51a2d5) @@ -26,25 +26,41 @@ from datetime import datetime from dialin.ui import utils -def convert_seconds_into_min_and_sec(seconds): - min = time.strftime("%M", time.gmtime(seconds)) - sec = time.strftime("%S", time.gmtime(seconds)) - return min,sec - -def get_indicators(screen_obj, txt): + +def verify_bullet_navigation(num, num_of_instructions, screen_obj): """ - Verifying the busy indicators for BiCarb Pump Check and Acid Pump Check. - indicator object of expected text - @param step - (str) expected text - @return indicators - (obj) list of busy and check indicator + 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 """ - 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 - squish.testSettings.objectNotFoundDebugging = True - + 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 convert_seconds_into_min_and_sec(seconds, time_format="%M:%S"): + """ + Method to convert seconds into minute format. + @param seconds - time in seconds. + @param time_format (str) - time format. + @return (int) - minute time + """ + seconds = int(seconds) + min_and_sec = time.strftime(time_format, time.gmtime(seconds)) + return min_and_sec + def verify_missing_object(object_to_check): """ Method to verify the given object is invisible or is not present on the screen @@ -73,5 +89,3 @@ def recirculate_rejection_msg(text): names.o_recirculate_rejection_msg["text"] = text return names.o_recirculate_rejection_msg - -