Index: suite_leahi/shared/scripts/configuration/config.py =================================================================== diff -u -r15fbf4a997a623075de279669293457c9e46ff79 -r8f5b6cac866b9fb5ffe865fb0c50974622704876 --- suite_leahi/shared/scripts/configuration/config.py (.../config.py) (revision 15fbf4a997a623075de279669293457c9e46ff79) +++ suite_leahi/shared/scripts/configuration/config.py (.../config.py) (revision 8f5b6cac866b9fb5ffe865fb0c50974622704876) @@ -124,9 +124,6 @@ INSTITUTIONAL_SETTINGS_NOTIFICATION_TEXT = "Institutional records and preferences updated" ERROR_ADVANCED_INSTITUTIONAL_SETTINGS_NOTIFICATION_TEXT = "Error Adjusting Advanced Institutional Records" ERROR_INSTITUTIONAL_SETTINGS_NOTIFICATION_TEXT = "Error Adjusting Institutional Records" -CREATERX = "Rx" -REQUEST = "[1] Request is not allowed in the current operating mode" -RINSEBACK_PAUSED ="Rinseback Paused" #Device Settings Options DEVICE_SETTINGS = "Device Settings" @@ -211,3 +208,10 @@ "Install blood tubing set and dialyzer.", ] START_TREATMENT_REJECTION_NOTIFICATION = "[1] Request is not allowed in the current operating mode" + +#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!" Index: suite_leahi/shared/scripts/names.py =================================================================== diff -u -r15fbf4a997a623075de279669293457c9e46ff79 -r8f5b6cac866b9fb5ffe865fb0c50974622704876 --- suite_leahi/shared/scripts/names.py (.../names.py) (revision 15fbf4a997a623075de279669293457c9e46ff79) +++ suite_leahi/shared/scripts/names.py (.../names.py) (revision 8f5b6cac866b9fb5ffe865fb0c50974622704876) @@ -309,22 +309,31 @@ o_PreTreatmentSampleStack_button_TouchRect = {"container": o_PreTreatmentSampleStack_PreTreatmentWaterSample, "id": "_button", "type": "TouchRect", "unnamed": 1 } o_preTreatmentStack_repeater_Repeater = {"container": o_preTreatmentStack_PreTreatmentStack, "id": "repeater", "type": "Repeater", "unnamed": 1 } - #Rinseback -o_EndTreatmentRinsebackStack_EndTreatmentRinsebackStack = {"container": o_Gui_MainView, "objectName": "_EndTreatmentRinsebackStack", "type": "EndTreatmentRinsebackStack" } -o_EndTreatmentRinsebackStack_EndTreatmentRinseback_EndTreatmentRinseback = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinsebackStack, "objectName": "_EndTreatmentRinseback", "type": "EndTreatmentRinseback" } -o_EndTreatmentRinseback_arterialRangeBar_TreatmentPressureComponent = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback_EndTreatmentRinseback, "id": "_arterialRangeBar", "type": "TreatmentPressureComponent", "unnamed": 1 } -o_EndTreatmentRinseback_venousRangeBar_TreatmentPressureComponent = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback_EndTreatmentRinseback, "id": "_venousRangeBar", "type": "TreatmentPressureComponent", "unnamed": 1 } -o_EndTreatmentRinseback_tmpRangeBar_TreatmentPressureComponent = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback_EndTreatmentRinseback, "id": "_tmpRangeBar", "type": "TreatmentPressureComponent", "unnamed": 1 } -o_EndTreatmentRinseback_deliveredVolumeText_Text = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback_EndTreatmentRinseback, "objectName": "_deliveredVolumeText", "type": "Text" } -o_EndTreatmentRinseback_flowRateValue_Text = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback_EndTreatmentRinseback, "objectName": "_flowRateValue", "type": "Text" } -o_EndTreatmentRinseback_endButton_TouchRect = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback_EndTreatmentRinseback, "objectName": "_endButton", "type": "TouchRect" } -o_EndTreatmentRinseback_pauseResumeButton_TouchRect = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback_EndTreatmentRinseback, "objectName": "_pauseResumeButton", "type": "TouchRect" } -o_EndTreatmentRinseback_NotificationBar_NotificationBarSmall = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback_EndTreatmentRinseback, "objectName": "NotificationBar", "type": "NotificationBarSmall" } -o_EndTreatmentRinseback = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback_EndTreatmentRinseback, "type": "Text", "unnamed": 1 } -o_EndTreatmentRinseback_targetVolumeProgress_ProgressCircle = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback_EndTreatmentRinseback, "objectName": "_targetVolumeProgress", "type": "ProgressCircle" } -o_EndTreatmentRinseback_timeout_TimeText = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback_EndTreatmentRinseback, "objectName": "_timeout", "type": "TimeText" } -o_EndTreatmentRinseback_decrementFlowRateButton_ArrowButton = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback_EndTreatmentRinseback, "objectName": "_decrementFlowRateButton", "type": "ArrowButton" } -o_EndTreatmentRinseback_incrementFlowRateButton_ArrowButton = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback_EndTreatmentRinseback, "objectName": "_incrementFlowRateButton", "type": "ArrowButton" } -o_EndTreatmentRinsebackStack_EndTreatmentRinsebackComplete_EndTreatmentRinsebackComplete = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinsebackStack, "objectName": "_EndTreatmentRinsebackComplete", "type": "EndTreatmentRinsebackComplete" } -o_EndTreatmentRinsebackComplete_instructionView_InstructionView = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinsebackComplete_EndTreatmentRinsebackComplete, "id": "_instructionView", "type": "InstructionView", "unnamed": 1 } +o_EndTreatmentRinsebackStack_EndTreatmentRinsebackStack = {"container": o_Gui_MainView, "objectName": "_EndTreatmentRinsebackStack", "type": "EndTreatmentRinsebackStack", } +o_EndTreatmentRinsebackStack_EndTreatmentRinseback = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinsebackStack, "objectName": "_EndTreatmentRinseback", "type": "EndTreatmentRinseback", } +o_EndTreatmentRinseback_arterialRangeBar_TreatmentPressureComponent= {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback, "id": "_arterialRangeBar", "type": "TreatmentPressureComponent", "unnamed": 1 } +o_EndTreatmentRinseback_venousRangeBar_TreatmentPressureComponent= {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback, "id": "_venousRangeBar", "type": "TreatmentPressureComponent", "unnamed": 1 } +o_EndTreatmentRinseback_tmpRangeBar_TreatmentPressureComponent = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback, "id": "_tmpRangeBar", "type": "TreatmentPressureComponent", "unnamed": 1 } +o_EndTreatmentRinseback_deliveredVolumeText_Text = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback, "objectName": "_deliveredVolumeText", "type": "Text", } +o_EndTreatmentRinseback_flowRateValue_Text = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback, "objectName": "_flowRateValue", "type": "Text", } +o_EndTreatmentRinseback_endButton_TouchRect = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback, "objectName": "_endButton", "type": "TouchRect", } +o_EndTreatmentRinseback_pauseResumeButton_TouchRect = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback, "objectName": "_pauseResumeButton", "type": "TouchRect", } +o_EndTreatmentRinseback_NotificationBar_NotificationBarSmall = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback, "objectName": "NotificationBar", "type": "NotificationBarSmall", } +o_EndTreatmentRinseback = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback, "type": "Text", "unnamed": 1 } +o_EndTreatmentRinseback_targetVolumeProgress_ProgressCircle = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback, "objectName": "_targetVolumeProgress", "type": "ProgressCircle", } +o_EndTreatmentRinseback_timeout_TimeText = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback, "objectName": "_timeout", "type": "TimeText", } +o_EndTreatmentRinseback_decrementFlowRateButton_ArrowButton = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback, "objectName": "_decrementFlowRateButton", "type": "ArrowButton", } +o_EndTreatmentRinseback_incrementFlowRateButton_ArrowButton = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinseback, "objectName": "_incrementFlowRateButton", "type": "ArrowButton", } +o_EndTreatmentRinsebackStack_EndTreatmentRinsebackComplete = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinsebackStack, "objectName": "_EndTreatmentRinsebackComplete", "type": "EndTreatmentRinsebackComplete", } +o_EndTreatmentRinsebackComplete_instructionView_InstructionView = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinsebackComplete, "id": "_instructionView", "type": "InstructionView", "unnamed": 1 } +o_EndTreatmentRinsebackStack_EndTreatmentRinsebackInit = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinsebackStack, "objectName": "_EndTreatmentRinsebackInit", "type": "EndTreatmentRinsebackInit", } +o_EndTreatmentRinsebackInit_description_Text = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinsebackInit, "objectName": "_description", "type": "Text", } +o_EndTreatmentRinsebackInit_TimeText_hour_Text = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinsebackInit, "objectName": "_TimeText_hour", "type": "Text", } +o_EndTreatmentRinsebackInit_TimeText_minute_Text = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinsebackInit, "objectName": "_TimeText_minute", "type": "Text", } +o_EndTreatmentRinsebackInit_NotificationBar_NotificationBarSmall= {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinsebackInit, "objectName": "NotificationBar", "type": "NotificationBarSmall", } +o_EndTreatmentRinsebackInit_beginRinsebackTouchRect_TouchRect = {"container": o_EndTreatmentRinsebackStack_EndTreatmentRinsebackInit, "id": "_beginRinsebackTouchRect", "type": "TouchRect", "unnamed": 1 } +o_Blood_Return_Complete_Title_Text = {"container": o_Overlay, "id": "_messageText", "type": "TitleText", "unnamed": 1 } +o_Blood_Return_Complete_Recirculate_TouchRect = {"container": o_Overlay, "id": "_additionalTouch", "type": "TouchRect", "unnamed": 1 } +o_Blood_Return_Complete_End_Treatment_TouchRect = {"container": o_Overlay, "id": "_cancelTouch", "type": "TouchRect", "unnamed": 1 } +o_Blood_Return_Complete_Fluid_Bolus_TouchRect = {"container": o_Overlay, "id": "_confirmTouch", "type": "ConfirmButton", "unnamed": 1 } Index: suite_leahi/tst_rinseback/test.py =================================================================== diff -u -rc3fed566691f30e31d3880f6b70cc26d626b5873 -r8f5b6cac866b9fb5ffe865fb0c50974622704876 --- suite_leahi/tst_rinseback/test.py (.../test.py) (revision c3fed566691f30e31d3880f6b70cc26d626b5873) +++ suite_leahi/tst_rinseback/test.py (.../test.py) (revision 8f5b6cac866b9fb5ffe865fb0c50974622704876) @@ -4,6 +4,9 @@ # Steps: # Rinseback Feature: # Navigate to the treatment and change the submode to Rinseback state +# Verify Blood Return Setup Screen - Compare Title text, Countdown Description text +# Countdown minutes and seconds Verify FW received Start Blood Return Value +# Compare Rejection Reason # Send the pressure container values from the FW # Verify UI displays the correct values which are send from the FW # Send the rinseback data from FW and verify @@ -22,17 +25,17 @@ # Change the rinseback submode to RUN state # Click on increment and decrement rinseback button # Verify the FW gets the request with correct opmode -# Click on End Rinseback button -# Verify the FW gets the request with correct opmode -# Change the rinseback submode to Stop state and verify the screen changes to Rinseback complete page +# Change the rinseback submode to Stop state and Compare Blood Return Complete text +# Click and Verify FW received End Treatment, Fluid Bolus, and Recirculate value + import names 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 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 @@ -43,7 +46,6 @@ rinsebackrequest = None def change_treatmentstates(state,substate): - test.startSection("Change the treatment parameter") td.td_tx_state( state, 0 , 0 , @@ -54,7 +56,6 @@ 0 , 0 , 0) - test.endSection() def handle_rinseback_request( message, timestamp = 0.0): """ @@ -67,9 +68,53 @@ global rinsebackrequest rinsebackrequest = state +def verify_blood_return_setup_screen(): + test.startSection("Verify Blood Return Setup Screen") + td.td_operation_mode(TDOpModes.MODE_STAN.value) + change_treatmentstates(TDTreatmentStates.TREATMENT_DIALYSIS_STATE.value,TXStates.RINSEBACK_STOP_INIT_STATE) + change_treatmentstates(TDTreatmentStates.TREATMENT_RINSEBACK_STATE.value,TXStates.RINSEBACK_STOP_INIT_STATE) + headerbar_container = waitForObject(names.o_headerBar_HeaderBar, 2000) + blood_return_setup_screen_headerbar_title_text = utility.findChildByText( + headerbar_container, config.BLOOD_RETURN_SETUP + ) + if blood_return_setup_screen_headerbar_title_text is not None: + test.compare( + blood_return_setup_screen_headerbar_title_text.text, + config.BLOOD_RETURN_SETUP, + "{} screen is displayed and Comparison of Blood Return Setup Screen Title text".format( + config.BLOOD_RETURN_SETUP + ), + ) + + td.td_rinseback_progress(0,0,0,200,150,0) + blood_return_countdown_description = utility.get_object_from_names(names.o_EndTreatmentRinsebackInit_description_Text) + test.compare( + blood_return_countdown_description.text, + config.BLOOD_RETURN_COUNTDOWN_DESCRIPTION_TEXT, + f"Comparison of Blood Return Countdown Description Text", + ) + blood_return_countdown_minutes = utility.get_object_from_names(names.o_EndTreatmentRinsebackInit_TimeText_hour_Text) + test.compare( + blood_return_countdown_minutes.text, + '02', + f"Comparison of Blood Return Countdown Minutes", + ) + blood_return_countdown_seconds = utility.get_object_from_names(names.o_EndTreatmentRinsebackInit_TimeText_minute_Text) + test.compare( + blood_return_countdown_seconds.text, + '30', + f"Comparison of Blood Return Countdown Seconds", + ) + mouseClick(waitForObject(names.o_EndTreatmentRinsebackInit_beginRinsebackTouchRect_TouchRect, 2000)) + 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)) + test.endSection() + def verify_pressure_value(): test.startSection("Verify the pressure container values") - td.td_operation_mode(TDOpModes.MODE_STAN.value) change_treatmentstates(TDTreatmentStates.TREATMENT_RINSEBACK_STATE.value,TXStates.RINSEBACK_RUN_STATE) td.td_pressure(H2_arterial_pressure = -151, H14_venous_pressure = -12, @@ -177,17 +222,38 @@ decrementButton =waitForObject(names.o_EndTreatmentRinseback_decrementFlowRateButton_ArrowButton,1000) mouseClick(decrementButton) test.verify(waitFor( lambda: rinsebackrequest == 2, 3000), "Testing FW received Decrement Value") - endRinseback = waitForObject(names.o_EndTreatmentRinseback_endButton_TouchRect,2000) - mouseClick(endRinseback) - test.verify(waitFor( lambda: rinsebackrequest == 5, 3000), "Testing FW received End Rinseback Value") - change_treatmentstates( TDTreatmentStates.TREATMENT_RINSEBACK_STATE.value, - TXStates.RINSEBACK_STOP_STATE) + test.endSection() +def verify_blood_return_complete(): + test.startSection("Verify the Blood Return Complete State") + change_treatmentstates(TDTreatmentStates.TREATMENT_RINSEBACK_STATE.value,TXStates.RINSEBACK_STOP_STATE) + blood_return_complete = utility.get_object_from_names(names.o_Blood_Return_Complete_Title_Text) + test.compare( + blood_return_complete.text, + config.BLOOD_RETURN_COMPLETE, + f"Comparison of Blood Return Complete Text", + ) + end_treatment_button = utility.get_object_from_names(names.o_Blood_Return_Complete_End_Treatment_TouchRect) + mouseClick(end_treatment_button) + test.verify(waitFor( lambda: rinsebackrequest == 8, 3000), "Testing FW received End Treatment value") + + change_treatmentstates(TDTreatmentStates.TREATMENT_RINSEBACK_STATE.value,TXStates.RINSEBACK_PAUSED_STATE) + change_treatmentstates(TDTreatmentStates.TREATMENT_RINSEBACK_STATE.value,TXStates.RINSEBACK_STOP_STATE) + fluid_bolus_button = utility.get_object_from_names(names.o_Blood_Return_Complete_Fluid_Bolus_TouchRect) + mouseClick(fluid_bolus_button) + test.verify(waitFor( lambda: rinsebackrequest == 6, 3000), "Testing FW received Fluid Bolus value") + + change_treatmentstates(TDTreatmentStates.TREATMENT_RINSEBACK_STATE.value,TXStates.RINSEBACK_PAUSED_STATE) + change_treatmentstates(TDTreatmentStates.TREATMENT_RINSEBACK_STATE.value,TXStates.RINSEBACK_STOP_STATE) + recirculate_button = utility.get_object_from_names(names.o_Blood_Return_Complete_Recirculate_TouchRect) + mouseClick(recirculate_button) + test.verify(waitFor( lambda: rinsebackrequest == 7, 3000), "Testing FW received Recirculate value") test.endSection() + def main(): utils.tstStart(__file__) - startApplication(config.AUT_NAME) + startApplication(utility.aut('-q')) global rinsebackrequest if can_interface is not None: channel_id = CAN.DenaliChannels.ui_to_td_ch_id @@ -196,21 +262,13 @@ message_id, handle_rinseback_request) + verify_blood_return_setup_screen() verify_pressure_value() verify_flow_values_rinseback() verify_pause_rinseback() verify_resume_rinseback() verify_increment_decrement_rinseback_values() + verify_blood_return_complete() - test.startSection("Verify the screen changes to Rinseback complete page") - test.verify(waitForObjectExists(names.o_EndTreatmentRinsebackComplete_instructionView_InstructionView), "In Rinseback complete page") - test.endSection() - utils.tstDone() - - - - - - - + \ No newline at end of file