Index: tst_treatment_monitoring/test.py =================================================================== diff -u -rf7e0cacb90c34d1cfe2f95652acbdba018339985 -raf2d6895043614204111a0d87b8effa06edc8e6e --- tst_treatment_monitoring/test.py (.../test.py) (revision f7e0cacb90c34d1cfe2f95652acbdba018339985) +++ tst_treatment_monitoring/test.py (.../test.py) (revision af2d6895043614204111a0d87b8effa06edc8e6e) @@ -19,10 +19,11 @@ from dialin.ui import utils from dialin.ui.hd_simulator import HDSimulator from configuration import config +from dialin.common.hd_defs import HDOpModes, HDOpSubModes, TreatmentStates BLOOD_PRIMING_TARGET_VALUE = 150 -hd_simulator = HDSimulator() +hd_simulator = HDSimulator() def test_blood_prime_value(expected_blood_prime_value): @@ -42,8 +43,8 @@ @return: N/A """ test.startSection("verification of blood prime values based on target value") - test.compare(waitForObject(names.o_blood_priming).text, config.BLOOD_PRIMING_TEXT, "blood priming text is verified") - test.compare(waitForObject(names.o_blood_priming_value_by_default).text, config.BLOOD_PRIMING_DEFAULT_VALUE, "blood priming unit is verified") + test.compare(waitForObject(names.o_blood_priming).text, config.BLOOD_PRIMING_TEXT, "{} is visible".format(config.BLOOD_PRIMING_TEXT)) + test.compare(waitForObject(names.o_blood_priming_value_by_default).text, config.BLOOD_PRIMING_DEFAULT_VALUE, "{} is verified".format(config.BLOOD_PRIMING_DEFAULT_VALUE)) for target_range in (BLOOD_PRIMING_TARGET_VALUE, config.BLOOD_PRIMING_TARGET_MAXIMUM+1): test.log("Selected target value should be -> " + str(target_range)) @@ -55,72 +56,72 @@ test.endSection() -def monitoring_treatment_parameters(): +def verification_of_monitoring_treatment_parameters(): """ Tests for monitoring treatment parameters. @param: N/A @return: N/A """ - test.startSection("Verification of treatment parameters") - hd_simulator.cmd_set_treatment_states_data(sub_mode= 2, uf_state= 0, saline_state=0, heparin_state= 0, - rinseback_state= 0, recirculate_state= 0, blood_prime_state= 0, - treatment_end_state=0, treatment_stop_state= 0, dialysis_state=0) + test.startSection("verification of treatment parameters") + hd_simulator.cmd_set_treatment_states_data(sub_mode=HDOpSubModes.SUBMODE_WAIT_FOR_DISINFECT.value, uf_state=TreatmentStates.TREATMENT_START_STATE.value, saline_state=TreatmentStates.TREATMENT_START_STATE.value, heparin_state=TreatmentStates.TREATMENT_START_STATE.value, + rinseback_state=TreatmentStates.TREATMENT_START_STATE.value, recirculate_state=TreatmentStates.TREATMENT_START_STATE.value, blood_prime_state=TreatmentStates.TREATMENT_START_STATE.value, + treatment_end_state=TreatmentStates.TREATMENT_START_STATE.value, treatment_stop_state=TreatmentStates.TREATMENT_START_STATE.value, dialysis_state=TreatmentStates.TREATMENT_START_STATE.value) test.log("Test for verifying components of Flows in Main Treatment ") test.compare(str(waitForObject(names.o_Flows).text), config.FLOWS_TEXT) - test.compare(waitForObject(names.o_Flows).visible, True, "Flows title is visible") + test.compare(waitForObject(names.o_Flows).visible, True, "{} is visible".format(config.FLOWS_TEXT)) test.compare(str(waitForObject(names.o_Blood).text), config.BLOOD_TEXT) - test.compare(waitForObject(names.o_Blood).visible, True, "Blood text is visible") + test.compare(waitForObject(names.o_Blood).visible, True, "{} is visible".format(config.BLOOD_TEXT)) test.compare(str(waitForObject(names.o_Blood_Unit).text), config.BLOOD_UNIT) - test.compare(waitForObject(names.o_Blood_Unit).visible, True, "Blood unit is visible") - test.compare(str(waitForObject(names.o_Dialysate).text ), config.DIALYSATE_TEXT ) - test.compare(waitForObject(names.o_Dialysate).visible, True, "dialysate text is visible") + test.compare(waitForObject(names.o_Blood_Unit).visible, True, "{} is visible".format(config.BLOOD_UNIT)) + test.compare(str(waitForObject(names.o_Dialysate).text ), config.DIALYSATE_TEXT) + test.compare(waitForObject(names.o_Dialysate).visible, True, "{} is visible".format(config.DIALYSATE_TEXT)) test.compare(str(waitForObject(names.o_Dialysate_Unit).text), config.BLOOD_UNIT) - test.compare(waitForObject(names.o_Dialysate_Unit).visible, True, "dialyste unit is visible") + test.compare(waitForObject(names.o_Dialysate_Unit).visible, True, "{} is visible".format(config.BLOOD_UNIT)) test.log("Test for verifying components of Vitals in Main Treatment ") - test.compare(str(waitForObject(names.o_Vitals).text ), config.VITALS_TEXT ) - test.compare(waitForObject(names.o_Vitals).visible, True, "Vitals text is visible") + test.compare(str(waitForObject(names.o_Vitals).text ), config.VITALS_TEXT) + test.compare(waitForObject(names.o_Vitals).visible, True, "{} is visible".format(config.VITALS_TEXT)) test.compare(str(waitForObject(names.o_BloodPressure_Unit).text), config.BLOOD_PRESSURE_TEXT) - test.compare(waitForObject(names.o_BloodPressure_Unit).visible, True, "Blood pressure unit is visible") + test.compare(waitForObject(names.o_BloodPressure_Unit).visible, True, "{} is visible".format(config.BLOOD_PRESSURE_TEXT)) test.compare(str(waitForObject(names.o_HeartRate_Unit).text), config.HEARTRATE_UNIT) - test.compare(waitForObject(names.o_HeartRate_Unit).visible, True, "heart rate unit is visible") + test.compare(waitForObject(names.o_HeartRate_Unit).visible, True, "{} is visible".format(config.HEARTRATE_UNIT)) test.log("Test for verifying components of Pressure in Main Treatment ") - test.compare(str(waitForObject(names.o_pressure).text ), config.PRESSURE_TEXT ) - test.compare(waitForObject(names.o_pressure).visible, True, "Pressure text is visible") - test.compare(str(waitForObject(names.o_Arterial).text ), config.ARTEREAL_TEXT ) - test.compare(waitForObject(names.o_Arterial).visible, True, "Arterial text is visible") - test.compare(str(waitForObject(names.o_Venous).text ), config.VENOUS_TEXT ) - test.compare(waitForObject(names.o_Venous).visible, True, "Venous text is visible" ) + test.compare(str(waitForObject(names.o_pressure).text ), config.PRESSURE_TEXT) + test.compare(waitForObject(names.o_pressure).visible, True, "{} is visible".format(config.PRESSURE_TEXT)) + test.compare(str(waitForObject(names.o_Arterial).text ), config.ARTEREAL_TEXT) + test.compare(waitForObject(names.o_Arterial).visible, True, "{} is visible".format(config.ARTEREAL_TEXT)) + test.compare(str(waitForObject(names.o_Venous).text ), config.VENOUS_TEXT) + test.compare(waitForObject(names.o_Venous).visible, True, "{} is visible".format(config.VENOUS_TEXT)) test.log("Test for verifying components of Time Duration in Main Treatment ") - test.compare(str(waitForObject(names.o_Timeremaining).text ), config.TIME_DURATION_TEXT ) - test.compare(waitForObject(names.o_Timeremaining).visible, True, "Time duration text is visible") + test.compare(str(waitForObject(names.o_Timeremaining).text ), config.TIME_DURATION_TEXT) + test.compare(waitForObject(names.o_Timeremaining).visible, True, "{} is visible".format(config.TIME_DURATION_TEXT)) test.log("Test for verifying components of Ultrafiltration Volume in Main Treatment ") - test.compare(str(waitForObject(names.o_Ultrafiltration).text ), config.ULTRAFILTERATION_TEXT ) - test.compare(waitForObject(names.o_Ultrafiltration ).visible, True, "ultrafilteration text is visible") + test.compare(str(waitForObject(names.o_Ultrafiltration).text ), config.ULTRAFILTERATION_TEXT) + test.compare(waitForObject(names.o_Ultrafiltration ).visible, True, "{} is visible".format(config.ULTRAFILTERATION_TEXT)) test.log("Test for verifying components of Saline Bolus in Main Treatment ") - test.compare(str(waitForObject(names.o_SalineBolus).text ), config.SALINE_BOLUS ) - test.compare(waitForObject(names.o_SalineBolus).visible, True, "saline bolus text is visible") - test.compare(str(waitForObject(names.o_VolumeDelivered).text ), config.VOLUME_DELIVERED ) - test.compare(waitForObject(names.o_VolumeDelivered).visible, True, "volume delivered text is visible") + test.compare(str(waitForObject(names.o_SalineBolus).text ), config.SALINE_BOLUS) + test.compare(waitForObject(names.o_SalineBolus).visible, True, "{} is visible".format(config.SALINE_BOLUS)) + test.compare(str(waitForObject(names.o_VolumeDelivered).text ), config.VOLUME_DELIVERED) + test.compare(waitForObject(names.o_VolumeDelivered).visible, True, "{} is visible".format(config.VOLUME_DELIVERED)) test.compare(str(waitForObject(names.o_VolumeDElivered_Unit).text ), "mL" ) test.compare(waitForObject(names.o_VolumeDElivered_Unit).visible, True, "volume delivered unit is visible") - test.compare(str(waitForObject(names.o_CumulativeDElivered).text ), config.CUMULATIVE_DELIVERED ) - test.compare(waitForObject(names.o_CumulativeDElivered).visible, True, "cumulative delivered text is visible") - test.compare(str(waitForObject(names.o_CumulativeDelivered_Unit).text ), config.LIQUID_UNIT ) - test.compare(waitForObject(names.o_CumulativeDelivered_Unit).visible, True, "cumulative delivered unit is visible") + test.compare(str(waitForObject(names.o_CumulativeDElivered).text ), config.CUMULATIVE_DELIVERED) + test.compare(waitForObject(names.o_CumulativeDElivered).visible, True, "{} is visible".format(config.CUMULATIVE_DELIVERED)) + test.compare(str(waitForObject(names.o_CumulativeDelivered_Unit).text ), config.LIQUID_UNIT) + test.compare(waitForObject(names.o_CumulativeDelivered_Unit).visible, True, "{} is visible".format(config.LIQUID_UNIT)) test.log("Test for verifying components of Heparin in Main Treatment ") - test.compare(str(waitForObject(names.o_Heparin).text ), config.HEPARIN_TEXT ) - test.compare(waitForObject(names.o_Heparin).visible, True, "heparin text is visible") - test.compare(str(waitForObject(names.o_Heparin_VolumeDelivered).text ), config.VOLUME_DELIVERED ) - test.compare(waitForObject(names.o_Heparin_VolumeDelivered).visible, True, "heparin volume delivered is visible") - test.compare(str(waitForObject(names.o_Heparin_VolumeDelivered_Unit ).text ), config.LIQUID_UNIT ) - test.compare(waitForObject(names.o_Heparin_VolumeDelivered_Unit ).visible, True, "heparin volume unit is visible") + test.compare(str(waitForObject(names.o_Heparin).text ), config.HEPARIN_TEXT) + test.compare(waitForObject(names.o_Heparin).visible, True, "{} is visible".format(config.HEPARIN_TEXT)) + test.compare(str(waitForObject(names.o_Heparin_VolumeDelivered).text ), config.VOLUME_DELIVERED) + test.compare(waitForObject(names.o_Heparin_VolumeDelivered).visible, True, "{} is visible".format(config.VOLUME_DELIVERED)) + test.compare(str(waitForObject(names.o_Heparin_VolumeDelivered_Unit ).text ), config.LIQUID_UNIT) + test.compare(waitForObject(names.o_Heparin_VolumeDelivered_Unit ).visible, True, "{} is visible".format(config.LIQUID_UNIT)) test.endSection() @@ -129,12 +130,12 @@ utils.tstStart(__file__) startApplication(config.AUT_NAME) - utils.waitForGUI(2) + utils.waitForGUI(1) - hd_simulator.cmd_send_hd_operation_mode(6, 0) + hd_simulator.cmd_send_hd_operation_mode(op_mode=HDOpModes.MODE_TREA.value) verification_of_blood_prime_from_dialysis_state() - monitoring_treatment_parameters() + verification_of_monitoring_treatment_parameters() utils.tstDone() \ No newline at end of file