# -*- coding: utf-8 -*-" # Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. # copyright # THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, # IN PART OR IN WHOLE, # WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. # file tst_treatment monitoring. # @author Akshay Rajaram Dhawan # @author Sai Chaitanya Ela # @author Shweta Policepatil # @author Amol Shinde # @date 07-02-2022 # This test contradicts verification of Main Treatment monitoring screen parameters components import names from dialin.ui import utils from dialin.ui.hd_simulator import HDSimulator from configuration import config BLOOD_PRIMING_TARGET_VALUE = 150 hd_simulator = HDSimulator() def test_blood_prime_value(expected_blood_prime_value): """ Tests to verify target values from blood prime section. @param: expected_blood_prime_value - expected blood prime value. @return: N/A """ expected_blood_prime_value = str(expected_blood_prime_value) +" "+config.LIQUID_UNIT test.compare(expected_blood_prime_value, waitForObject(names.o_target_value).text) def verification_of_blood_prime_from_dialysis_state(): """ Tests for verification of blood prime UI section. @param N/A @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") 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): hd_simulator.cmd_send_treatment_blood_prime_data(target = target_range,current = current_range) test_blood_prime_value(expected_blood_prime_value = current_range) utils.waitForGUI(0.3) #For fetching the effect in UI test.endSection() def 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.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(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 ), 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 ), 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 ), 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 ), 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 ), 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, "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 ), 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(__file__) startApplication(config.AUT_NAME) utils.waitForGUI(2) hd_simulator.cmd_send_hd_operation_mode(6, 0) verification_of_blood_prime_from_dialysis_state() monitoring_treatment_parameters() utils.tstDone()