Index: shared/scripts/configuration/utility.py =================================================================== diff -u -r90872d7586fbd455104384dddf0d81a7ce7c88bc -r0c2ceabc7a0a2270006f1a210be811658d849c4c --- shared/scripts/configuration/utility.py (.../utility.py) (revision 90872d7586fbd455104384dddf0d81a7ce7c88bc) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision 0c2ceabc7a0a2270006f1a210be811658d849c4c) @@ -14,8 +14,7 @@ # ############################################################################ -import object -import names + import sys import squish import test @@ -25,9 +24,8 @@ from builtins import int as pyInt from configuration import config from dialin.ui.hd_simulator import HDSimulator -#from builtins import str as pyStr -#from builtins import float as pyFloat + hd = HDSimulator() @@ -46,7 +44,7 @@ try: counter += 1 test.log("Starting {}".format(app_name)) - squish.startApplication(config.Application_name) + squish.startApplication(app_name) if counter == 1: test.log(f"Application launched at the {counter}'st try.") elif counter == 2: @@ -55,7 +53,6 @@ test.log(f"Application launched at the {counter}'rd try.") else: test.log(f"Application launched at the {counter}'th try.") - squish.snooze(20) break except RuntimeError: if counter == 1: @@ -66,30 +63,17 @@ else: test.log(f"Application failed to launch after {counter} tries - Please refer logs") except: - logErrorDetails("Failed to start the application") + test.log("Failed to start the application") sys.exit(1) - -def color_verification(exp_val = "Red", act_val = "#c53b33"): - """ - Function to verify item color verification - Argument: - exp_val - Expected required value - act_val - Color displayed on UI - Return: - handle the application for log - """ - test.compare(config.COLOR_CODES[color_name],(act_val.color[name])) - - + + def check_if_object_is_within_the_container(obj=None, container=None): """ check if an object is inside a container - Arguments: - obj - child UI object - container - container UI object - Return: - bool + @param obj - child UI object + @param container - container UI object + @return boolean true and false """ container = squish.findObject(container) containerPos = container.mapToGlobal(squish.QPoint(0, 0)) @@ -107,16 +91,13 @@ return False - - + def scroll_to_zone(zone=None, screen_object=None): """ scroll to the zone if object is hidden - Arguments: - zone - UI object - screen_object - UI object - Return: - bool + @param zone - UI object + @param screen_object - UI object + @return boolean true and false """ counter = 0 while counter <= 100: @@ -142,11 +123,9 @@ 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 + @param value - value object + @param container - Container of the value + @return boolean true and false """ counter = 0 while counter <= 100: