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