Index: suite_leahi/shared/scripts/configuration/utility.py =================================================================== diff -u -rc7d96b722594bb29a7bbc3689715b90af6e3d616 -r8f9df8e70510cbd35fcefa54812b16bf0ee0e3ff --- suite_leahi/shared/scripts/configuration/utility.py (.../utility.py) (revision c7d96b722594bb29a7bbc3689715b90af6e3d616) +++ suite_leahi/shared/scripts/configuration/utility.py (.../utility.py) (revision 8f9df8e70510cbd35fcefa54812b16bf0ee0e3ff) @@ -9,6 +9,14 @@ td =TD_Messaging() from leahi_dialin.ui import utils from builtins import int as pyInt + +def aut(*args): + """ + Joins the executable name and argument + into a single command string + """ + return " ".join(('leahi', *args)) + def get_object_from_names(names_dict, error_message = "Missing object", timeout_ms = 200): """ @@ -190,10 +198,6 @@ return results - - - - def set_value_with_slider(value_field_obj, slider_obj,parameter): """ Opens the slider and moves it gradually to the target value (step of 10). @@ -277,4 +281,19 @@ return squish.waitForObject(names_dict, timeout_ms).text except LookupError: test.fail("ERROR : " + error_message) - return None \ No newline at end of file + return None +def findAllObjectsByText(parent, target_text): + """ + Recursively finds all child objects that have a 'text' property + """ + matching the target_text. Returns a list of matches. + results = [] + # Use hasattr to safely check for 'text' property before comparing + results.append(parent) + if hasattr(parent, 'text') and str(parent.text) == target_text: + + # Recurse through all children + for child in object.children(parent): + results.extend(findAllObjectsByText(child, target_text)) + + return results