Index: shared/scripts/configuration/utility.py =================================================================== diff -u -reabfecc1d8d205f4b8888b99158c54f5ac92ae4e -r60d8b127c065d5994cc07e0f22271ef13a2e51a2 --- shared/scripts/configuration/utility.py (.../utility.py) (revision eabfecc1d8d205f4b8888b99158c54f5ac92ae4e) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision 60d8b127c065d5994cc07e0f22271ef13a2e51a2) @@ -12,8 +12,9 @@ # ############################################################################ - import names +import sys +import test import squish import test @@ -22,7 +23,7 @@ from datetime import datetime from dialin.ui.hd_simulator import HDSimulator from builtins import int as pyInt -#from builtins import float as pyFloat +from builtins import float as pyFloat hd = HDSimulator() @@ -83,10 +84,11 @@ ScreenObj = squish.waitForObject(screen_object) screenHeight = pyInt(ScreenObj.height) screenWidth = pyInt(ScreenObj.width) - squish.mouseWheel(ScreenObj, screenWidth-1000, - screenHeight-10, 0, -50, Qt.NoModifier) + squish.mouseWheel(ScreenObj, screenWidth//2, + screenHeight//2, 0, -50, squish.Qt.NoModifier) - raise LookupError("zone object is not in view to the user after trying 100 times") + raise LookupError("value object is not in view to the user after " + \ + "trying 100 times") def pressure_pop_up_text_obj(text): @@ -141,31 +143,35 @@ return names.o_keypad_input -def scroll_to_value_on_pop_up(value=None, container=None): +def scroll_to_zone(zone=None, screen_object=None, direction = None): """ - scroll to the to the value if object is hidden - @param value - value object - @param container - Container of the value - @return boolean true and false + scroll to the UI, if object is hidden + @param zone - object to be find out. + @param screen_object - object of the screen. + @return boolean """ counter = 0 while counter <= 100: try: counter += 1 - squish.findObject(value) + squish.findObject(zone) squish.snooze(0.5) - if check_if_object_is_within_the_container(obj=value, container=container): + if check_if_object_is_within_the_container(obj=zone, container=screen_object): return True else: raise RuntimeError except RuntimeError: - ScreenObj = squish.waitForObject(container) + ScreenObj = squish.findObject(screen_object) 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 " + \ + 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_alarm_id_obj(id):