Index: shared/scripts/configuration/config.py =================================================================== diff -u -r1b46227816628d8648501e93e0d392489f0829c3 -r32d23d68ca62013eeec4abdc7e09b2c9e3731f48 --- shared/scripts/configuration/config.py (.../config.py) (revision 1b46227816628d8648501e93e0d392489f0829c3) +++ shared/scripts/configuration/config.py (.../config.py) (revision 32d23d68ca62013eeec4abdc7e09b2c9e3731f48) @@ -8,7 +8,7 @@ # # @file utils.py # -# @author (last) Joseph varghese +# @author (last) LTTS # @date (last) 18-Jan-2022 # ############################################################################ @@ -32,8 +32,97 @@ BLOOD_PRIMING_TEXT = "Blood Priming" SALINE_UNIT = "mL" BLOOD_PRIMING_DEFAULT_VALUE = "0 mL" +SALINE_BOLUS_CUMULATIVE = 300 +# dictionary of rejection reason from application source code. +# message location -> denali-> Headers-> common-> MsgDefs.h +REJECTION_REASON = { + 0 : "REQUEST_REJECT_REASON_NONE" , # Used when there is no rejection + 1 : "REQUEST_REJECT_REASON_NOT_ALLOWED_IN_CURRENT_MODE" , # "REQuest is not allowed in the current operating mode + 2 : "REQUEST_REJECT_REASON_TIMEOUT_WAITING_FOR_USER_CONFIRM" , # Validated "REQuest was not confirmed by user in reasonable time + 3 : "REQUEST_REJECT_REASON_NOT_IN_TREATMENT_MODE" , # "REQuest is not allowed if not in treatment mode + 4 : "REQUEST_REJECT_REASON_INVALID_TREATMENT_STATE" , # "REQuest is not allowed in current treatment state + 5 : "REQUEST_REJECT_REASON_TREATMENT_TOO_CLOSE_TO_FINISHED" , # "REQuest is not allowed so near end of treatment + 6 : "REQUEST_REJECT_REASON_TREATMENT_TIME_OUT_OF_RANGE" , # Treatment duration is out of range + 7 : "REQUEST_REJECT_REASON_TREATMENT_TIME_LESS_THAN_CURRENT" , # Treatment time change is less than currently elapsed treatment time + 8 : "REQUEST_REJECT_REASON_BLOOD_FLOW_OUT_OF_RANGE" , # Blood flow is out of range + 9 : "REQUEST_REJECT_REASON_DIAL_FLOW_OUT_OF_RANGE" , # Dialysate flow is out of range + 10 : "REQUEST_REJECT_REASON_DIAL_VOLUME_OUT_OF_RANGE" , # Dialysate flow rate or treatment duration causes dialysate volume to exceed limit + 11 : "REQUEST_REJECT_REASON_UF_VOLUME_OUT_OF_RANGE" , # Ultrafiltration volume is out of range + 12 : "REQUEST_REJECT_REASON_UF_RATE_OUT_OF_RANGE" , # Ultrafiltration rate is out of range + 13 : "REQUEST_REJECT_REASON_TREATMENT_TIME_LESS_THAN_MINIMUM" , # Treatment time change is less than minimum treatment time + 14 : "REQUEST_REJECT_REASON_UF_NOT_IN_PROGESS" , # Ultrafiltration is not currently in progress + 15 : "REQUEST_REJECT_REASON_UF_NOT_PAUSED" , # Ultrafiltration is not currently paused + 16 : "REQUEST_REJECT_REASON_SALINE_BOLUS_IN_PROGRESS" , # A saline bolus is in progress + 17 : "REQUEST_REJECT_REASON_PARAM_OUT_OF_RANGE" , # A treatment parameter is out of range + 18 : "REQUEST_REJECT_REASON_HEPARIN_PRESTOP_EXCEEDS_DURATION" , # The Heparin pre-stop setting is greater than the treatment duration + 19 : "REQUEST_REJECT_REASON_ARTERIAL_PRESSURE_LOW_VS_HIGH" , # Arterial pressure low and high alarm limits are not inconsistent + 20 : "REQUEST_REJECT_REASON_VENOUS_PRESSURE_LOW_VS_HIGH" , # Venous pressure low and high alarm limits are inconsistent + 21 : "REQUEST_REJECT_REASON_SALINE_MAX_VOLUME_REACHED" , # Saline bolus volume maximum has been reached - no more saline allowed + 22 : "REQUEST_REJECT_REASON_SALINE_BOLUS_NOT_IN_PROGRESS" , # A saline bolus is not in progress + 23 : "REQUEST_REJECT_REASON_ACTION_DISABLED_IN_CURRENT_STATE" , # "REQuested user action is disabled in current state + 24 : "REQUEST_REJECT_REASON_ALARM_IS_ACTIVE" , # "REQuested user action not allowed while alarm is active + 25 : "REQUEST_REJECT_REASON_INVALID_COMMAND" , # "REQuested user action invalid + 26 : "REQUEST_REJECT_REASON_TREATMENT_IS_COMPLETED" , # The treatment has been completed + 27 : "REQUEST_REJECT_REASON_ADDL_RINSEBACK_MAX_VOLUME_REACHED" , # Rinseback additional volume maximum has been reached - no more additional rinsebacks allowed + 28 : "REQUEST_REJECT_REASON_UF_VOLUME_NOT_SET" , # Ultrafiltration volume is not set yet + 29 : "REQUEST_REJECT_REASON_NO_PATIENT_CONNECTION_CONFIRM" , # The user has not confirmed patient connection + 30 : "REQUEST_REJECT_REASON_HEPARIN_PAUSE_INVALID_IN_THIS_STATE" , # Heparin cannot be paused if not currently deliverying Heparin + 31 : "REQUEST_REJECT_REASON_HEPARIN_NOT_PAUSED" , # Heparin cannot be resumed if not paused + 32 : "REQUEST_REJECT_REASON_DG_COMM_LOST" , # Treatment cannot initiate if DG comm is lost + 33 : "REQUEST_REJECT_REASON_DRAIN_NOT_COMPLETE" , # Post-treatment reservoirs drain not complete + 34 : "REQUEST_REJECT_REASON_DG_NOT_IN_STANDBY_IDLE_STATE" , # Treatment cannot initiate if DG is not in standby idle state + 35 : "REQUEST_REJECT_REASON_INVALID_REQUEST_FORMAT" , # "REQuest message not formatted properly + 36 : "REQUEST_REJECT_REASON_INVALID_DATE_OR_TIME" , # Given date/time is invalid + 37 : "REQUEST_REJECT_REASON_NO_NEW_TREATMENT_ALARM_TRIGGERED" , # Treatment cannot initiate if an alarm with no new treatment property has triggered before + 38 : "REQUEST_REJECT_REASON_BATTERY_IS_NOT_CHARGED" , # Battery does not have enough charge to start treatment + 39 : "REQUEST_REJECT_REASON_RINSEBACK_NOT_COMPLETED" , # Cannot move on to recirculate without completing full rinseback +} +NUM_OF_REQUEST_REJECT_REASONS = 39 + +#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 + +#pressure +PRESSURE_STEPS = 10 +ARTERIAL_PRESSURE_MINIMUM = -400 +ARTERIAL_PRESSURE_MAXIMUM = +600 +ARTERIAL_PRESSURE_LOW_MIN = -300 +ARTERIAL_PRESSURE_LOW_DEF = -300 +ARTERIAL_PRESSURE_LOW_MAX = +200 +ARTERIAL_PRESSURE_HIGH_MIN = -300 +ARTERIAL_PRESSURE_HIGH_DEF = +100 +ARTERIAL_PRESSURE_HIGH_MAX = +200 + +VENOUS_PRESSURE_MINIMUM = -100 +VENOUS_PRESSURE_MAXIMUM = +700 +VENOUS_PRESSURE_LOW_MIN = -100 +VENOUS_PRESSURE_LOW_DEF = -100 +VENOUS_PRESSURE_LOW_MAX = +600 +VENOUS_PRESSURE_HIGH_MIN = +100 +VENOUS_PRESSURE_HIGH_DEF = +400 +VENOUS_PRESSURE_HIGH_MAX = +600 + +#main_treatment_flows +BLOOD_FLOW_MINIMUM_VALUE = 100 +BLOOD_FLOW_BUFFER = 25 +FLOW_SLIDER_WIDTH_BUFFER = 37 +BLOOD_FLOW_MAXIMUM_VALUE = 500 +DIALYSATE_FLOW_MINIMUM_VALUE = 0 +DIALYSATE_FLOW_MAXIMUM_VALUE = 0 # Seems to be bug. need change +FLOW_UNIT = "mL/min" +BLOOD_FLOW_TEXT = "blood" +DIALYSATE_FLOW_TEXT = "dialysate" + #main treatment screen VITALS_TITLE = "VITALS" OUT_OF_RANGE_COLOR = "#c53b33" Index: shared/scripts/configuration/utility.py =================================================================== diff -u -r59650aded821ddd00b4e431cb6a44a11484dd23d -r32d23d68ca62013eeec4abdc7e09b2c9e3731f48 --- shared/scripts/configuration/utility.py (.../utility.py) (revision 59650aded821ddd00b4e431cb6a44a11484dd23d) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision 32d23d68ca62013eeec4abdc7e09b2c9e3731f48) @@ -11,66 +11,32 @@ # @date (last) 15-Jan-2022 # ############################################################################ - -import names + +import names +import squish import sys import test + from configuration import config +from dialin.ui import utils from builtins import int as pyInt +from datetime import datetime -def start_application(app_name): - """ - Function to start application and verify application status [running] - If application does not start or running status is false, test stops - Argument: - @param app_name : (str) - Name of the application - @param app_executable : (str) - Actual application - @return: handle for the application if the application is in running state, - or error (exist the application) - """ - counter = 0 - while True: - try: - counter += 1 - test.log("Starting {}".format(app_name)) - squish.startApplication(app_name) - if counter == 1: - test.log("Application launched at the "+str(counter)+" st try.") - elif counter == 2: - test.log("Application launched at the "+str(counter)+" nd try.") - elif counter == 3: - test.log("Application launched at the "+str(counter)+" rd try.") - else: - test.log("Application launched at the "+str(counter)+" th try.") - break - except RuntimeError: - if counter == 1: - test.log("Application failed to launch after "+str(counter)+" try - Please refer logs") - elif counter == 20: - test.log("Exiting after "+str(counter)+ " tries..") - sys.exit(1) - else: - test.log("Application failed to launch after "+str(counter)+ " tries - Please refer logs") - except: - logErrorDetails("Failed to start the application") - sys.exit(1) - - def check_if_object_is_within_the_container(obj=None, container=None): """ check if an object is inside a container - @param obj - child UI object - @param container - container UI object + @param obj - (obj) child UI object + @param container - (obj) container UI object @return boolean true/false """ container = squish.findObject(container) - containerPos = container.mapToGlobal(squish.QPoint(0, 0)) + containerPos = container.mapToGlobal(QPoint(0, 0)) container_x, container_y = pyInt(containerPos.x), pyInt(containerPos.y) container_width, container_height = pyInt(container.width), pyInt(container.height) obj = squish.findObject(obj) - objPos = obj.mapToGlobal(squish.QPoint(0, 0)) + objPos = obj.mapToGlobal(QPoint(0, 0)) obj_x, obj_y = pyInt(objPos.x), pyInt(objPos.y) obj_width, obj_height = pyInt(obj.width), pyInt(obj.height) @@ -103,7 +69,7 @@ screenHeight = pyInt(ScreenObj.height) screenWidth = pyInt(ScreenObj.width) squish.mouseWheel(ScreenObj, screenWidth-1000, - screenHeight-10, 0, -50, squish.Qt.NoModifier) + screenHeight-10, 0, -50, Qt.NoModifier) raise LookupError("zone object is not in view to the user after " + \ "trying 100 times") @@ -115,3 +81,48 @@ def pressure_text_obj(text): names.o_pressure_text_obj["text"] = text return names.o_pressure_text_obj + +def get_current_date_and_time(): + + date_format='%Y/%b/%d - %H:%M' + date = datetime.now() + return str(date.strftime(date_format)) + +def enter_keypad_value(entry): + """ + Method to enter user desired + value using keypad + @param entry: (str) User expected value + """ + test.startSection("Entering {}".format(entry)) + for value in entry: + value = pyInt(value) + key_val = squish.waitForObject(keypad_input(value)) + squish.mouseClick(key_val) + utils.waitForGUI(1) + test.endSection() + +def erase_entered_value(input_field): + """ + Method to erase the entered value + @param input_field - (obj) object of input field + """ + test.startSection("Erasing value") + input_field= squish.waitForObject(input_field) + entered_value = str(input_field.text) + for value in entered_value: + utils.waitForGUI(1) + squish.mouseClick(squish.waitForObjectExists(names.o_back_space_key)) + + test.compare(str(input_field.text), "", "Input field should be empty") + test.endSection() + +def vitals_reading_obj(reading): + names.o_vitals_reading["text"] = reading + return names.o_vitals_reading + +def keypad_input(key_value): + names.o_keypad_input["text"] = key_value + return names.o_keypad_input + + Index: shared/scripts/names.py =================================================================== diff -u -rb38389f9f6ed5e603368e16902671b824d8c9202 -r32d23d68ca62013eeec4abdc7e09b2c9e3731f48 --- shared/scripts/names.py (.../names.py) (revision b38389f9f6ed5e603368e16902671b824d8c9202) +++ shared/scripts/names.py (.../names.py) (revision 32d23d68ca62013eeec4abdc7e09b2c9e3731f48) @@ -1,10 +1,15 @@ # encoding: UTF-8 -from objectmaphelper import * +# Top Parents +o_QQuickView = { "type": "QQuickView"} +o_Overlay = {"container": o_QQuickView, "type": "Overlay"} +o_Gui_MainView = { "type": "Gui::MainView" } + + o_Gui_MainView = {"type": "Gui::MainView", "unnamed": 1, "visible": True} o_Overlay = {"container": o_Gui_MainView, "type": "Overlay", "unnamed": 1, "visible": True} o_borderRect_Rectangle = {"container": o_Overlay, "gradient": 0, "id": "_borderRect", "type": "Rectangle", "unnamed": 1, "visible": True} @@ -46,11 +51,74 @@ o_edit_uf_value = {"container": o_Overlay, "text": "EDIT ULTRAFILTRATION VOLUME", "type": "Text", "unnamed": 1, "visible": True} o_uf_back_button = {"container": o_Overlay, "text": "BACK", "type": "Text", "unnamed": 1, "visible": True} o_uf_close_button = {"container": o_Overlay, "id": "_image", "source": "qrc:/images/iClose", "type": "Image", "unnamed": 1, "visible": True} -o_fluid_text = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "text": "Volume Delivered", "type": "Text", "unnamed": 1, "visible": True} o_cumulative_fluid_text = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "text": "Cumulative Delivered", "type": "Text", "unnamed": 1, "visible": True} +# Saline Bolus +o_treatmentHome = {"container": o_QQuickView , "id": "_treatmentHome" , "type": "TreatmentHome", "unnamed": 1, "visible": True} +o_treatmentStart_TreatmentStart = {"container": o_QQuickView, "id": "_treatmentStart", "type": "TreatmentStart", "unnamed": 1, "visible": True} +o_fluid_text = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "text": "Volume Delivered", "type": "Text", "unnamed": 1, "visible": True} +o_treatmentStart_SalineSection = {"container": o_treatmentHome, "id": "_salineTouchArea", "type": "TreatmentSaline", "unnamed": 1, "visible": True} +o_treatmentHome_mL_Text = {"container": o_treatmentHome, "text": "mL", "type": "Text", "unnamed": 1, "visible": True} +o_treatmentHome_cumalative_value = {"container": o_treatmentHome, "occurrence": 39, "type": "Text", "unnamed": 1, "visible": True} +o_treatmentHome_cumalative_unit = {"container": o_treatmentHome, "occurrence": 38, "type": "Text", "unnamed": 1, "visible": True} +o_treatmentHome_delivered_value = {"container": o_treatmentHome, "occurrence": 36, "type": "Text", "unnamed": 1, "visible": True} +o_treatmentHome_delivered_unit = {"container": o_treatmentHome, "occurrence": 35, "type": "Text", "unnamed": 1, "visible": True} +o_treatmentHome_ultrafiltrationTouchArea_TreatmentUltrafiltration = {"container": o_treatmentHome, "id": "_ultrafiltrationTouchArea", "type": "TreatmentUltrafiltration", "unnamed": 1, "visible": True} +o_treatmentHome_startFluidButton_TouchRect = {"container": o_treatmentHome, "id": "_startFluidButton", "type": "TouchRect", "unnamed": 1, "visible": True} +o_treatment_notification_rejection = {"container": ":o_treatmentHome", "occurrence": 3, "objectName": "NotificationBar", "type": "NotificationBarSmall", "visible": True} +#main treatment pressure +#arterial title text +o_arterial_title = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "text": "Arterial", "type": "Text", "unnamed": 1, "visible": True} +#pressure adjustment pop up related objects +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} +o_pressure_text_obj = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "type": "Text", "unnamed": 1, "visible": True} +o_pop_up_rejected_msg = {"container": o_Overlay, "type": "Text", "unnamed": 1, "visible": True} +# Pressure Adjustment +o_treatmentAdjustmentPressures_Screen = {"container": o_Overlay, "objectName": "TreatmentAdjustmentPressures", "type": "ContentItem"} +# arterial pressure range slider +o_arterial_range_slider = {"container": o_treatmentAdjustmentPressures_Screen, "id": "_arterialPressure", "type": "PressureRangeSlider"} +# arterial progress +o_arterial_progress = {"container": o_arterial_range_slider , "id": "_pressureRangeBar", "type": "RangeBar"} +o_arterial_marker = {"container": o_arterial_progress, "id": "_rangeMarkerValue", "type": "RangeMarker"} +o_arterial_progress_text_value = {"container": o_arterial_marker, "id": "_textValue", "type": "Text"} +# arterial slider +o_arterial_slider = {"container": o_arterial_range_slider, "id": "_pressureSlider" , "type": "RangeSlider"} +# arterial limits bar +o_arterial_limitbar = {"container": o_arterial_range_slider, "id": "_rangeRect", "type": "RangeRect"} +# venous pressure range slider +o_venous_range_slider= {"container": o_treatmentAdjustmentPressures_Screen, "id": "_venousPressure", "type": "PressureRangeSlider"} +o_venous_progress = {"container": o_venous_range_slider , "id": "_pressureRangeBar", "type": "RangeBar"} +o_venous_marker = {"container": o_venous_progress , "id": "_rangeMarkerValue", "type": "RangeMarker" } +o_venous_progress_text_value = {"container": o_venous_marker , "id": "_textValue", "type": "Text"} +# venous progress +o_venous_slider = {"container": o_venous_range_slider , "id": "_pressureSlider" , "type": "RangeSlider" } +o_venous_limitbar = {"container": o_venous_range_slider, "id": "_rangeRect" , "type": "RangeRect"} +#arterial adjustment low slider title text +o_arterial_text_low = {"container": o_Overlay, "text": "LOW", "type": "Text", "unnamed": 1, "visible": True} +#venous adjustment low slider title text +o_venous_text_low = {"container": o_Overlay, "occurrence": 2, "text": "LOW", "type": "Text", "unnamed": 1, "visible": True} + +#flows +o_treatment_blood_flow_touch_area = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "text": "FLOWS", "type": "Text", "unnamed": 1, "visible": True} +o_treatmentStart_TreatmentStart = {"container": o_QQuickView, "id": "_treatmentStart", "type": "TreatmentStart", "unnamed": 1, "visible": True} +o_treatment_blood_flow_rate = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "id": "_bloodFlow", "type": "TextRect", "unnamed": 1, "visible": True} +o_treatment_dialysate_flow_rate = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "id": "_dialysateInletFlow", "type": "TextRect", "unnamed": 1, "visible": True} +o_treatment_blood_flow_adjustment = {"container": o_Overlay, "id": "_bloodFlowTextRect", "type": "TextRect", "unnamed": 1, "visible": True} +o_treatment_dialysate_flow_adjustment = {"container": o_Overlay, "id": "_dialysateInletFlowTextRect", "type": "TextRect", "unnamed": 1, "visible": True} +o_treatment_flow_adjustment_close = {"container": o_Overlay, "id": "_closeButton", "type": "CloseButton", "unnamed": 1, "visible": True} +o_treatment_notification_bar = {"container": o_Overlay, "type": "Text", "unnamed": 1, "visible": True} +o_dialysateFlowSlider_Slider = {"container": o_Overlay, "id": "_dialysateFlowSlider", "type": "Slider", "unnamed": 1, "visible": True} +o_blood_flow_slider = {"container": o_Overlay, "id": "_bloodFlowSlider", "type": "Slider", "unnamed": 1, "visible": True} +o_blood_flow_minimum_value = {"container": o_Overlay, "text": "100mL/min", "type": "Text", "unnamed": 1, "visible": True} +o_blood_flow_maximum_value = {"container": o_Overlay, "text": "500mL/min", "type": "Text", "unnamed": 1, "visible": True} +o_dialysate_flow_minimum_value = {"container": o_Overlay, "text": "0mL/min", "type": "Text", "unnamed": 1, "visible": True} +o_dialysate_flow_maximum_value = {"container": o_Overlay, "occurrence": 2, "text": "0mL/min", "type": "Text", "unnamed": 1, "visible": True} +o_handler_Rectangle = {"container": o_Overlay, "gradient": 0, "id": "_handler", "type": "Rectangle", "unnamed": 1, "visible": True} + #vitals #vitals title text on main-treatment screen o_vitals_title = {"container": o_treatmentStack_treatmentHome_TreatmentHome, "text": "VITALS", "type": "Text", "unnamed": 1, "visible": True} @@ -77,3 +145,4 @@ o_keypad_input = {"container": o_Gui_MainView, "id":"keyText", "type": "Text", "unnamed": 1, "visible": True} #virtal keypad back space key o_back_space_key = {"container": o_Gui_MainView, "id": "backspaceKeyIcon", "source": "qrc:/QtQuick/VirtualKeyboard/content/styles/default/images/backspace-868482.svg", "type": "Image", "unnamed": 1, "visible": True} + Index: suite.conf =================================================================== diff -u -r7a2847fdd205e5af497cadec27c9f6d52429cf9e -r32d23d68ca62013eeec4abdc7e09b2c9e3731f48 --- suite.conf (.../suite.conf) (revision 7a2847fdd205e5af497cadec27c9f6d52429cf9e) +++ suite.conf (.../suite.conf) (revision 32d23d68ca62013eeec4abdc7e09b2c9e3731f48) @@ -4,6 +4,6 @@ IMPLICITAUTSTART=0 LANGUAGE=Python OBJECTMAPSTYLE=script -TEST_CASES=tst_environment tst_post tst_standbymode tst_In_treatment tst_main_treatment_vitals +TEST_CASES=tst_environment tst_post tst_standbymode tst_In_treatment tst_main_treatment_pressure tst_treatment_blood_dialysateflow_rate tst_main_treatment_vitals VERSION=3 WRAPPERS=Qt