Index: shared/scripts/configuration/config.py =================================================================== diff -u -r0cc92d3b75bfb96dc4ecafd760a9ce15e455033b -ra470470339846e1134af7c57024c25180b8778a6 --- shared/scripts/configuration/config.py (.../config.py) (revision 0cc92d3b75bfb96dc4ecafd760a9ce15e455033b) +++ shared/scripts/configuration/config.py (.../config.py) (revision a470470339846e1134af7c57024c25180b8778a6) @@ -32,3 +32,60 @@ BLOOD_PRIMING_TEXT = "Blood Priming" SALINE_UNIT = "mL" BLOOD_PRIMING_DEFAULT_VALUE = "0 mL" + + +#main treatment pressure +PRESSURE_TITLE = "PRESSURES" +ARTERIAL_TITLE = "Arterial" +VENOUS_TITLE = "Venous" +VENOUS_UOM = "mmHg" +ARTERIAL_UOM = "mmHg" +LOW_TEXT = "LOW" +HIGH_TEXT = "HIGH" + + +ACCEPTED = True +REJECTED = False + +REJECTION_REASON = { + 0: "No Active Alarm List", + 1: "REQUEST_REJECT_REASON_NOT_ALLOWED_IN_CURRENT_MODE", + 2: "REQUEST_REJECT_REASON_TIMEOUT_WAITING_FOR_USER_CONFIRM", + 3: "REQUEST_REJECT_REASON_NOT_IN_TREATMENT_MODE", + 4: "REQUEST_REJECT_REASON_INVALID_TREATMENT_STATE", + 5: "REQUEST_REJECT_REASON_TREATMENT_TOO_CLOSE_TO_FINISHED", + 6: "REQUEST_REJECT_REASON_TREATMENT_TIME_OUT_OF_RANGE", + 7: "REQUEST_REJECT_REASON_TREATMENT_TIME_LESS_THAN_CURRENT", + 8: "REQUEST_REJECT_REASON_BLOOD_FLOW_OUT_OF_RANGE", + 9: "REQUEST_REJECT_REASON_DIAL_FLOW_OUT_OF_RANGE", + 10: "REQUEST_REJECT_REASON_DIAL_VOLUME_OUT_OF_RANGE", + 11: "REQUEST_REJECT_REASON_UF_VOLUME_OUT_OF_RANGE", + 12: "REQUEST_REJECT_REASON_UF_RATE_OUT_OF_RANGE", + 13: "REQUEST_REJECT_REASON_TREATMENT_TIME_LESS_THAN_MINIMUM", + 14: "REQUEST_REJECT_REASON_UF_NOT_IN_PROGESS", + 15: "REQUEST_REJECT_REASON_UF_NOT_PAUSED", + 16: "REQUEST_REJECT_REASON_SALINE_BOLUS_IN_PROGRESS", + 17: "REQUEST_REJECT_REASON_PARAM_OUT_OF_RANGE", + 18: "REQUEST_REJECT_REASON_HEPARIN_PRESTOP_EXCEEDS_DURATION", + 19: "REQUEST_REJECT_REASON_ARTERIAL_PRESSURE_LOW_VS_HIGH", + 20: "REQUEST_REJECT_REASON_VENOUS_PRESSURE_LOW_VS_HIGH", + 21: "REQUEST_REJECT_REASON_SALINE_MAX_VOLUME_REACHED", + 22: "REQUEST_REJECT_REASON_SALINE_BOLUS_NOT_IN_PROGRESS", + 23: "REQUEST_REJECT_REASON_ACTION_DISABLED_IN_CURRENT_STATE", + 24: "REQUEST_REJECT_REASON_ALARM_IS_ACTIVE", + 25: "REQUEST_REJECT_REASON_INVALID_COMMAND", + 26: "REQUEST_REJECT_REASON_TREATMENT_IS_COMPLETED", + 27: "REQUEST_REJECT_REASON_ADDL_RINSEBACK_MAX_VOLUME_REACHED", + 28: "REQUEST_REJECT_REASON_UF_VOLUME_NOT_SET", + 29: "REQUEST_REJECT_REASON_NO_PATIENT_CONNECTION_CONFIRM", + 30: "REQUEST_REJECT_REASON_HEPARIN_PAUSE_INVALID_IN_THIS_STATE", + 31: "REQUEST_REJECT_REASON_HEPARIN_NOT_PAUSED", + 32: "REQUEST_REJECT_REASON_DG_COMM_LOST", + 33: "REQUEST_REJECT_REASON_DRAIN_NOT_COMPLETE", + 34: "REQUEST_REJECT_REASON_DG_NOT_IN_STANDBY_IDLE_STATE", + 35: "REQUEST_REJECT_REASON_INVALID_REQUEST_FORMAT", + 36: "REQUEST_REJECT_REASON_INVALID_DATE_OR_TIME", + 37: "REQUEST_REJECT_REASON_NO_NEW_TREATMENT_ALARM_TRIGGERED", + 38: "REQUEST_REJECT_REASON_BATTERY_IS_NOT_CHARGED", + 39: "REQUEST_REJECT_REASON_RINSEBACK_NOT_COMPLETED", + } \ No newline at end of file Index: shared/scripts/names.py =================================================================== diff -u -rd3cef2c4000a013d7cc1e7f3569b23daf4f8db3b -ra470470339846e1134af7c57024c25180b8778a6 --- shared/scripts/names.py (.../names.py) (revision d3cef2c4000a013d7cc1e7f3569b23daf4f8db3b) +++ shared/scripts/names.py (.../names.py) (revision a470470339846e1134af7c57024c25180b8778a6) @@ -50,10 +50,13 @@ #main treatment pressure o_arterial_title = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "text": "Arterial", "type": "Text", "unnamed": 1, "visible": True} -o_pop_pressure_title = {"container": o_Overlay, "text": "PRESSURES", "type": "Text", "unnamed": 1, "visible": True} +o_pop_up_pressure_text_obj = {"container": o_Overlay, "type": "Text", "unnamed": 1, "visible": True} +o_pop_up_close_btn = {"container": o_Overlay, "id": "_image", "source": "qrc:/images/iClose", "type": "Image", "unnamed": 1, "visible": True} +o_pop_up_confirm_btn = {"container": o_Overlay, "text": "CONFIRM", "type": "Text", "unnamed": 1, "visible": True} +def pressure_pop_up_text_obj(text): + o_pop_up_pressure_text_obj["text"] = text + return o_pop_up_pressure_text_obj - - Index: suite.conf =================================================================== diff -u -r8df6f936193bbd9127d3ec940562e62db0060bcb -ra470470339846e1134af7c57024c25180b8778a6 --- suite.conf (.../suite.conf) (revision 8df6f936193bbd9127d3ec940562e62db0060bcb) +++ suite.conf (.../suite.conf) (revision a470470339846e1134af7c57024c25180b8778a6) @@ -1,6 +1,6 @@ AUT=denaliSquish LANGUAGE=Python OBJECTMAPSTYLE=script -TEST_CASES=tst_environment tst_post tst_standbymode tst_In_treatment +TEST_CASES=tst_environment tst_post tst_standbymode tst_In_treatment tst_main_treatment_pressure VERSION=3 WRAPPERS=Qt Index: tst_main_treatment_pressure/test.py =================================================================== diff -u --- tst_main_treatment_pressure/test.py (revision 0) +++ tst_main_treatment_pressure/test.py (revision a470470339846e1134af7c57024c25180b8778a6) @@ -0,0 +1,127 @@ +# -*- 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_main_treatment_pressure +# date 18/feb/2022 +# author Papiya Mandal + +import names + +from configuration.config import * +from configuration.utility import * +from dialin.ui import utils +from dialin.ui.hd_simulator import HDSimulator + +hd = HDSimulator() + +def main(): + + utils.tstStart(__file__) + start_application(AUT_NAME) + + hd.cmd_send_power_on_self_test_version_request() + hd.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) + + + set_arterial_and_venous_pressure(accepted=ACCEPTED, reason=2, + art_low=-150, art_high=150, ven_low=-200, + ven_high=100) + + snooze(5) + + open_pressure_pop_up() + + +def set_arterial_and_venous_pressure(accepted, reason, + art_low, art_high, ven_low, ven_high, \ + ): + """ + Method to set the Arterial and Venous + high and low pressure value + @param accepted: (int) boolean accept/reject response + @param reason: (int) rejection reason + @param arterial_low: (int) Arterial Pressure Limit Low (mmHg) + @param arterial_high: (int) Arterial Pressure Limit High (mmHg) + @param venous_low: (int) Venous Pressure Limit Low (mmHg) + @param venous_high: (int) Venous Pressure Limit High (mmHg) + @return: none + """ + test.startSection("Set Arterial Low to '{art_low}' ".format(art_low=art_low) + + "Arterial High to '{art_high}' ".format(art_high=art_high) + + "Venous Low to '{ven_low}' ".format(ven_low=ven_low) + + "and Venous High to '{ven_high}'".format(ven_high=ven_high)) + + hd.cmd_send_treatment_adjust_pressures_limit_response(accepted=accepted, + reason=reason, + arterial_low=art_low, + arterial_high=art_high, + venous_low=ven_low, + venous_high=ven_high) + test.endSection() + + +def open_pressure_pop_up(): + """ + Method to open the pressure pop up + and verify pop is opened + """ + test.startSection("Open 'Pressure' pop up") + + pressure_touch_area = object.parent(waitForObjectExists(names.o_arterial_title)) + mouseClick(pressure_touch_area) + + test.log("Verifying 'pressure' pop up is opened") + test.log("Verifying 'Pressure' title") + pressure_title = waitForObject(names.pressure_pop_up_text_obj(\ + text=PRESSURE_TITLE)) + pressure_title = pressure_title.text.toUtf8().constData() + test.compare(pressure_title, PRESSURE_TITLE, + "Pressure title should be '{title}'".format(title=PRESSURE_TITLE)) + + arterial_title = waitForObject(names.pressure_pop_up_text_obj(\ + text=ARTERIAL_TITLE)) + arterial_title = arterial_title.text.toUtf8().constData() + test.compare(arterial_title, ARTERIAL_TITLE, + "Arterial title should be '{title}'".format(title=ARTERIAL_TITLE)) + art_uom = waitForObject(names.pressure_pop_up_text_obj(\ + text=ARTERIAL_UOM)) + art_uom = art_uom.text.toUtf8().constData() + test.compare(art_uom, ARTERIAL_UOM, + "Arterial unit of measurement should be " + + "'{uom}'".format(uom=ARTERIAL_UOM)) + + venous_title = waitForObject(names.pressure_pop_up_text_obj(\ + text=VENOUS_TITLE)) + venous_title = venous_title.text.toUtf8().constData() + test.compare(venous_title, VENOUS_TITLE, + "Venous title should be '{title}'".format(title=VENOUS_TITLE)) + ven_uom = waitForObject(names.pressure_pop_up_text_obj(\ + text=VENOUS_UOM)) + ven_uom = ven_uom.text.toUtf8().constData() + test.compare(ven_uom, VENOUS_UOM, + "Venous unit of measurement should be " + + "'{uom}'".format(uom=VENOUS_UOM)) + test.endSection() + + + + + + + + + + + + + + +