Index: shared/scripts/configuration/config.py =================================================================== diff -u -r0cc92d3b75bfb96dc4ecafd760a9ce15e455033b -r0e9cae82c094cbe4be02dcb00cabf1999c56fbe8 --- shared/scripts/configuration/config.py (.../config.py) (revision 0cc92d3b75bfb96dc4ecafd760a9ce15e455033b) +++ shared/scripts/configuration/config.py (.../config.py) (revision 0e9cae82c094cbe4be02dcb00cabf1999c56fbe8) @@ -30,5 +30,8 @@ GOODEVENING_START_TIME_SEC = 43200 BLOOD_PRIMING_TEXT = "Blood Priming" -SALINE_UNIT = "mL" +LIQUID_UNIT = "mL" BLOOD_PRIMING_DEFAULT_VALUE = "0 mL" +BLOOD_PRIMING_RANGE = 300 + + Index: shared/scripts/configuration/utility.py =================================================================== diff -u -r0cc92d3b75bfb96dc4ecafd760a9ce15e455033b -r0e9cae82c094cbe4be02dcb00cabf1999c56fbe8 --- shared/scripts/configuration/utility.py (.../utility.py) (revision 0cc92d3b75bfb96dc4ecafd760a9ce15e455033b) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision 0e9cae82c094cbe4be02dcb00cabf1999c56fbe8) @@ -86,7 +86,7 @@ """ scroll to the numeric if object is hidden @param zone - UI object - @param screen_object - UI object (UI Home screen = waveforms + numerics) + @param screen_object - UI object @return boolean true/false """ counter = 0 Index: shared/scripts/names.py =================================================================== diff -u -r0cc92d3b75bfb96dc4ecafd760a9ce15e455033b -r0e9cae82c094cbe4be02dcb00cabf1999c56fbe8 --- shared/scripts/names.py (.../names.py) (revision 0cc92d3b75bfb96dc4ecafd760a9ce15e455033b) +++ shared/scripts/names.py (.../names.py) (revision 0e9cae82c094cbe4be02dcb00cabf1999c56fbe8) @@ -48,6 +48,35 @@ o_cumulative_fluid_text = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "text": "Cumulative Delivered", "type": "Text", "unnamed": 1, "visible": True} +# main screen monitoring parameters +o_flowRectangle= {"container": o_treatmentStack_treatmentHome_TreatmentHome, "gradient": 0, "id": "_flowsTouchArea", "type": "TouchArea", "unnamed": 1, "visible": True} +o_Flows = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "text": "FLOWS","type":"Text", "unnamed": 1, "visible": True} +o_pressure = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "text": "PRESSURE (mmHg)", "type": "Text", "unnamed": 1, "visible": True} +o_Arterial = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "text": "Arterial", "type": "Text", "unnamed": 1, "visible": True} +o_Venous = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "text": "Venous", "type": "Text", "unnamed": 1, "visible": True} +o_Timeremaining = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "text": "Time Remaining", "type": "Text", "unnamed": 1, "visible": True} +o_Ultrafiltration = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "text": "ULTRAFILTRATION VOLUME (L)", "type": "Text", "unnamed": 1, "visible": True} +o_Blood = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "text": "Blood", "type": "Text", "unnamed": 1, "visible": True} +o_Blood_Unit = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "text": "mL/min", "type": "Text", "unnamed": 1, "visible": True} +o_Dialysate = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "text": "Dialysate", "type": "Text", "unnamed": 1, "visible": True} +o_Dialysate_Unit = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "occurrence": 2, "text": "mL/min", "type": "Text", "unnamed": 1, "visible": True} +o_Vitals = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "text": "VITALS", "type": "Text", "unnamed": 1, "visible": True} +o_BloodPressure_Unit = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "text": "mmHg", "type": "Text", "unnamed": 1, "visible": True} +o_HeartRate_Unit = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "text": "BPM", "type": "Text", "unnamed": 1, "visible": True} +o_SalineBolus = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "text": "SALINE BOLUS", "type": "Text", "unnamed": 1, "visible": True} +o_VolumeDelivered = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "text": "Volume Delivered", "type": "Text", "unnamed": 1, "visible": True} +o_VolumeDElivered_Unit = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "text": "mL", "type": "Text", "unnamed": 1, "visible": True} +o_CumulativeDElivered = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "text": "Cumulative Delivered", "type": "Text", "unnamed": 1, "visible": True} +o_CumulativeDelivered_Unit = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "occurrence": 2, "text": "mL", "type": "Text", "unnamed": 1, "visible": True} +o_Heparin = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "text": "HEPARIN", "type": "Text", "unnamed": 1, "visible": True} +o_Heparin_VolumeDelivered = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "occurrence": 2, "text": "Volume Delivered", "type": "Text", "unnamed": 1, "visible": True} +o_Heparin_VolumeDelivered_Unit = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "occurrence": 3, "text": "mL", "type": "Text", "unnamed": 1, "visible": True} +o_TreatmentBloodPrime_backgroundRect_Rectangle = {"container": o_treatmentStack_TreatmentBloodPrime_ScreenItem, "gradient": 0, "id": "_backgroundRect", "type": "Rectangle", "unnamed": 1, "visible": True} +o_blood_Prime_Value = {"container": o_Gui_MainView, "id": "_shape", "type": "Shape", "unnamed": 1, "visible": True} +o_blood_Prime_Current_Value = {"container": o_treatmentStack_TreatmentBloodPrime_ScreenItem, "id": "_circle", "type": "ProgressCircle", "unnamed": 1, "visible": True} +o_target_value={"container": o_treatmentStack_TreatmentBloodPrime_ScreenItem, "id": "_circle", "type": "ProgressCircle", "unnamed": 1, "visible": True} +o_treatmentHome_backgroundRect_Rectangle = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "gradient": 0, "id": "_backgroundRect", "type": "Rectangle", "unnamed": 1, "visible": True} +o_treatmentHome_TimeText_timeSeparator_Text = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "objectName": "_TimeText_timeSeparator", "type": "Text", "visible": True} +o_confirmButton_TouchRect_2 = {"container": o_Overlay, "gradient": 0, "id": "_confirmButton", "type": "TouchRect", "unnamed": 1, "visible": True} +o_timeText = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "gradient": 0, "objectName": "_TimeText", "type": "TimeText", "visible": True} - - Index: tst_In_treatment/test.py =================================================================== diff -u -r0cc92d3b75bfb96dc4ecafd760a9ce15e455033b -r0e9cae82c094cbe4be02dcb00cabf1999c56fbe8 --- tst_In_treatment/test.py (.../test.py) (revision 0cc92d3b75bfb96dc4ecafd760a9ce15e455033b) +++ tst_In_treatment/test.py (.../test.py) (revision 0e9cae82c094cbe4be02dcb00cabf1999c56fbe8) @@ -81,7 +81,7 @@ """ saline_text = waitForObject(names.o_cumulative_fluid_text) saline_unit = object.children(saline_text)[0] - if saline_unit.text == config.SALINE_UNIT: + if saline_unit.text == config.LIQUID_UNIT: saline_cumulative = object.children(saline_text)[1] test.compare(pyStr(expected_cumulative_value), pyStr(saline_cumulative.text)) else: @@ -96,7 +96,7 @@ """ saline_text = waitForObject(names.o_fluid_text) saline_unit = object.children(saline_text)[1] - if saline_unit.text == config.SALINE_UNIT: + if saline_unit.text == config.LIQUID_UNIT: saline_cumulative = object.children(saline_text)[2] test.compare(pyStr(expected_delivered_value), pyStr(saline_cumulative.text)) else: Index: tst_treatment_monitoring/test.py =================================================================== diff -u --- tst_treatment_monitoring/test.py (revision 0) +++ tst_treatment_monitoring/test.py (revision 0e9cae82c094cbe4be02dcb00cabf1999c56fbe8) @@ -0,0 +1,143 @@ +# -*- 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, utility + + +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. + """ + 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) + test.compare(expected_blood_prime_value, bloodprime_unit.text) + + +def verification_of_blood_prime_from_dialysis_state(hd_instance): + """ + Tests for verification of blood prime UI section. + @param hd_instance - instance for hd simulator. + @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 (150, 300): + 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) + test_blood_prime_value(expected_blood_prime_value = current_range) + utils.waitForGUI(1.5) #For fetching the effect in UI + + test.endSection() + + +def monitoring_treatment_parameters(hd_instnace): + """ + Tests for monitoring treatment parameters. + @param: hd_instance - instance for hd simulator. + @return: N/A + """ + test.startSection("Verification of treatment parameters") + hd_instnace.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) + + 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.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.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.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.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.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_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.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.endSection() + + +def main(): + + utils.tstStart("tst_treatment_monitoring") + utility.start_application(config.AUT_NAME) + + hd = HDSimulator() + + hd.cmd_send_power_on_self_test_version_request() + hd._handler_ui_first_check_in(message = None) + + hd.cmd_send_hd_operation_mode(6, 0) + verification_of_blood_prime_from_dialysis_state(hd) + monitoring_treatment_parameters(hd) + + utils.waitForGUI(0.5) + + utils.tstDone() + + \ No newline at end of file