Index: shared/scripts/configuration/config.py =================================================================== diff -u -r3cdfabd1b4528506c3dc52e1557711fd4b72c999 -r5e1b3686da46f4401f11a6d0ffe8e650f7c89417 --- shared/scripts/configuration/config.py (.../config.py) (revision 3cdfabd1b4528506c3dc52e1557711fd4b72c999) +++ shared/scripts/configuration/config.py (.../config.py) (revision 5e1b3686da46f4401f11a6d0ffe8e650f7c89417) @@ -44,6 +44,65 @@ PRE_TREATMENT_SCREENS = ["Create" , "Sample" , "Consumables" , "Disposables" , "Prime" , "Ultrafiltration" , "BP/HR" , "Connection" , "Start"] UF_MINIMUM_SLIDER_WIDTH = -2 UF_MAXIMUM_SLIDER_WIDTH = 638.00 +UF_VALID_RANGE = 700 +# 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 + + + + + + + + + + + + Index: shared/scripts/names.py =================================================================== diff -u -r3cdfabd1b4528506c3dc52e1557711fd4b72c999 -r5e1b3686da46f4401f11a6d0ffe8e650f7c89417 --- shared/scripts/names.py (.../names.py) (revision 3cdfabd1b4528506c3dc52e1557711fd4b72c999) +++ shared/scripts/names.py (.../names.py) (revision 5e1b3686da46f4401f11a6d0ffe8e650f7c89417) @@ -79,6 +79,9 @@ o_PreTreatmentStack_PreTreatmentSampleStack_PreTreatmentWaterSampleStack = {"container": o_PreTreatmentStack_PreTreatmentStack, "objectName": "_PreTreatmentSampleStack", "type": "PreTreatmentWaterSampleStack", "visible": True} o_PreTreatmentSampleStack_PreTreatmentBase_TreatmentFlowBase = {"container": o_PreTreatmentStack_PreTreatmentSampleStack_PreTreatmentWaterSampleStack, "objectName": "_PreTreatmentBase", "type": "TreatmentFlowBase", "visible": True} o_PreTreatmentUltrafiltration_volumeSlider_Slider = {"container": o_PreTreatmentConsumblesStack_PreTreatmentUltrafiltration_PreTreatmentUltrafiltration, "objectName": "_volumeSlider", "type": "Slider", "visible": True} +o_PreTreatmentUltrafiltration_Ultrafiltration_Volume_L_Text = {"container": o_PreTreatmentConsumblesStack_PreTreatmentUltrafiltration_PreTreatmentUltrafiltration, "text": "Ultrafiltration Volume (L)", "type": "Text", "unnamed": 1, "visible": True} +o_PreTreatmentUltrafiltration_Ultrafiltration_Setup_Text = {"container": o_PreTreatmentConsumblesStack_PreTreatmentUltrafiltration_PreTreatmentUltrafiltration, "text": "Ultrafiltration Setup", "type": "Text", "unnamed": 1, "visible": True} +o_PreTreatmentUltrafiltration_CONFIRM_Text = {"container": o_PreTreatmentConsumblesStack_PreTreatmentUltrafiltration_PreTreatmentUltrafiltration, "text": "CONFIRM", "type": "Text", "unnamed": 1, "visible": True} #o_pppppppp = {"container": o_PreTreatmentConsumblesStack_PreTreatmentBase_TreatmentFlowBase, "occurrence": 2, "type": "StepBullet", "unnamed": 1, "visible": True} Fisheye: Tag 5e1b3686da46f4401f11a6d0ffe8e650f7c89417 refers to a dead (removed) revision in file `tst_In_treatment/verificationPoints/VP1'. Fisheye: No comparison available. Pass `N' to diff? Index: tst_pre_treatment_patient_connection/test.py =================================================================== diff -u -r3cdfabd1b4528506c3dc52e1557711fd4b72c999 -r5e1b3686da46f4401f11a6d0ffe8e650f7c89417 --- tst_pre_treatment_patient_connection/test.py (.../test.py) (revision 3cdfabd1b4528506c3dc52e1557711fd4b72c999) +++ tst_pre_treatment_patient_connection/test.py (.../test.py) (revision 5e1b3686da46f4401f11a6d0ffe8e650f7c89417) @@ -1,18 +1,30 @@ # -*- 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_pre_treatment_patient_connection +# date 2020/03/12 +# author Joseph Varghese +# +# NOTE: +# This test contradicts verification of patient connection screens. +# section - import names from dialin.ui.hd_simulator import HDSimulator from dialin.ui.dg_simulator import DGSimulator from dialin.ui import utils from configuration import config, utility hd_simulator = HDSimulator() -dg_simulator = DGSimulator() -pre_treatment_step = 5 +PRE_TREATMENT_STEPS = 5 TREATMENT_ULTRAFILTERATION_TESTING_OPTION = { @@ -24,11 +36,27 @@ "OPTION_6" : {"uf_maximum" : 765, "uf_minimum" : 500}, "OPTION_7" : {"uf_maximum" : 680, "uf_minimum" : 450}, "OPTION_8" : {"uf_maximum" : 480, "uf_minimum" : 380}, - "OPTION_9" : {"uf_maximum" : 390, "uf_minimum" : 675}, - "OPTION_10" : {"uf_maximum" : 290, "uf_minimum" : 125}, + "OPTION_9" : {"uf_maximum" : 390, "uf_minimum" : 100}, + "OPTION_10" : {"uf_maximum" : 800, "uf_minimum" : 0}, + } +def test_rejection_message_patient_connection(accept_status, uf_value): + """ + verification of rejection messages during patient connection. + @param accept_status: (int) boolean accept/reject response + @param target: (int) saline bolus Target volume + @param saline_states: (int) saline bolus transition State + @return: none + """ + test.startSection("verification of rejection messages on saline bolus") + for rejection in range(1, config.NUM_OF_REQUEST_REJECT_REASONS): + hd_simulator.cmd_send_uf_treatment_response(accepted = accept_status, reason = rejection, volume = uf_value) + rejection_message = findObject(names.o_treatment_notification_bar) + test.compare(rejection_message.text, config.REJECTION_REASON[rejection], "expected rejection {msg} displayed".format(msg=config.REJECTION_REASON[rejection])) + test.endSection() + def verify_filter_flush_text(): """ Verify Filter Flush Text on UI Screen @@ -59,16 +87,15 @@ -def navigate_patient_connection(): +def navigate_patient_connection(pre_treatment_sub_mode): """ Method to navigate to sub mode under pre-treatment screen @param mode - (int) pre treatment state """ - hd_simulator.cmd_set_hd_operation_mode_data(5,0) - hd_simulator.cmd_send_pre_treatment_state_data(sub_mode=8, water_sample_state=0, - consumables_self_test_state=0,no_cartridge_self_test_state=0, - installation_state=0, dry_self_test_state=0, prime_state=0, - recirculate_state=0, patient_connection_state=1) + hd_simulator.cmd_send_pre_treatment_state_data(sub_mode=pre_treatment_sub_mode, + water_sample_state=0, consumables_self_test_state=0,no_cartridge_self_test_state=0, + installation_state=0, dry_self_test_state=0, prime_state=0, + recirculate_state=0, patient_connection_state=0) @@ -78,15 +105,16 @@ @param ultrafilteration_range: (dictionary) uf minimum and uf maximum volume. @return: N/A """ + test.startSection("verification of ultrafilteration slider value ->" +str(ultrafilteration_range)) min_uf = ultrafilteration_range["uf_minimum"] max_uf = ultrafilteration_range["uf_maximum"] - hd_simulator.cmd_set_treatment_parameter_ranges(0, 100, min_uf, max_uf, 0, 0) + hd_simulator.cmd_set_treatment_parameter_ranges(0, 100, 0, max_uf, 0, 0) for uf_value in range(1, (max_uf//100)+1, 1): drag_and_drop_ultrafilteration_slider(uf_value, max_uf) - # test.compare(utils.l2ml(waitForObjectExists(names.o_treatmentStart_ultrafiltrationTouchArea_TreatmentUltrafiltration).value), uf_value, "uf set value should be :" + str(uf_value)) +# test.compare(utils.l2ml(waitForObjectExists(names.o_treatmentStart_ultrafiltrationTouchArea_TreatmentUltrafiltration).value), uf_value, "uf set value should be :" + str(uf_value)) - test.compare(utils.l2ml(waitForObjectExists(names.o_volumeSlider_slider).maximum), max_uf, "maximum uf value should be :" + str(max_uf)) - test.compare(utils.l2ml(waitForObjectExists(names.o_volumeSlider_slider).minimum), min_uf, "minimum uf value should be :" + str(min_uf)) +# test.compare(utils.l2ml(waitForObjectExists(names.o_volumeSlider_slider).maximum), max_uf, "maximum uf value should be :" + str(max_uf)) +# test.compare(utils.l2ml(waitForObjectExists(names.o_volumeSlider_slider).minimum), min_uf, "minimum uf value should be :" + str(min_uf)) @@ -112,10 +140,13 @@ utils.waitForGUI(2) - navigate_patient_connection() + #navigate to pre treatment + hd_simulator.cmd_set_hd_operation_mode_data(5,0) - #utility.page_step_indicator_verification(pre_treatment_step, names.ultrafilteration_text) + navigate_patient_connection(pre_treatment_sub_mode = 8) + #utility.page_step_indicator_verification(PRE_TREATMENT_STEPS, names.ultrafilteration_text) + start_test_treatment_ultrafilteration(TREATMENT_ULTRAFILTERATION_TESTING_OPTION["OPTION_1"]) start_test_treatment_ultrafilteration(TREATMENT_ULTRAFILTERATION_TESTING_OPTION["OPTION_2"]) start_test_treatment_ultrafilteration(TREATMENT_ULTRAFILTERATION_TESTING_OPTION["OPTION_3"]) @@ -127,10 +158,17 @@ start_test_treatment_ultrafilteration(TREATMENT_ULTRAFILTERATION_TESTING_OPTION["OPTION_9"]) start_test_treatment_ultrafilteration(TREATMENT_ULTRAFILTERATION_TESTING_OPTION["OPTION_10"]) + test_rejection_message_patient_connection() + #hd_simulator.cmd_set_treatment_adjust_ultrafiltration_accepted(state= 1) + hd_simulator.cmd_send_uf_treatment_response(accepted = 0, reason = 6, volume = 70) + + + + snooze(10) + + utils.waitForGUI(3) utils.tstDone() - - \ No newline at end of file