Index: shared/scripts/configuration/utility.py =================================================================== diff -u -r568e97ea04d6b8bd977bf3533980a42b26ec951e -r90872d7586fbd455104384dddf0d81a7ce7c88bc --- shared/scripts/configuration/utility.py (.../utility.py) (revision 568e97ea04d6b8bd977bf3533980a42b26ec951e) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision 90872d7586fbd455104384dddf0d81a7ce7c88bc) @@ -109,9 +109,9 @@ -def scroll_to_zone(zone=None, screen_object=None, screen="Main"): +def scroll_to_zone(zone=None, screen_object=None): """ - scroll to the numeric if object is hidden + scroll to the zone if object is hidden Arguments: zone - UI object screen_object - UI object @@ -132,13 +132,39 @@ ScreenObj = squish.waitForObject(screen_object) screenHeight = pyInt(ScreenObj.height) screenWidth = pyInt(ScreenObj.width) - if screen == "pop up": - squish.mouseWheel(ScreenObj, screenWidth-1250, - screenHeight-50, 0, -10, squish.Qt.NoModifier) - else: - squish.mouseWheel(ScreenObj, screenWidth-1000, - screenHeight-10, 0, -50, squish.Qt.NoModifier) + 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 scroll_to_value_on_pop_up(value=None, container=None): + """ + scroll to the to the value if object is hidden + Arguments: + value - value object + container - Container of the value + Return: + bool + """ + 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") \ No newline at end of file