Index: shared/scripts/configuration/utility.py =================================================================== diff -u -r6a14a242667488bea0e14dc9faf7655b880faed6 -r6d7bc081f5573e6653fa1fa50a28d9acffe0b7af --- shared/scripts/configuration/utility.py (.../utility.py) (revision 6a14a242667488bea0e14dc9faf7655b880faed6) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision 6d7bc081f5573e6653fa1fa50a28d9acffe0b7af) @@ -20,7 +20,6 @@ import squish from dialin.ui.hd_simulator import HDSimulator from builtins import int as pyInt -from builtins import int as pyInt from builtins import format from datetime import datetime from dialin.common.msg_ids import MsgIds @@ -29,68 +28,7 @@ LOG_LOCATION = "/home/denali/Desktop/sd-card/log/*.log" -def start_application(app_name): - """ - Function to start application and verify application status [running] - If application does not start or running status is false, test stops - Argument: - @param app_name : (str) - Name of the application - @param app_executable : (str) - Actual application - @return: handle for the application if the application is in running state, - or error (exist the application) - """ - counter = 0 - while True: - try: - counter += 1 - test.log("Starting {}".format(app_name)) - squish.startApplication(app_name) - if counter == 1: - test.log("Application launched at the "+str(counter)+" st try.") - elif counter == 2: - test.log("Application launched at the "+str(counter)+" nd try.") - elif counter == 3: - test.log("Application launched at the "+str(counter)+" rd try.") - else: - test.log("Application launched at the "+str(counter)+" th try.") - break - except RuntimeError: - if counter == 1: - test.log("Application failed to launch after "+str(counter)+" try - Please refer logs") - elif counter == 20: - test.log("Exiting after "+str(counter)+ " tries..") - sys.exit(1) - else: - test.log("Application failed to launch after "+str(counter)+ " tries - Please refer logs") - except: - logErrorDetails("Failed to start the application") - sys.exit(1) - -def check_if_object_is_within_the_container(obj=None, container=None): - """ - check if an object is inside a container - @param obj - child UI object - @param container - container UI object - @return boolean true/false - """ - container = squish.findObject(container) - containerPos = container.mapToGlobal(squish.QPoint(0, 0)) - container_x, container_y = pyInt(containerPos.x), pyInt(containerPos.y) - container_width, container_height = pyInt(container.width), pyInt(container.height) - - obj = squish.findObject(obj) - objPos = obj.mapToGlobal(squish.QPoint(0, 0)) - obj_x, obj_y = pyInt(objPos.x), pyInt(objPos.y) - obj_width, obj_height = pyInt(obj.width), pyInt(obj.height) - - if obj_x >= container_x and obj_y >= container_y: - if (obj_x + obj_width) <= (container_x + container_width) and (obj_y + obj_height) <= (container_y + container_height): - return True - - return False - - def scroll_to_zone(zone=None, screen_object=None): """ scroll to the numeric if object is hidden