Index: suite_leahi/shared/scripts/configuration/utility.py =================================================================== diff -u -rb5e443781d3df31e43cb560912fdf021507f0019 -r50d3084c54eef035058b21579538b53f503af657 --- suite_leahi/shared/scripts/configuration/utility.py (.../utility.py) (revision b5e443781d3df31e43cb560912fdf021507f0019) +++ suite_leahi/shared/scripts/configuration/utility.py (.../utility.py) (revision 50d3084c54eef035058b21579538b53f503af657) @@ -145,7 +145,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) - set_value_based_on_target(names.o_PreTreatmentCreate_bpMeasurementIntervalControl_ValueAdjusterCustom,30) + set_value_based_on_target(names.o_PreTreatmentCreate_bpMeasurementIntervalControl_ValueAdjusterCustom,1) 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)) Index: suite_leahi/tst_patient_vitals/test.py =================================================================== diff -u -rb5e443781d3df31e43cb560912fdf021507f0019 -r50d3084c54eef035058b21579538b53f503af657 --- suite_leahi/tst_patient_vitals/test.py (.../test.py) (revision b5e443781d3df31e43cb560912fdf021507f0019) +++ suite_leahi/tst_patient_vitals/test.py (.../test.py) (revision 50d3084c54eef035058b21579538b53f503af657) @@ -34,6 +34,8 @@ td =TD_Messaging() can_interface = td.can_interface + +vitals = {"0":"0","1":"5","2":"10","3":"15","4":"20","5":"30","6":"60"} def keyboard_object_map_helper(text): """ @@ -220,7 +222,7 @@ mouseClick(waitForObject(names.o_vitalsButton_VitalsButton)) mouseClick(names.o_measureVitalsButton_TouchRect) - td.td_vitals( systolic = 70, + td.td_vitals( systolic = 70, diastolic = 50, heartRate = 120 ) @@ -242,7 +244,50 @@ blood_pressure = waitForObjectExists(names.o_treatmentHome_bloodPressure_LabelValue).topText test.compare("70"+"/"+"50", blood_pressure,"Blood pressure value should be ->"+str("80"+"/"+"60")) heart_rate = waitForObjectExists(names.o_treatmentHome_heartBeat_LabelValue).topText - test.compare("120", heart_rate,"Heart Rate value should be ->"+str(120)) + test.compare("120", heart_rate,"Heart Rate value should be ->"+str(120)) + +def set_value_based_on_target_patientvitals(obj, target_value): + """ + obj: dictionary containing object paths + Example: + { + "value_obj": ":mainTreatmentScreen.PressureText", + "left_arrow": ":mainTreatmentScreen.LeftArrow", + "right_arrow": ":mainTreatmentScreen.RightArrow" + } + + target_value: integer or string number, e.g. 220 + """ + target_value = target_value + + # Wait for all objects + parent_obj = squish.waitForObjectExists(obj) + # change range as per your screen count + + left_arrow = utility.findObjectById(parent_obj, "_leftArrow") + right_arrow =utility.findObjectById(parent_obj, "_rightArrow") + + # Read current value (supports invisible text too) + parent = waitForObject(parent_obj) + current_value =utility.findObjectById(parent, "_currentItem") + current_value =str(current_value.text) + + + # Determine direction + while float(current_value) != float(target_value): + if float(current_value) < float(target_value): + squish.mouseClick(squish.waitForObject(right_arrow)) + + elif float(current_value) > float(target_value): + squish.mouseClick(squish.waitForObject(left_arrow)) + + parent = waitForObject(parent_obj) + current_value =utility.findObjectById(parent, "_currentItem") + current_value = str(current_value.text) + + test.log(f"Updated value: {current_value}") + + test.log(f"✅ Target value reached: {current_value}") def main(): @@ -289,7 +334,7 @@ heart_rate = waitForObjectExists(names.o_treatmentHome_heartBeat_LabelValue).topText test.compare(config.MIN_HEARTRATE, heart_rate,"Heart Rate value should be ->"+str(config.MIN_HEARTRATE)) test.endSection() - + test.startSection("Verify the maximum values in the vitals popup") mouseClick(waitForObject(names.o_vitalsButton_VitalsButton)) verify_valid_vitals_through_keypad(config.SYSTOLIC,names.o_bloodPressureSystolic_TextEntry,config.MAX_SYSTOLIC,config.MAX_SYSTOLIC) @@ -317,7 +362,7 @@ #check the title text in the popup vitals_titleText = waitForObjectExists(names.o_vitals_Interval_TitleText).text test.compare("Vitals Interval", vitals_titleText, "Vitals Interval popup text should be ->"+str("Vitals Interval")) - utility.set_value_based_on_target(names.o_bpMeasurementIntervalControl_ValueAdjusterCustom, 5) + set_value_based_on_target_patientvitals(names.o_bpMeasurementIntervalControl_ValueAdjusterCustom, 10) mouseClick(waitForObject(names.o_vitals_close_btn)) test.endSection() @@ -342,11 +387,11 @@ test.startSection("Check the vitals in main treatment screen") mouseClick(waitForObject(names.o_treatmentHome_editButton_IconButton)) - utility.set_value_based_on_target(names.o_bpMeasurementIntervalControl_ValueAdjusterCustom, 5) + set_value_based_on_target_patientvitals(names.o_bpMeasurementIntervalControl_ValueAdjusterCustom, 30) mouseClick(waitForObject(names.o_confirm_button,1000)) validate_time_interval(names.o_vitalCountdown_Text,30) mouseClick(waitForObject(names.o_treatmentHome_editButton_IconButton)) - utility.set_value_based_on_target(names.o_bpMeasurementIntervalControl_ValueAdjusterCustom, 10) + set_value_based_on_target_patientvitals(names.o_bpMeasurementIntervalControl_ValueAdjusterCustom, 5) mouseClick(waitForObject(names.o_confirm_button,1000)) validate_time_interval(names.o_vitalCountdown_Text,5)