Index: shared/scripts/configuration/utility.py =================================================================== diff -u -rad324b2834285a29c4458b100317f76eaf64fc6a -rffac0e32dc6aa9b664f983291d6241170e4b740b --- shared/scripts/configuration/utility.py (.../utility.py) (revision ad324b2834285a29c4458b100317f76eaf64fc6a) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision ffac0e32dc6aa9b664f983291d6241170e4b740b) @@ -18,7 +18,32 @@ import squish from configuration import config from builtins import int as pyInt -from cgitb import text + + +def scroll_to_zone(zone=None, screen_object=None): + """ + scroll to the numeric if object is hidden + @param zone - UI object + @param screen_object - UI object (UI Home screen = waveforms + numerics) + @return boolean true/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.waitForObject(screen_object) + screenHeight = pyInt(ScreenObj.height) + screenWidth = pyInt(ScreenObj.width) + squish.mouseWheel(ScreenObj, screenWidth-1000, screenHeight-10, 0, -50, squish.Qt.NoModifier) + + raise LookupError("zone object is not in view to the user after trying 100 times") def check_if_object_is_within_the_container(obj=None, container=None): @@ -43,32 +68,4 @@ return True return False - - -def scroll_to_zone(zone=None, screen_object=None): - """ - scroll to the numeric if object is hidden - @param zone - UI object - @param screen_object - UI object (UI Home screen = waveforms + numerics) - @return boolean true/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.waitForObject(screen_object) - screenHeight = pyInt(ScreenObj.height) - screenWidth = pyInt(ScreenObj.width) - squish.mouseWheel(ScreenObj, screenWidth-1000, - screenHeight-10, 0, -50, squish.Qt.NoModifier) - - raise LookupError("zone object is not in view to the user after " + \ - "trying 100 times") - + \ No newline at end of file