Index: suite_leahi/tst_patient_vitals/test.py =================================================================== diff -u -rf0f3fc8e69813e78182948c8ae496275083c7e28 -rb80889ae38266207964960df3070edaa8c467cd9 --- suite_leahi/tst_patient_vitals/test.py (.../test.py) (revision f0f3fc8e69813e78182948c8ae496275083c7e28) +++ suite_leahi/tst_patient_vitals/test.py (.../test.py) (revision b80889ae38266207964960df3070edaa8c467cd9) @@ -34,78 +34,7 @@ td =TD_Messaging() can_interface = td.can_interface - -ACID_CONCENTRATE = ["1.0 K, 2.50 Ca, 1 Mg","2.0 K, 2.50 Ca, 1 Mg","3.0 K, 2.50 Ca, 1 Mg"] -DIALYZER_TYPE = ["Diacap Pro 13H","Diacap Pro 16H", "Diacap Pro 19H", "Optiflux F160NRe", "Optiflux F180NRe", "Optiflux F200NRe","Optiflux F250NRe"] -VITALS = ["OFF","5","10","15","20","30","60"] -BICARBONATE = ["Sodium Bicarbonate"] - -SYSTOLIC = "Systolic" -DIASTOLIC = "Diastolic" -HEARTRATE = "Heart Rate" - -MIN_SYSTOLIC = "60" -MIN_DIASTOLIC = "40" -MIN_HEARTRATE = "40" - -MAX_SYSTOLIC = "250" -MAX_DIASTOLIC = "200" -MAX_HEARTRATE = "180" - -SYSTOLIC_251 = "251" -DIASTOLIC_201 = "201" -HEARTRATE_181 = "181" - -VISIBLE = True - - -def verify_create_treatment_parameters(): - test.startSection("Pre treatment parameters") - for i in range(4): - mouseClick(waitForObject(names.o_preTreatmentStack_confirmButton_ConfirmButton)) - - mouseClick(waitForObject(names.o_PreTreatmentCreate_pretreatmentPatientIDEntry_TextEntry)) - waitForObject(names.o_PreTreatmentCreate_pretreatmentPatientIDEntry_TextEntry).text ="abcd" - utility.set_value_based_on_target(names.o_PreTreatmentCreate_bloodFlowRateControl_ValueAdjuster, 90) - utility.set_value_based_on_target(names.o_PreTreatmentCreate_dialysateFlowRateControl_ValueAdjuster, 100) - utility.set_value_based_on_target(names.o_PreTreatmentCreate_durationControl_ValueAdjuster, 105) - utility.set_value_based_on_target(names.o_PreTreatmentCreate_heparinBolusVolumeControl_ValueAdjuster, 0.4) - utility.set_value_based_on_target(names.o_PreTreatmentCreate_heparinDispensingRateControl_ValueAdjuster, 0.5) - utility.set_value_based_on_target(names.o_PreTreatmentCreate_heparinStopTimeControl_ValueAdjuster, 105) - utility.select_different_dropdown(names.o_PreTreatmentCreate_acidConcentrateComboBox_BaseComboBox,ACID_CONCENTRATE,2) - 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,1) - utility.select_different_dropdown(names.o_PreTreatmentCreate_bicarbonateConcentrateComboBox_BaseComboBox,BICARBONATE,0) - mouseClick(waitForObject(names.o_preTreatmentStack_confirmButton_ConfirmButton)) - 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 - ) - - confirmButton = waitForObject(names.o_preTreatmentStack_confirmButton_ConfirmButton) - mouseClick(waitForObject(confirmButton)) - td.td_operation_mode(TDOpModes.MODE_PRET.value, 0) - test.endSection() - + def keyboard_object_map_helper(text): """ Method for setting custom object property's for keyboard keys @@ -158,7 +87,7 @@ close_btn = waitForObject(names.o_vitals_close_btn) total_elapsed_time = end_time - start_time test.log("Total elapsed time : {}".format(total_elapsed_time)) - test.compare(close_btn.visible, VISIBLE, "Popup close option is visible after the vitals pop up is opened automatically") + test.compare(close_btn.visible, config.VISIBLE, "Popup close option is visible after the vitals pop up is opened automatically") reason_text = waitForObjectExists(utility.setObjectText(text = "Rejected Reason: [1] Request is not allowed in the current operating mode",obj =names.o_title_Text)) test.compare(reason_text.text, "Rejected Reason: [1] Request is not allowed in the current operating mode", "Rejection reason text should be"+str("Rejected Reason: [1] Request is not allowed in the current operating mode")) test.endSection() @@ -311,9 +240,9 @@ test.log("Condition not satisfied within 5 minutes. Exiting loop.") blood_pressure = waitForObjectExists(names.o_treatmentHome_bloodPressure_LabelValue).topText - test.compare("80"+"/"+"60", blood_pressure,"Blood pressure value should be ->"+str("80"+"/"+"60")) + 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("140", heart_rate,"Heart Rate value should be ->"+str(120)) + test.compare("120", heart_rate,"Heart Rate value should be ->"+str(120)) def main(): @@ -335,7 +264,7 @@ td.td_blood_set_auto_load_response(vRejectionReason = 0) test.startSection("Create the pretreatment values") - verify_create_treatment_parameters() + utility.verify_create_treatment_parameters() test.endSection() test.startSection("Verify the minimum values in the vitals popup") @@ -351,33 +280,33 @@ 0 , 0) mouseClick(waitForObject(names.o_vitalsButton_VitalsButton)) - verify_valid_vitals_through_keypad(SYSTOLIC,names.o_bloodPressureSystolic_TextEntry,MIN_SYSTOLIC,MIN_SYSTOLIC) - verify_valid_vitals_through_keypad(DIASTOLIC,names.o_bloodPressureDiastolic_TextEntry,MIN_DIASTOLIC,MIN_DIASTOLIC) - verify_valid_vitals_through_keypad(HEARTRATE, names.o_heartRate_TextEntry, MIN_HEARTRATE, MIN_HEARTRATE) + verify_valid_vitals_through_keypad(config.SYSTOLIC,names.o_bloodPressureSystolic_TextEntry,config.MIN_SYSTOLIC,config.MIN_SYSTOLIC) + verify_valid_vitals_through_keypad(config.DIASTOLIC,names.o_bloodPressureDiastolic_TextEntry,config.MIN_DIASTOLIC,config.MIN_DIASTOLIC) + verify_valid_vitals_through_keypad(config.HEARTRATE, names.o_heartRate_TextEntry, config.MIN_HEARTRATE, config.MIN_HEARTRATE) mouseClick(waitForObject(names.o_confirm_button)) blood_pressure = waitForObjectExists(names.o_treatmentHome_bloodPressure_LabelValue).topText - test.compare(MIN_SYSTOLIC+"/"+MIN_DIASTOLIC, blood_pressure,"Blood pressure value should be ->"+str(MIN_SYSTOLIC+"/"+MIN_DIASTOLIC)) + test.compare(config.MIN_SYSTOLIC+"/"+config.MIN_DIASTOLIC, blood_pressure,"Blood pressure value should be ->"+str(config.MIN_SYSTOLIC+"/"+config.MIN_DIASTOLIC)) heart_rate = waitForObjectExists(names.o_treatmentHome_heartBeat_LabelValue).topText - test.compare(MIN_HEARTRATE, heart_rate,"Heart Rate value should be ->"+str(MIN_HEARTRATE)) + 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(SYSTOLIC,names.o_bloodPressureSystolic_TextEntry,MAX_SYSTOLIC,MAX_SYSTOLIC) - verify_valid_vitals_through_keypad(DIASTOLIC,names.o_bloodPressureDiastolic_TextEntry,MAX_DIASTOLIC,MAX_DIASTOLIC) - verify_valid_vitals_through_keypad(HEARTRATE, names.o_heartRate_TextEntry, MAX_HEARTRATE, MAX_HEARTRATE) + verify_valid_vitals_through_keypad(config.SYSTOLIC,names.o_bloodPressureSystolic_TextEntry,config.MAX_SYSTOLIC,config.MAX_SYSTOLIC) + verify_valid_vitals_through_keypad(config.DIASTOLIC,names.o_bloodPressureDiastolic_TextEntry,config.MAX_DIASTOLIC,config.MAX_DIASTOLIC) + verify_valid_vitals_through_keypad(config.HEARTRATE, names.o_heartRate_TextEntry, config.MAX_HEARTRATE, config.MAX_HEARTRATE) mouseClick(waitForObject(names.o_confirm_button)) blood_pressure = waitForObjectExists(names.o_treatmentHome_bloodPressure_LabelValue).topText - test.compare(MAX_SYSTOLIC+"/"+MAX_DIASTOLIC, blood_pressure,"Blood pressure value should be ->"+str(MAX_SYSTOLIC+"/"+MAX_DIASTOLIC)) + test.compare(config.MAX_SYSTOLIC+"/"+config.MAX_DIASTOLIC, blood_pressure,"Blood pressure value should be ->"+str(config.MAX_SYSTOLIC+"/"+config.MAX_DIASTOLIC)) heart_rate = waitForObjectExists(names.o_treatmentHome_heartBeat_LabelValue).topText - test.compare(MAX_HEARTRATE, heart_rate,"Heart Rate value should be ->"+str(MAX_HEARTRATE)) + test.compare(config.MAX_HEARTRATE, heart_rate,"Heart Rate value should be ->"+str(config.MAX_HEARTRATE)) test.endSection() test.startSection("Verify the confirm button is disabled when user enter invalid values") mouseClick(waitForObject(names.o_vitalsButton_VitalsButton)) - verify_valid_vitals_through_keypad(SYSTOLIC,names.o_bloodPressureSystolic_TextEntry,SYSTOLIC_251,SYSTOLIC_251) - verify_valid_vitals_through_keypad(DIASTOLIC,names.o_bloodPressureDiastolic_TextEntry,DIASTOLIC_201,DIASTOLIC_201) - verify_valid_vitals_through_keypad(HEARTRATE, names.o_heartRate_TextEntry, HEARTRATE_181, HEARTRATE_181) + verify_valid_vitals_through_keypad(config.SYSTOLIC,names.o_bloodPressureSystolic_TextEntry,config.SYSTOLIC_251,config.SYSTOLIC_251) + verify_valid_vitals_through_keypad(config.DIASTOLIC,names.o_bloodPressureDiastolic_TextEntry,config.DIASTOLIC_201,config.DIASTOLIC_201) + verify_valid_vitals_through_keypad(config.HEARTRATE, names.o_heartRate_TextEntry, config.HEARTRATE_181, config.HEARTRATE_181) confirm_button =waitForObjectExists(names.o_confirm_button) test.verify(not confirm_button.enabled, "Confirm button is not enabled") mouseClick(waitForObject(names.o_vitals_close_btn)) @@ -388,17 +317,16 @@ #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.select_different_dropdown(names.o_vitals_Interval_BaseComboBox,VITALS,0) - utility.select_different_dropdown(names.o_vitals_Interval_BaseComboBox,VITALS,1) - test.compare(waitForObject(names.o_vitals_Interval_BaseComboBox).currentText, VITALS[1], "Vitals interval value should be :"+str(VITALS[1])) - utility.select_different_dropdown(names.o_vitals_Interval_BaseComboBox,VITALS,2) - test.compare(waitForObject(names.o_vitals_Interval_BaseComboBox).currentText, VITALS[2], "Vitals interval value should be :"+str(VITALS[2])) - utility.select_different_dropdown(names.o_vitals_Interval_BaseComboBox,VITALS,3) - test.compare(waitForObject(names.o_vitals_Interval_BaseComboBox).currentText, VITALS[3], "Vitals interval value should be :"+str(VITALS[3])) - utility.select_different_dropdown(names.o_vitals_Interval_BaseComboBox,VITALS,4) - test.compare(waitForObject(names.o_vitals_Interval_BaseComboBox).currentText, VITALS[4], "Vitals interval value should be :"+str(VITALS[4])) - utility.select_different_dropdown(names.o_vitals_Interval_BaseComboBox,VITALS,5) - test.compare(waitForObject(names.o_vitals_Interval_BaseComboBox).currentText, VITALS[5], "Vitals interval value should be :"+str(VITALS[5])) + utility.select_different_dropdown(names.o_vitals_Interval_BaseComboBox,config.VITALS,1) + test.compare(waitForObject(names.o_vitals_Interval_BaseComboBox).currentText, config.VITALS[1], "Vitals interval value should be :"+str(config.VITALS[1])) + utility.select_different_dropdown(names.o_vitals_Interval_BaseComboBox,config.VITALS,2) + test.compare(waitForObject(names.o_vitals_Interval_BaseComboBox).currentText, config.VITALS[2], "Vitals interval value should be :"+str(config.VITALS[2])) + utility.select_different_dropdown(names.o_vitals_Interval_BaseComboBox,config.VITALS,3) + test.compare(waitForObject(names.o_vitals_Interval_BaseComboBox).currentText, config.VITALS[3], "Vitals interval value should be :"+str(config.VITALS[3])) + utility.select_different_dropdown(names.o_vitals_Interval_BaseComboBox,config.VITALS,4) + test.compare(waitForObject(names.o_vitals_Interval_BaseComboBox).currentText, config.VITALS[4], "Vitals interval value should be :"+str(config.VITALS[4])) + utility.select_different_dropdown(names.o_vitals_Interval_BaseComboBox,config.VITALS,5) + test.compare(waitForObject(names.o_vitals_Interval_BaseComboBox).currentText, config.VITALS[5], "Vitals interval value should be :"+str(config.VITALS[5])) mouseClick(waitForObject(names.o_vitals_close_btn)) test.endSection() @@ -410,9 +338,9 @@ test.startSection("Verify the last read time in the UI") mouseClick(waitForObject(names.o_vitalsButton_VitalsButton)) - verify_valid_vitals_through_keypad(SYSTOLIC,names.o_bloodPressureSystolic_TextEntry,MIN_SYSTOLIC,MIN_SYSTOLIC) - verify_valid_vitals_through_keypad(DIASTOLIC,names.o_bloodPressureDiastolic_TextEntry,MIN_DIASTOLIC,MIN_DIASTOLIC) - verify_valid_vitals_through_keypad(HEARTRATE, names.o_heartRate_TextEntry, MIN_HEARTRATE, MIN_HEARTRATE) + verify_valid_vitals_through_keypad(config.SYSTOLIC,names.o_bloodPressureSystolic_TextEntry,config.MIN_SYSTOLIC,config.MIN_SYSTOLIC) + verify_valid_vitals_through_keypad(config.DIASTOLIC,names.o_bloodPressureDiastolic_TextEntry,config.MIN_DIASTOLIC,config.MIN_DIASTOLIC) + verify_valid_vitals_through_keypad(config.HEARTRATE, names.o_heartRate_TextEntry,config.MIN_HEARTRATE,config.MIN_HEARTRATE) mouseClick(waitForObject(names.o_confirm_button)) sys_time = utility.get_current_date_and_time(date_format="%Y/%b/%d - %H:%M:%S") last_read = waitForObjectExists(names.o_last_read).text @@ -423,11 +351,11 @@ test.startSection("Check the vitals in main treatment screen") mouseClick(waitForObject(names.o_treatmentHome_editButton_IconButton)) - utility.select_different_dropdown(names.o_vitals_Interval_BaseComboBox,VITALS,5) + utility.select_different_dropdown(names.o_vitals_Interval_BaseComboBox,config.VITALS,5) mouseClick(waitForObject(names.o_confirm_button,1000)) validate_time_interval(names.o_vitalCountdown_Text,30) mouseClick(waitForObject(names.o_treatmentHome_editButton_IconButton)) - utility.select_different_dropdown(names.o_vitals_Interval_BaseComboBox,VITALS,1) + utility.select_different_dropdown(names.o_vitals_Interval_BaseComboBox,config.VITALS,1) mouseClick(waitForObject(names.o_confirm_button,1000)) validate_time_interval(names.o_vitalCountdown_Text,5)