Index: shared/scripts/configuration/utility.py =================================================================== diff -u -r6052b7abfc1d50f6c952a4e12a9bc86c2c5f6e04 -rec030048aba5448c47452fd83339b52b0f13d172 --- shared/scripts/configuration/utility.py (.../utility.py) (revision 6052b7abfc1d50f6c952a4e12a9bc86c2c5f6e04) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision ec030048aba5448c47452fd83339b52b0f13d172) @@ -101,6 +101,30 @@ return False +def scroll_to_value_on_pop_up(value=None, container=None): + """ + scroll to the to the value if object is hidden + @param value - (obj) value object + @param container - (obj) Container of the value + @return boolean true and false + """ + counter = 0 + while counter <= 100: + try: + counter += 1 + squish.findObject(value) + squish.snooze(0.5) + if check_if_object_is_within_the_container(obj=value, container=container): + return True + else: + raise RuntimeError + except RuntimeError: + ScreenObj = squish.waitForObject(container) + screenHeight = pyInt(ScreenObj.height) + screenWidth = pyInt(ScreenObj.width) + squish.mouseWheel(ScreenObj, screenWidth//2, screenHeight//2, 0, -50, squish.Qt.NoModifier) + raise LookupError("value object is not in view to the user after trying 100 times") + def pressure_pop_up_text_obj(text): names.o_pop_up_pressure_text_obj["text"] = text return names.o_pop_up_pressure_text_obj @@ -172,35 +196,7 @@ names.o_vitals_reading["text"] = reading return names.o_vitals_reading - -def scroll_to_zone(zone=None, screen_object=None, direction = None): - """ - scroll to the zone if object is hidden - @param zone - (obj) UI object - @param screen_object - (obj) UI object - @return boolean true and false - """ - counter = 0 - while counter <= 100: - try: - counter += 1 - squish.findObject(zone) - squish.snooze(0.5) - if check_if_object_is_within_the_container(obj=zone, container=screen_object): - return True - else: - raise RuntimeError - except RuntimeError: - ScreenObj = squish.findObject(screen_object) - screenHeight = pyInt(ScreenObj.height) - screenWidth = pyInt(ScreenObj.width) - if direction is None: - squish.mouseWheel(ScreenObj, (screenWidth-100), 107, 0, -(screenHeight-460), squish.Qt.NoModifier) - else: - 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") - + def get_current_date_and_time(date_format='%Y/%b/%d - %H:%M'): date = datetime.now() @@ -1069,3 +1065,4 @@ return names.o_recirculate_rejection_msg +