Index: shared/scripts/configuration/config.py =================================================================== diff -u -rdd2540a25327b187e4a783682b400fbf711672a3 -r83caf575cae31050f77bd25d2bb86f380c2338c8 --- shared/scripts/configuration/config.py (.../config.py) (revision dd2540a25327b187e4a783682b400fbf711672a3) +++ shared/scripts/configuration/config.py (.../config.py) (revision 83caf575cae31050f77bd25d2bb86f380c2338c8) @@ -66,3 +66,52 @@ SYSTEM_SELF_TEST_TITLE = "System Self Test" FILTER_FLUSH_TITLE = "Filter Flush" +# dictionary of rejection reason from application source code. +# message location -> denali-> Headers-> common-> MsgDefs.h +REJECTION_REASON = { + 0: "No Active Alarm List", + 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____AVAILABLE_1", # Not used - available for use + 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. + 40: "REQUEST_REJECT_REASON_RESERVOIR_ONE_IS_NOT_READY", # Reservoir one fill is not complete + 41: "REQUEST_REJECT_REASON_PUMP_TRACK_NOT_CLOSED", # Pump track is not ready / closed + 42: "REQUEST_REJECT_REASON_DOOR_NOT_CLOSED", # Door is not closed + 43: "REQUEST_REJECT_REASON_SYRINGE_NOT_PRESENT", # Syringe is not present + } +NUM_OF_REQUEST_REJECT_REASONS = 43 \ No newline at end of file Index: shared/scripts/configuration/utility.py =================================================================== diff -u -rdd2540a25327b187e4a783682b400fbf711672a3 -r83caf575cae31050f77bd25d2bb86f380c2338c8 --- shared/scripts/configuration/utility.py (.../utility.py) (revision dd2540a25327b187e4a783682b400fbf711672a3) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision 83caf575cae31050f77bd25d2bb86f380c2338c8) @@ -21,8 +21,9 @@ import object import time from configuration.config import * - + def scroll_to_zone(zone=None, screen_object=None): + """ scroll to the numeric if object is hidden @param zone - UI object @@ -153,8 +154,6 @@ sec = time.strftime("%S", time.gmtime(seconds)) return min,sec - - def get_time(screen_title): """ Method to return the current count down @@ -182,8 +181,6 @@ time_text = progress_circle_children[0] test.log(str(time_text)) return time_text.time - - def verify_the_progress(count_down, screen_title, time_out): """ @@ -203,4 +200,9 @@ expected_progress = time_out - count_down test.compare(current_progress, expected_progress, "{} should be the current progress".format(expected_progress)) test.endSection() + +def rejection_msg(text): + names.o_rejection_msg["text"] = text + return names.o_rejection_msg + \ No newline at end of file Index: shared/scripts/names.py =================================================================== diff -u -r958b6bb16ed60d4aa4c2497a95d0315a76ac128c -r83caf575cae31050f77bd25d2bb86f380c2338c8 --- shared/scripts/names.py (.../names.py) (revision 958b6bb16ed60d4aa4c2497a95d0315a76ac128c) +++ shared/scripts/names.py (.../names.py) (revision 83caf575cae31050f77bd25d2bb86f380c2338c8) @@ -109,3 +109,8 @@ o_EndTreatmentAdditional_circle_Circle = {"container": o_EndTreatmentRinsebackStack_EndTreatmentAdditional_EndTreatmentBase, "id": "_circle", "type": "Circle", "unnamed": 1, "visible": True} o_EndTreatmentRinseback_circle_ProgressCircle = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback_EndTreatmentRinseback, "id": "_circle", "type": "ProgressCircle", "unnamed": 1, "visible": True} o_EndTreatmentAdditional_circle_ProgressCircle = {"container": o_EndTreatmentRinsebackStack_EndTreatmentAdditional_EndTreatmentBase, "id": "_circle", "type": "ProgressCircle", "unnamed": 1, "visible": True} + +# o_text_volume_rinseback_run_state = {"container": o_EndTreatmentRinsebackStack_EndTreatmentAdditional_EndTreatmentBase, "type": "Text", "unnamed": 1, "visible": True} +# {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback_EndTreatmentRinseback, "text": "0 mL", "type": "Text", "unnamed": 1, "visible": True} +o_rejection_msg = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinsebackStack, "type": "Text", "unnamed": 1, "visible": True} + Index: tst_rinseback_setup/test.py =================================================================== diff -u -r958b6bb16ed60d4aa4c2497a95d0315a76ac128c -r83caf575cae31050f77bd25d2bb86f380c2338c8 --- tst_rinseback_setup/test.py (.../test.py) (revision 958b6bb16ed60d4aa4c2497a95d0315a76ac128c) +++ tst_rinseback_setup/test.py (.../test.py) (revision 83caf575cae31050f77bd25d2bb86f380c2338c8) @@ -82,18 +82,22 @@ rinseback_state= TreatmentRinsebackStates.RINSEBACK_STOP_INIT_STATE.value, recirculate_state = TreatmentStates.TREATMENT_START_STATE.value, blood_prime_state = TreatmentStates.TREATMENT_START_STATE.value,treatment_end_state = TreatmentStates.TREATMENT_START_STATE.value, treatment_stop_state = TreatmentStates.TREATMENT_START_STATE.value, dialysis_state = TreatmentStates.TREATMENT_START_STATE.value) + + test.startSection("verifying count down value of timer") for num in range(timer_default_value,count_down_value): hd_simulator.cmd_send_treatment_rinseback_data(target_vol= count_down_default_value, current_vol= count_down_default_value, flow_rate= count_down_default_value, timeout= num,timeout_countdown= num, is_completed= 0) min,sec = utility.convert_seconds_into_min_and_sec(num) test.compare(str(waitForObject(names.o_EndTreatmentRinsebackInit_TimeText_minute_Text).text),str(sec),"Verifying seconds appearing on UI") test.compare(str(waitForObject(names.o_EndTreatmentRinsebackInit_TimeText_hour_Text).text),str(min),"Verifying minutes appearing on UI") + test.endSection() test.compare(str(waitForObject(names.o_rinse_back_text).text),config.RINSE_BACK_SETUP_TEXT, "Rinseback Setup text must be {}".format(config.RINSE_BACK_SETUP_TEXT)) test.verify(waitForObjectExists(names.o_rinse_back_text).enabled, " Start Rinseback button must be active") mouseClick(waitForObject(names.o_rinse_back_text)) verify_right_instruction_in_rinseback_setup_state(num_of_instructions) verify_left_instruction_in_rinseback_setup_state(num_of_instructions) verify_right_instruction_in_rinseback_setup_state(num_of_instructions) + verify_rinseback_rejection_msg() test.endSection() def verify_rinseback_run_state_screen(): @@ -105,6 +109,7 @@ saline_state = TreatmentStates.TREATMENT_START_STATE.value, heparin_state = TreatmentStates.TREATMENT_START_STATE.value,rinseback_state= TreatmentRinsebackStates.RINSEBACK_RUN_STATE.value, recirculate_state = TreatmentStates.TREATMENT_START_STATE.value, blood_prime_state = TreatmentStates.TREATMENT_START_STATE.value,treatment_end_state = TreatmentEndStates.TREATMENT_END_PAUSED_STATE.value, treatment_stop_state = TreatmentStates.TREATMENT_START_STATE.value, dialysis_state = TreatmentStates.TREATMENT_START_STATE.value) + test.startSection("verifying count down value of timer") for num in range(count_down_default_value,count_down_value): hd_simulator.cmd_send_treatment_rinseback_data(target_vol= count_down_value, current_vol= num, flow_rate= num, timeout= count_down_default_value,timeout_countdown= count_down_default_value, is_completed= 0) rinseback_ml = set_custom_object_property_rinseback_ml((str(num)+config.RINSEBACK_UNIT),container_run_state) @@ -113,7 +118,7 @@ test.verify(waitForObjectExists(names.o_EndTreatmentRinseback_circle_Circle).enabled, "Progress bar must be enable") test.compare(str(waitForObject(rinseback_ml_min).text),str(num)+config.RINSEBACK_UNIT_MIN, "Verifying values apeearing on Lable") test.compare(str(waitForObject(names.o_EndTreatmentRinseback_circle_ProgressCircle).value),str(num), "Verifying Progress bar values") - + test.endSection() test.compare(str(waitForObject(names.o_EndTreatmentRinseback_Rinseback_Text).text),config.RINSEBACK_TEXT, "Rinseback text must be {}".format(config.RINSEBACK_TEXT)) test.compare(str(waitForObject(names.o_EndTreatmentRinseback_imageEnd_ImageText).text),config.END_IMAGE_BUTTON_TEXT, "END button text must be {}".format(config.END_IMAGE_BUTTON_TEXT)) @@ -130,7 +135,8 @@ test.compare(str(waitForObject(names.o_EndTreatmentRinseback_imagePause_ImageText).text),config.PAUSE_BUTTON_TEXT, "Pause button text must be {}".format(config.PAUSE_BUTTON_TEXT)) test.verify(waitForObjectExists(names.o_EndTreatmentRinseback_imagePause_ImageText).enabled, " Pause button must be active") - mouseClick(waitForObject(names.o_EndTreatmentRinseback_imagePause_ImageText)) + mouseClick(waitForObject(names.o_EndTreatmentRinseback_imagePause_ImageText)) + verify_rinseback_rejection_msg() test.endSection() def verify_rinseback_paused_state_screen(): @@ -153,7 +159,8 @@ test.compare(str(waitForObject(names.o_EndTreatmentRinseback_imageResume_ImageText).text),config.RESUME_BUTTON_TEXT, "Resume button text must be {}".format(config.RESUME_BUTTON_TEXT)) test.verify(waitForObjectExists(names.o_EndTreatmentRinseback_imageResume_ImageText).enabled, " Resume button must be active") - mouseClick(waitForObject(names.o_EndTreatmentRinseback_imageResume_ImageText)) + mouseClick(waitForObject(names.o_EndTreatmentRinseback_imageResume_ImageText)) + verify_rinseback_rejection_msg() test.endSection() def verify_rinseback_stop_state_screen(): @@ -164,11 +171,14 @@ hd_simulator.cmd_set_treatment_states_data(sub_mode = TreatmentStates.TREATMENT_RINSEBACK_STATE.value , uf_state = TreatmentStates.TREATMENT_START_STATE.value, saline_state = TreatmentStates.TREATMENT_START_STATE.value, heparin_state = TreatmentStates.TREATMENT_START_STATE.value,rinseback_state= TreatmentRinsebackStates.RINSEBACK_STOP_STATE.value, recirculate_state = TreatmentStates.TREATMENT_START_STATE.value, blood_prime_state = TreatmentStates.TREATMENT_START_STATE.value,treatment_end_state = TreatmentEndStates.TREATMENT_END_PAUSED_STATE.value, treatment_stop_state = TreatmentStates.TREATMENT_START_STATE.value, dialysis_state = TreatmentStates.TREATMENT_START_STATE.value) + test.startSection("verifying count down value of timer") for num in range(timer_default_value,count_down_value): hd_simulator.cmd_send_treatment_rinseback_data(target_vol= count_down_value, current_vol= count_down_default_value, flow_rate= count_down_default_value, timeout= num,timeout_countdown= num, is_completed= 0) min,sec = utility.convert_seconds_into_min_and_sec(num) test.compare(str(waitForObject(names.o_EndTreatmentRinsebackComplete_TimeText_minute_Text).text),str(sec), "Vrifying seconds apeearing on UI") test.compare(str(waitForObject(names.o_EndTreatmentRinsebackComplete_TimeText_hour_Text).text),str(min), "Vrifying minutes apeearing on UI") + test.endSection() + test.compare(str(waitForObject(names.o_EndTreatmentRinsebackComplete_Rinseback_Complete_Text).text),config.RINSEBACK_COMPLETE_TEXT, "Rinseback Complete text must be {}".format(config.RINSEBACK_COMPLETE_TEXT)) test.compare(str(waitForObjectExists(names.o_EndTreatmentRinsebackComplete_END_TREATMENT_Text).text), config.END_TREATMENT_BUTTON_TEXT, "END TREATMENT button text must be {}".format(config.END_TREATMENT_BUTTON_TEXT)) test.verify(waitForObjectExists(names.o_EndTreatmentRinsebackComplete_END_TREATMENT_Text).enabled, "END TREATMENT button must be active") @@ -177,6 +187,7 @@ test.compare(str(waitForObjectExists(names.o_EndTreatmentRinsebackComplete_ADDITIONAL_Text).text), config.ADDITIONAL_BUTTON_TEXT, "ADDITIONAL button text must be {}".format(config.ADDITIONAL_BUTTON_TEXT)) test.verify(waitForObjectExists(names.o_EndTreatmentRinsebackComplete_ADDITIONAL_Text).enabled, "ADDITIONAL button must be active") mouseClick(waitForObject(names.o_EndTreatmentRinsebackComplete_ADDITIONAL_Text)) + verify_rinseback_rejection_msg() test.endSection() def verify_rinseback_run_additional_state_screen(): @@ -187,6 +198,7 @@ hd_simulator.cmd_set_treatment_states_data(sub_mode = TreatmentStates.TREATMENT_RINSEBACK_STATE.value , uf_state = TreatmentStates.TREATMENT_START_STATE.value, saline_state = TreatmentStates.TREATMENT_START_STATE.value, heparin_state = TreatmentStates.TREATMENT_START_STATE.value,rinseback_state= TreatmentRinsebackStates.RINSEBACK_RUN_ADDITIONAL_STATE.value, recirculate_state = TreatmentStates.TREATMENT_START_STATE.value, blood_prime_state = TreatmentStates.TREATMENT_START_STATE.value,treatment_end_state = TreatmentEndStates.TREATMENT_END_PAUSED_STATE.value, treatment_stop_state = TreatmentStates.TREATMENT_START_STATE.value, dialysis_state = TreatmentStates.TREATMENT_START_STATE.value) + test.startSection("verifying count down value of timer") for num in range(count_down_default_value,count_down_value): hd_simulator.cmd_send_treatment_rinseback_data(target_vol= count_down_value, current_vol= num, flow_rate= num, timeout= count_down_default_value,timeout_countdown= count_down_default_value, is_completed= 0) rinseback_additional_ml = set_custom_object_property_rinseback_ml((str(num)+config.RINSEBACK_UNIT_MIN),container_additional_state) @@ -195,6 +207,8 @@ test.compare(str(waitForObject(rinseback_additional_ml_min).text),str(num)+config.RINSEBACK_UNIT, "Verifying values apeearing on Lable") test.verify(waitForObjectExists(names.o_EndTreatmentAdditional_circle_Circle).enabled, "Progress Bar must be enable") test.compare(str(waitForObject(names.o_EndTreatmentAdditional_circle_ProgressCircle).value),str(num), "Verifying Progress bar values") + test.endSection() + test.compare(str(waitForObject(names.o_EndTreatmentAdditional_Additional_Rinseback_Text).text),config.ADDITIONAL_RINSEBACK_TEXT, "Additional Rinseback text must be {}".format(config.ADDITIONAL_RINSEBACK_TEXT)) test.endSection() @@ -227,6 +241,17 @@ test.compare(str(waitForObjectExists(names.o_rinse_back_text).text), config.RINSE_BACK_SETUP_TEXT, "Rinseback Setup text must be {}".format(config.RINSE_BACK_SETUP_TEXT)) utility.verify_missing_object(leftarrow_obj_names) test.endSection() + +def verify_rinseback_rejection_msg(): + """ + Method to verify rinseback setup rejection messages + """ + test.startSection("verifying rejection messages in rinseback screens ") + for reason_id in range(1, config.NUM_OF_REQUEST_REJECT_REASONS + 1): + hd_simulator.cmd_send_treatment_adjust_rinseback_response(accepted = 0, reason= reason_id) + rejection_message = waitForObjectExists(utility.rejection_msg(text=config.REJECTION_REASON[reason_id])) + test.compare(rejection_message.text, config.REJECTION_REASON[reason_id], "expected rejection {msg} displayed".format(msg=config.REJECTION_REASON[reason_id])) + test.endSection() def main(): @@ -237,6 +262,6 @@ verify_rinseback_paused_state_screen() verify_rinseback_stop_state_screen() verify_rinseback_run_additional_state_screen() - - + + \ No newline at end of file