Index: suite_leahi/shared/scripts/configuration/config.py =================================================================== diff -u -r8f5b6cac866b9fb5ffe865fb0c50974622704876 -rab8c9554486ad673aa83390f8ad877cc838f96b8 --- suite_leahi/shared/scripts/configuration/config.py (.../config.py) (revision 8f5b6cac866b9fb5ffe865fb0c50974622704876) +++ suite_leahi/shared/scripts/configuration/config.py (.../config.py) (revision ab8c9554486ad673aa83390f8ad877cc838f96b8) @@ -211,7 +211,7 @@ #Rinseback BLOOD_RETURN_SETUP = "Blood Return Setup" -REQUEST = "[1] Request is not allowed in the current operating mode" RINSEBACK_PAUSED = "Rinseback Paused" BLOOD_RETURN_COUNTDOWN_DESCRIPTION_TEXT = "Blood return will NOT be allowed in:" BLOOD_RETURN_COMPLETE = "Blood Return Complete!" +CONFIGURATIONS_PATH = "Public/luis/config/configurations/" Index: suite_leahi/suite.conf =================================================================== diff -u -r4b929ef6eef32479f10e84325b0ad12173474a4d -rab8c9554486ad673aa83390f8ad877cc838f96b8 --- suite_leahi/suite.conf (.../suite.conf) (revision 4b929ef6eef32479f10e84325b0ad12173474a4d) +++ suite_leahi/suite.conf (.../suite.conf) (revision ab8c9554486ad673aa83390f8ad877cc838f96b8) @@ -1,6 +1,23 @@ AUT=leahi LANGUAGE=Python OBJECTMAPSTYLE=script -TEST_CASES=tst_solution_infusion tst_main_treatment tst_service_export_logs tst_device_settings_information_version tst_headerbar_information_popup tst_headerbar_wifi_indicator tst_device_settings_wifi tst_ultrafiltration tst_create_treatment tst_general_alarm_requirements_instruction tst_headerbar_prescription tst_heparin tst_pre_treatment_foundation tst_feature_options tst_end_of_treatment tst_service_institutional +TEST_CASES=tst_solution_infusion +TEST_CASES=tst_main_treatment +TEST_CASES=tst_service_export_logs +TEST_CASES=tst_device_settings_information_version +TEST_CASES=tst_headerbar_information_popup +TEST_CASES=tst_headerbar_wifi_indicator +TEST_CASES=tst_device_settings_wifi +TEST_CASES=tst_ultrafiltration +TEST_CASES=tst_create_treatment +TEST_CASES=tst_general_alarm_requirements_instruction +TEST_CASES=tst_headerbar_prescription +TEST_CASES=tst_heparin +TEST_CASES=tst_pre_treatment_foundation +TEST_CASES=tst_feature_options +TEST_CASES=tst_end_of_treatment +TEST_CASES=tst_service_institutional +TEST_CASES=tst_rinseback + VERSION=3 WRAPPERS=Qt Index: suite_leahi/tst_rinseback/test.py =================================================================== diff -u -r9ec08c6d0259a8309489ebf04e217d767b9d2ecd -rab8c9554486ad673aa83390f8ad877cc838f96b8 --- suite_leahi/tst_rinseback/test.py (.../test.py) (revision 9ec08c6d0259a8309489ebf04e217d767b9d2ecd) +++ suite_leahi/tst_rinseback/test.py (.../test.py) (revision ab8c9554486ad673aa83390f8ad877cc838f96b8) @@ -32,19 +32,25 @@ import can # plugin specific -from leahi_dialin.common.msg_defs import MsgIds, MsgFieldPositions -from leahi_dialin.protocols import CAN -from leahi_dialin.ui import utils -from configuration import utility,config -from leahi_dialin.ui.td_messaging import TD_Messaging -from leahi_dialin.common.ui_defs import TXStates -from leahi_dialin.common.td_defs import TDOpModes,TDTreatmentStates -from leahi_dialin.utils import conversions +from leahi_dialin.common.msg_defs import MsgIds, MsgFieldPositions +from leahi_dialin.protocols import CAN +from leahi_dialin.ui import utils +from configuration import utility,config +from leahi_dialin.ui.td_messaging import TD_Messaging +from leahi_dialin.common.ui_defs import TXStates +from leahi_dialin.common.td_defs import TDOpModes,TDTreatmentStates +from leahi_dialin.utils import conversions +from configuration.getrejectiontext import ScopedRejectionRepository +from pathlib import Path td = TD_Messaging() can_interface = td.can_interface rinsebackrequest = None + +conf_path = Path.home() / config.CONFIGURATIONS_PATH / "Alarms/Rejections.conf" +repo = ScopedRejectionRepository(path=conf_path) + def change_treatmentstates(state,substate): td.td_tx_state( state, 0 , @@ -109,8 +115,11 @@ test.verify(waitFor( lambda: rinsebackrequest == 0, 3000), "Testing FW received Start Blood Return Value") td.td_rinseback_cmd_response(vRejectionReason = 1) - rejectionReason = waitForObject(utility.setObjectText(text=config.REQUEST,obj =names.o_EndTreatmentRinsebackInit_NotificationBar_NotificationBarSmall)) - test.compare(rejectionReason.text,config.REQUEST, "Rejection Reason text should be :" + str(rejectionReason.text)) + + + REJECT_TEXT = repo.get("1", "Title") + rejectionReason = waitForObject(utility.setObjectText(text="[1] "+ REJECT_TEXT,obj =names.o_EndTreatmentRinsebackInit_NotificationBar_NotificationBarSmall)) + test.compare(rejectionReason.text,"[1] "+REJECT_TEXT, "Rejection Reason text should be :" + str(rejectionReason.text)) test.endSection() def verify_pressure_value(): @@ -189,8 +198,10 @@ mouseClick(waitForObject(names.o_EndTreatmentRinseback_pauseResumeButton_TouchRect, 2000)) test.verify(waitFor( lambda: rinsebackrequest == 3, 3000), "Testing FW received Pause Rinseback request") td.td_rinseback_cmd_response(vRejectionReason = 1) - rejectionReason = waitForObject(utility.setObjectText(text=config.REQUEST,obj =names.o_EndTreatmentRinseback_NotificationBar_NotificationBarSmall)) - test.compare(rejectionReason.text,config.REQUEST, "Rejection Reason text should be :" + str(rejectionReason.text)) + + REJECT_TEXT = repo.get("1", "Title") + rejectionReason = waitForObject(utility.setObjectText(text="[1] "+ REJECT_TEXT,obj =names.o_EndTreatmentRinseback_NotificationBar_NotificationBarSmall)) + test.compare(rejectionReason.text,"[1] "+ REJECT_TEXT, "Rejection Reason text should be :" + str(rejectionReason.text)) td.td_rinseback_cmd_response(vRejectionReason = 0) change_treatmentstates( TDTreatmentStates.TREATMENT_RINSEBACK_STATE.value, TXStates.RINSEBACK_PAUSED_STATE) @@ -256,12 +267,16 @@ def main(): utils.tstStart(__file__) + startApplication(utility.aut('-q')) global rinsebackrequest - if can_interface is not None: - channel_id = CAN.CanChannels.ui_to_td_ch_id - message_id = MsgIds.MSG_ID_UI_RINSEBACK_CMD_REQUEST.value - can_interface.register_receiving_publication_function(channel_id, + if can_interface is None: + test.fail("CAN Interface is not available. Stopping tests.") + return + + channel_id = CAN.CanChannels.ui_to_td_ch_id + message_id = MsgIds.MSG_ID_UI_RINSEBACK_CMD_REQUEST.value + can_interface.register_receiving_publication_function(channel_id, message_id, handle_rinseback_request)