Index: suite_leahi/shared/scripts/configuration/utility.py =================================================================== diff -u -rd110c822fb709cc77d0cfb48c52bca4be3a6c0c6 -ref346661b535cbf0104cec6b7aecad9176896783 --- suite_leahi/shared/scripts/configuration/utility.py (.../utility.py) (revision d110c822fb709cc77d0cfb48c52bca4be3a6c0c6) +++ suite_leahi/shared/scripts/configuration/utility.py (.../utility.py) (revision ef346661b535cbf0104cec6b7aecad9176896783) @@ -20,7 +20,7 @@ test.fail("ERROR : " + error_message) return None -def set_Object_Text(text,obj): +def setObjectText(text,obj): """ Method to set object property based on text @param text : (string) treatment parameter text @@ -92,7 +92,7 @@ if type_combo_box is not None: squish.mouseClick(squish.waitForObjectExists(object)) - type_option = get_object_from_names(set_Object_Text(obj = names.o_option_combo_box,text = type[whichTypeIndex]),error_message=f"Option {type[whichTypeIndex]} object is missing",timeout_ms=5000) + type_option = get_object_from_names(setObjectText(obj = names.o_option_combo_box,text = type[whichTypeIndex]),error_message=f"Option {type[whichTypeIndex]} object is missing",timeout_ms=5000) if type_option is not None: squish.mouseClick(type_option) return True Index: suite_leahi/shared/scripts/names.py =================================================================== diff -u -re32200c7f7ab29391717233a88a2dc27ee8987f8 -ref346661b535cbf0104cec6b7aecad9176896783 --- suite_leahi/shared/scripts/names.py (.../names.py) (revision e32200c7f7ab29391717233a88a2dc27ee8987f8) +++ suite_leahi/shared/scripts/names.py (.../names.py) (revision ef346661b535cbf0104cec6b7aecad9176896783) @@ -59,7 +59,7 @@ #patient vitals o_option_combo_box = {"container": o_Overlay, "type": "Text", "unnamed": 1 } o_treatmentVitals = {"container": mainTreatmentScreen, "objectName": "treatmentVitals", "type": "TreatmentVitals" } -o_treatmentHome_editButton_IconButton = {"container": o_treatmentVitals, "id": "_editButton", "type": "IconButton", "unnamed": 1 } +o_treatmentHome_editButton_IconButton = {"container": o_treatmentVitals, "id": "_editButton", "type": "IconButton", "unnamed": 1 } o_PreTreatmentCreateStack_PreTreatmentCreateStack = {"container": o_Gui_MainView, "objectName": "_PreTreatmentCreateStack","type": "PreTreatmentCreateStack", } o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate = {"container": o_PreTreatmentCreateStack_PreTreatmentCreateStack, "objectName": "_PreTreatmentCreate", "type": "PreTreatmentCreate", } o_PreTreatmentCreate_bloodFlowRateControl_ValueAdjuster = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_bloodFlowRateControl", "type": "ValueAdjuster", "unnamed": 1 } @@ -93,5 +93,5 @@ o_vitals_reading = {"container": mainTreatmentScreen, "type": "Text", "unnamed": 1 } keyboard_input = {"container": o_Overlay, "type": "Text", "unnamed": 1 } o_last_read = {"container": mainTreatmentScreen, "id":"_lastRecorded" , "type": "Text", "unnamed": 1 } -o_measureVitalsButton_TouchRect = {"container": o_Overlay, "id": "_measureVitalsButton", "type": "TouchRect", "unnamed": 1, "visible": True} +o_measureVitalsButton_TouchRect = {"container": o_Overlay, "id": "_measureVitalsButton", "type": "TouchRect", "unnamed": 1 } Index: suite_leahi/tst_patient_vitals/test.py =================================================================== diff -u -re32200c7f7ab29391717233a88a2dc27ee8987f8 -ref346661b535cbf0104cec6b7aecad9176896783 --- suite_leahi/tst_patient_vitals/test.py (.../test.py) (revision e32200c7f7ab29391717233a88a2dc27ee8987f8) +++ suite_leahi/tst_patient_vitals/test.py (.../test.py) (revision ef346661b535cbf0104cec6b7aecad9176896783) @@ -63,7 +63,7 @@ utility.set_value_based_on_target(names.o_PreTreatmentCreate_dialysateTemperatureControl_ValueAdjuster,37.0) utility.select_different_dropdown(names.o_PreTreatmentCreate_dialyzerTypeComboBox_BaseComboBox,DIALYZER_TYPE,2) utility.set_value_based_on_target(names.o_PreTreatmentCreate_salineBolusVolumeControl_ValueAdjuster, 100) - utility.select_different_dropdown(names.o_PreTreatment_vitalsCombobox_BaseCombobox,VITALS,2) + utility.select_different_dropdown(names.o_PreTreatment_vitalsCombobox_BaseCombobox,VITALS,1) utility.select_different_dropdown(names.o_PreTreatmentCreate_bicarbonateConcentrateComboBox_BaseComboBox,BICARBONATE,0) mouseClick(waitForObject(names.o_PreTreatmentButtom)) td.td_Treatment_Parameters_Validation( vAccepted = 1, @@ -114,7 +114,7 @@ mouseClick(input_field) #check the title - title = waitForObjectExists(utility.set_Object_Text(text = title_name,obj =names.o_title_Text)) + title = waitForObjectExists(utility.setObjectText(text = title_name,obj =names.o_title_Text)) test.compare(title_name, title.text, "Title text should be -> "+ str(title_name)) for text in expected_value: @@ -208,7 +208,7 @@ mouseClick(waitForObject(names.o_confirm_button)) test.endSection() -def verify_interval_for_bpm(): +def verify_the_popup_with_rejectionReason(): """ Method to check the popup is opened automatically after time interval """ @@ -261,8 +261,45 @@ test.log(f"Remaining time is correct: {ui_str}") else: test.fail(f"Remaining time incorrect. Expected {expected_str}, got {ui_str}") + +def verify_vitals_data_updated_no_rejection_reason(): + """ + Method to verify the vitals data updated + with no rejection reason + @param interval - (int) interval in min + """ + + while True: + # Read time from GUI + remaining_time = str(waitForObject(names.o_vitalCountdown_Text).text).strip() + + test.log(f"Current Remaining Time: {remaining_time}") + + # When GUI time becomes zero, return + if remaining_time in ("0:00", "00:01"): + test.log(remaining_time) + td.td_vitals( systolic= 80, + diastolic = 60, + heartRate = 140 ) + break + blood_pressure = waitForObjectExists(names.o_treatmentHome_bloodPressure_LabelValue).topText + test.compare("70"+"/"+"50", blood_pressure,"Blood pressure value should be ->"+str("70"+"/"+"50")) + heart_rate = waitForObjectExists(names.o_treatmentHome_heartBeat_LabelValue).topText + test.compare("140", heart_rate,"Heart Rate value should be ->"+str(120)) + +def verify_popup_with_no_rejectionReason(): + mouseClick(waitForObject(names.o_vitalsButton_VitalsButton)) + mouseClick(names.o_measureVitalsButton_TouchRect) + td.td_vitals( systolic = 70, + diastolic = 50, + heartRate = 120 ) + td.td_vitals_adjustment_response(vRejectionReason=0) + blood_pressure = waitForObjectExists(names.o_treatmentHome_bloodPressure_LabelValue).topText + test.compare("70"+"/"+"50", blood_pressure,"Blood pressure value should be ->"+str("70"+"/"+"50")) + heart_rate = waitForObjectExists(names.o_treatmentHome_heartBeat_LabelValue).topText + test.compare("120", heart_rate,"Heart Rate value should be ->"+str(120)) + verify_vitals_data_updated_no_rejection_reason() - def main(): utils.tstStart(__file__) startApplication(config.AUT_NAME) @@ -289,7 +326,7 @@ 0 , 0) utils.waitForGUI(1) - validate_time_interval(names.o_vitalCountdown_Text,10) + validate_time_interval(names.o_vitalCountdown_Text,5) test.endSection() test.startSection("Verify the minimum values in the vitals popup") @@ -346,19 +383,10 @@ test.endSection() test.startSection("Verify the vitals data send automatically populate on popup") - mouseClick(waitForObject(names.o_vitalsButton_VitalsButton)) - mouseClick(names.o_measureVitalsButton_TouchRect) - td.td_vitals( systolic = 70 , - diastolic = 50 , - heartRate = 120 ) - td.td_vitals_adjustment_response(vRejectionReason=0) - blood_pressure = waitForObjectExists(names.o_treatmentHome_bloodPressure_LabelValue).topText - test.compare(70+"/"+50, blood_pressure,"Blood pressure value should be ->"+str(70+"/"+50)) - heart_rate = waitForObjectExists(names.o_treatmentHome_heartBeat_LabelValue).topText - test.compare(120, heart_rate,"Heart Rate value should be ->"+str(120)) - + verify_popup_with_no_rejectionReason + #With rejection reasom - verify_interval_for_bpm() + verify_the_popup_with_rejectionReason() test.endSection() test.startSection("Verify the last read time in the UI")