Index: suite_leahi/shared/scripts/configuration/utility.py =================================================================== diff -u -rc7d96b722594bb29a7bbc3689715b90af6e3d616 -r8ac0eae52c22298abedaec3200ebd450888c3ac2 --- suite_leahi/shared/scripts/configuration/utility.py (.../utility.py) (revision c7d96b722594bb29a7bbc3689715b90af6e3d616) +++ suite_leahi/shared/scripts/configuration/utility.py (.../utility.py) (revision 8ac0eae52c22298abedaec3200ebd450888c3ac2) @@ -5,10 +5,17 @@ from leahi_dialin.ui.td_messaging import TD_Messaging from leahi_dialin.common.td_defs import TDOpModes,TDTreatmentStates from configuration import config, navigation - -td =TD_Messaging() from leahi_dialin.ui import utils from builtins import int as pyInt + +td = TD_Messaging() + +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): """ @@ -143,7 +150,7 @@ set_value_based_on_target(names.o_PreTreatmentCreate_dialysateTemperatureControl_ValueAdjuster,37.0) select_different_dropdown(names.o_PreTreatmentCreate_dialyzerTypeComboBox_BaseComboBox,config.DIALYZER_TYPE,2) set_value_based_on_target(names.o_PreTreatmentCreate_salineBolusVolumeControl_ValueAdjuster, 200) - select_different_dropdown(names.o_PreTreatment_vitalsCombobox_BaseCombobox,config.VITALS,1) + set_value_based_on_target(names.o_PreTreatmentCreate_bpMeasurementIntervalControl_ValueAdjusterCustom,5.0) select_different_dropdown(names.o_PreTreatmentCreate_bicarbonateConcentrateComboBox_BaseComboBox,config.BICARBONATE,0) Validatebutton = setObjectText(obj = names.o_preTreatmentStack_Text, text =config.VALIDATE) squish.mouseClick(squish.waitForObject(Validatebutton)) @@ -163,14 +170,12 @@ vArterialPressureLimitWindowRejectReason = 0, vVenousPressureLimitWindowRejectReason = 0, vVenousPressureLimitAsymtrcRejectReason = 0, - vTransmembranePressureLimitWindowRejectReason = 0, + vTransmembranePressureLimitWindowRejectReason= 0, vDialysateTempRejectReason = 0, vHeparinDispensingRateRejectReason = 0, vHeparinBolusVolumeRejectReason = 0 ) - - confirmButton = setObjectText(obj = names.o_preTreatmentStack_Text,text = config.CONFIRM ) - squish.mouseClick(squish.waitForObject(confirmButton)) + squish.mouseClick(names.o_preTreatmentStack_confirmButton_ConfirmButton) test.endSection() def findAllObjectsById(parent, target_id): @@ -190,10 +195,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 +278,20 @@ 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 + if hasattr(parent, 'text') and str(parent.text) == target_text: + results.append(parent) + + # Recurse through all children + for child in object.children(parent): + results.extend(findAllObjectsByText(child, target_text)) + + return results \ No newline at end of file