Index: suite_leahi/shared/scripts/configuration/utility.py =================================================================== diff -u -r17cecc45c8449e30977177ee28b9f29daf4c60ef -r4685148beedce44e04253e44b93700bb1b7174a2 --- suite_leahi/shared/scripts/configuration/utility.py (.../utility.py) (revision 17cecc45c8449e30977177ee28b9f29daf4c60ef) +++ suite_leahi/shared/scripts/configuration/utility.py (.../utility.py) (revision 4685148beedce44e04253e44b93700bb1b7174a2) @@ -132,23 +132,7 @@ return None -def findAllObjectsById(parent, target_id): - """ - Recursively finds all child objects by their id property. - Returns a list of all matching objects found. - """ - results = [] - - # Use hasattr to safely check for 'id' property - if hasattr(parent, 'id') and str(parent.id) == target_id: - results.append(parent) - # Recurse through all children to collect all instances - for child in object.children(parent): - results.extend(findAllObjectsById(child, target_id)) - - return results - def set_value_based_on_target(obj, target_value): """ obj: dictionary containing object paths @@ -188,6 +172,7 @@ test.log(f"✅ Target value reached: {current_value}") + def select_different_dropdown(object,type,whichTypeIndex): """ Selects a value from a dropdown using a doc string. @@ -203,68 +188,6 @@ return True return False # default return if not successful -def verify_create_treatment_parameters(): - test.startSection("Pre treatment parameters") - navigation.navigation_pageIndicator_step(config.CREATERX) - squish.mouseClick(squish.waitForObject(names.o_PreTreatmentCreate_pretreatmentPatientIDEntry_TextEntry)) - squish.waitForObject(names.o_PreTreatmentCreate_pretreatmentPatientIDEntry_TextEntry).text ="abcd" - set_value_based_on_target(names.o_PreTreatmentCreate_bloodFlowRateControl_ValueAdjuster, 60) - set_value_based_on_target(names.o_PreTreatmentCreate_dialysateFlowRateControl_ValueAdjuster, 75) - set_value_based_on_target(names.o_PreTreatmentCreate_durationControl_ValueAdjuster, 75) - heparinValue =navigation.get_ini_value("/home/denali/Public/luis/config/configurations/Settings/System.conf", section ="Feature Configurations", key ="HeparinSyringePump") - if heparinValue == "1": - set_value_based_on_target(names.o_PreTreatmentCreate_heparinBolusVolumeControl_ValueAdjuster, 0.4) - set_value_based_on_target(names.o_PreTreatmentCreate_heparinDispensingRateControl_ValueAdjuster, 0.5) - set_value_based_on_target(names.o_PreTreatmentCreate_heparinStopTimeControl_ValueAdjuster, 60) - select_different_dropdown(names.o_PreTreatmentCreate_acidConcentrateComboBox_BaseComboBox,config.ACID_CONCENTRATE,2) - select_different_dropdown(names.o_PreTreatmentCreate_dialyzerTypeComboBox_BaseComboBox,config.DIALYZER_TYPE,2) - set_value_based_on_target(names.o_PreTreatmentCreate_salineBolusVolumeControl_ValueAdjuster, 200) - set_value_based_on_target(names.o_PreTreatmentCreate_bpMeasurementIntervalControl_ValueAdjusterCustom,2.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)) - td.td_Treatment_Parameters_Validation( vAccepted = 1, - vBloodFlowRateRejectReason = 0, - vDialysateFlowRateRejectReason = 0, - vTreatmentDurationRejectReason = 0, - vSalineBolusVolumeRejectReason = 0, - vHeparinStopTimeRejectReason = 0, - vHeparinTypeRejectReason = 0, - vAcidConcentrateRejectReason = 0, - vBicarbonateConcentrateRejectReason = 0, - vDialyzerTypeRejectReason = 0, - vBloodPressureMeasureIntervalRejectReason = 0, - vRinsebackFlowRateRejectReason = 0, - vRinsebackVolumeRejectReason = 0, - vArterialPressureLimitWindowRejectReason = 0, - vVenousPressureLimitWindowRejectReason = 0, - vVenousPressureLimitAsymtrcRejectReason = 0, - vTransmembranePressureLimitWindowRejectReason = 0, - vDialysateTempRejectReason = 0, - vHeparinDispensingRateRejectReason = 0, - vHeparinBolusVolumeRejectReason = 0 - ) - confirm = squish.waitForObjectExists(names.o_preTreatmentStack_confirmButton_ConfirmButton, 3000) - squish.mouseClick(confirm) - test.endSection() - -def findAllObjectsById(parent, target_id): - """ - Finds all child objects (excluding parent) by their id property. - Returns a list of all matching child objects found. - """ - results = [] - - # Recurse through all children to collect matching instances - for child in object.children(parent): - # Check child's id - if str(child.id) == target_id: - results.append(child) - - # Continue searching in grand children - results.extend(findAllChildrenById(child, target_id)) - - return results def set_value_with_slider(value_field_obj, slider_obj,parameter): """