Index: tst_treatment_monitoring/test.py =================================================================== diff -u -r6aa08a336560b40f19b22481743e766665f57bd5 -r7ca7f96e85f513986b5eeef60916500b84879c36 --- tst_treatment_monitoring/test.py (.../test.py) (revision 6aa08a336560b40f19b22481743e766665f57bd5) +++ tst_treatment_monitoring/test.py (.../test.py) (revision 7ca7f96e85f513986b5eeef60916500b84879c36) @@ -20,16 +20,18 @@ from dialin.ui.hd_simulator import HDSimulator from configuration import config, utility +BLOOD_PRIMING_TARGET_VALUE = 150 + def test_blood_prime_value(expected_blood_prime_value): """ Tests to verify target values from blood prime section. - @param: expected_blood_prime_value. - @input: expected target value. + @param: expected_blood_prime_value - expected blood prime value. + @return: N/A """ bloodprime_text = waitForObject(names.o_target_value) bloodprime_unit = object.children(bloodprime_text)[1] - expected_blood_prime_value = str(expected_blood_prime_value) +" "+str(config.LIQUID_UNIT) + expected_blood_prime_value = str(expected_blood_prime_value) +" "+config.LIQUID_UNIT test.compare(expected_blood_prime_value, bloodprime_unit.text) @@ -43,7 +45,7 @@ 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") - for target_range in (150, 300): + for target_range in (BLOOD_PRIMING_TARGET_VALUE, config.BLOOD_PRIMING_TARGET_MAXIMUM+1): test.log("Selected target value should be -> " + str(target_range)) for current_range in range(0, config.BLOOD_PRIMING_RANGE-1): hd_instance.cmd_send_treatment_blood_prime_data(target = target_range,current = current_range) @@ -65,66 +67,66 @@ treatment_end_state=0, treatment_stop_state= 0) test.log("Test for verifying components of Flows in Main Treatment ") - test.compare(str(waitForObject(names.o_Flows).text), "FLOWS") - test.compare(waitForObject(names.o_Flows).visible, True) - test.compare(str(waitForObject(names.o_Blood).text), "Blood") - test.compare(waitForObject(names.o_Blood).visible, True) - test.compare(str(waitForObject(names.o_Blood_Unit).text), "mL/min") - test.compare(waitForObject(names.o_Blood_Unit).visible, True) - test.compare(str(waitForObject(names.o_Dialysate).text ), "Dialysate" ) - test.compare(waitForObject(names.o_Dialysate).visible, True) - test.compare(str(waitForObject(names.o_Dialysate_Unit).text), "mL/min") - test.compare(waitForObject(names.o_Dialysate_Unit).visible, True) + 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(str(waitForObject(names.o_Blood).text), config.BLOOD_TEXT) + test.compare(waitForObject(names.o_Blood).visible, True, "Blood text is visible") + 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(str(waitForObject(names.o_Dialysate_Unit).text), config.BLOOD_UNIT) + test.compare(waitForObject(names.o_Dialysate_Unit).visible, True, "dialyste unit is visible") test.log("Test for verifying components of Vitals in Main Treatment ") - test.compare(str(waitForObject(names.o_Vitals).text ), "VITALS" ) - test.compare(waitForObject(names.o_Vitals).visible, True) - test.compare(str(waitForObject(names.o_BloodPressure_Unit).text), "mmHg") - test.compare(waitForObject(names.o_BloodPressure_Unit).visible, True) - test.compare(str(waitForObject(names.o_HeartRate_Unit).text), "BPM") - test.compare(waitForObject(names.o_HeartRate_Unit).visible, True) + 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_BloodPressure_Unit).text), config.BLOOD_PRESSURE_TEXT) + test.compare(waitForObject(names.o_BloodPressure_Unit).visible, True, "Blood pressure unit is visible") + 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.log("Test for verifying components of Pressure in Main Treatment ") - test.compare(str(waitForObject(names.o_pressure).text ), "PRESSURE (mmHg)" ) - test.compare(waitForObject(names.o_pressure).visible, True) - test.compare(str(waitForObject(names.o_Arterial).text ), "Arterial" ) - test.compare(waitForObject(names.o_Arterial).visible, True) - test.compare(str(waitForObject(names.o_Venous).text ), "Venous" ) - test.compare(waitForObject(names.o_Venous).visible, True) + 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.log("Test for verifying components of Time Duration in Main Treatment ") - test.compare(str(waitForObject(names.o_Timeremaining).text ), "Time Remaining" ) - test.compare(waitForObject(names.o_Timeremaining).visible, True) + 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.log("Test for verifying components of Ultrafiltration Volume in Main Treatment ") - test.compare(str(waitForObject(names.o_Ultrafiltration).text ), "ULTRAFILTRATION VOLUME (L)" ) - test.compare(waitForObject(names.o_Ultrafiltration ).visible, True) + test.compare(str(waitForObject(names.o_Ultrafiltration).text ), config.ULTRAFILTERATION_TEXT ) + test.compare(waitForObject(names.o_Ultrafiltration ).visible, True, "ultrafilteration text is visible") test.log("Test for verifying components of Saline Bolus in Main Treatment ") - test.compare(str(waitForObject(names.o_SalineBolus).text ), "SALINE BOLUS" ) - test.compare(waitForObject(names.o_SalineBolus).visible, True) - test.compare(str(waitForObject(names.o_VolumeDelivered).text ), "Volume Delivered" ) - test.compare(waitForObject(names.o_VolumeDelivered).visible, True) + 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_VolumeDElivered_Unit).text ), "mL" ) - test.compare(waitForObject(names.o_VolumeDElivered_Unit).visible, True) - test.compare(str(waitForObject(names.o_CumulativeDElivered).text ), "Cumulative Delivered" ) - test.compare(waitForObject(names.o_CumulativeDElivered).visible, True) - test.compare(str(waitForObject(names.o_CumulativeDelivered_Unit).text ), "mL" ) - test.compare(waitForObject(names.o_CumulativeDelivered_Unit).visible, True) + 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.log("Test for verifying components of Heparin in Main Treatment ") - test.compare(str(waitForObject(names.o_Heparin).text ), "HEPARIN" ) - test.compare(waitForObject(names.o_Heparin).visible, True) - test.compare(str(waitForObject(names.o_Heparin_VolumeDelivered).text ), "Volume Delivered" ) - test.compare(waitForObject(names.o_Heparin_VolumeDelivered).visible, True) - test.compare(str(waitForObject(names.o_Heparin_VolumeDelivered_Unit ).text ), "mL" ) - test.compare(waitForObject(names.o_Heparin_VolumeDelivered_Unit ).visible, True) + 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.endSection() def main(): - utils.tstStart("tst_treatment_monitoring") + utils.tstStart(__file__) utility.start_application(config.AUT_NAME) hd = HDSimulator()