Index: shared/scripts/configuration/utility.py =================================================================== diff -u -r124b6d7ceaa73600e99e51c59ee1098564736db0 -racea999b214b759fa0749e8b026a5c4a5ebc931d --- shared/scripts/configuration/utility.py (.../utility.py) (revision 124b6d7ceaa73600e99e51c59ee1098564736db0) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision acea999b214b759fa0749e8b026a5c4a5ebc931d) @@ -16,7 +16,6 @@ import names -import sys import squish import test @@ -29,44 +28,6 @@ from builtins import str as pyStr from builtins import float as pyFloat - -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): """ @@ -76,12 +37,12 @@ @return boolean true and false """ container = squish.findObject(container) - containerPos = container.mapToGlobal(QPoint(0, 0)) + 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(QPoint(0, 0)) + 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) @@ -115,8 +76,7 @@ squish.mouseWheel(ScreenObj, screenWidth-1000, screenHeight-10, 0, -50, Qt.NoModifier) - raise LookupError("zone object is not in view to the user after " + \ - "trying 100 times") + raise LookupError("zone object is not in view to the user after trying 100 times") def pressure_pop_up_text_obj(text):