#Subject/Title: LDT-2819 Edit Treatment Parameters During Treatment - SW - 02 - Edit Treatment Parameters During Treatment - Q&R # Functionalities: Testing all functionalities of Edit treatement parameter in the main treatment screen #Steps # Pressure Edit # 1 Navigate to create treatement set all the parameters and navigate to the main treatement page # 2 Click on Pressures Edit ->Edit the parameters in the pressure popup and perform confirm # 3 Send the rejection reasom from FW and verify the message in the UI # 4 Send the No Rejection from the FW and verify the popup closed and Fw recieved the values # # Saline Edit # 1 Send saline data to main treatment container # 2 Open Saline edit settings # 3.Verify Saline Bolus target volume set is populated on saline edit popup # 4 Change settings and confirm # 5 Send the rejection reason 1 and populate the error message on the popup # 6 Send the rejection reason 0 and verify the popup closes and verify FW recieves the values # Treatement parameters # 1 Send set point low values i.e blood flow,dialysate flow and dialysate temp low value # 2 Verify Blood flow rate , dialysate flow rate, dialysate temp are colored red # 3 Perform any of the arrows and value should change to min and color should change to white # 4 Verify the rejection reason 1 and check the error message in the UI # 5 Verify the rejection reason 0 and check FW recieves the values # 6 On Main treatment screen send values in range and test arrow buttons for each Blood flow, Dialysate flow, dialystae temp # ex. blood flow set to 70 (Step value is 10) # Press the up arrow and confirm the fw receives the incremented value 80 # Test rejection -> rejection banner on maintreatment screen # 7 Verify the values for non step value for blood flow,dialysate flow and dialysate temp # # Treatment Duration Edit # 1 Set a main treatment duration, elapsed time, Ultrafiltration Set volume, ultrafiltration volume delivered # 2 Send Param Ranges treatment range ex 50 - 300 min # 3 Click the treatment duration edit button. # 4 Verify Top 3 parameters (Volume Delivered, Set Volume, Elapsed time are updated # 5 Verify min and max values for New Treatment duration and perform continue button # 6 Send rejection reason 1 and check the message in the popup # 7 Send the rejection reason 0 and verify the popup closes and verify the fw recieves values # 8 Verify the Duration Edit FW Response value reflect on the next screen # 9 Verify the rejection reason 1 and check the error message in the UI # 10 Verify the rejection reason 0 and check FW recieves the values import names import squish from leahi_dialin.ui import utils from configuration import utility,config,navigation from configuration import 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.common.msg_defs import MsgIds, MsgFieldPositions from leahi_dialin.utils import conversions import can from leahi_dialin.protocols import CAN td =TD_Messaging() can_interface = td.can_interface ArtWindow = None Venouspressurewindow = None venouspressurelimitasymetric = None tmppressurelimut = None saline = None bloodflowrate = None dialysateflow = None dialysatetemp = None bloodFlowrate = None dialtemperature = None dialflow = 0 durationvalue = 0 durationconfirm = None def handle_saline_request( message, timestamp = 0.0): """ Called when the user requests to firmware from UI @return: None """ message = message['message'] index = MsgFieldPositions.START_POS_FIELD_1 state,index = conversions.bytearray_to_integer( message, index) global saline saline = state def handle_treatment_request( message, timestamp = 0.0): """ Called when the user requests to firmware from UI @return: None """ message = message['message'] index = MsgFieldPositions.START_POS_FIELD_1 state,index = conversions.bytearray_to_integer( message, index) global bloodflowrate bloodflowrate = state state,index = conversions.bytearray_to_integer( message, index) global dialysateflow dialysateflow = state val,self.index = conversions.bytearray_to_integer( message, self. index) global dialysatetemp test.log(val) dialysatetemp = val def handle_pressure_request( message, timestamp = 0.0): """ Called when the user requests to firmware from UI @return: None """ message = message['message'] index = MsgFieldPositions.START_POS_FIELD_1 state,index = conversions.bytearray_to_integer( message, index) global ArtWindow ArtWindow = state state,index = conversions.bytearray_to_integer( message, index) global Venouspressurewindow Venouspressurewindow= state state,index = conversions.bytearray_to_integer( message, index) global venouspressurelimitasymetric venouspressurelimitasymetric = state state,index = conversions.bytearray_to_integer( message, index) global tmppressurelimut tmppressurelimut = state def handle_bloodflow_request( message, timestamp = 0.0): """ Called when the user requests to firmware from UI @return: None """ message = message['message'] index = MsgFieldPositions.START_POS_FIELD_1 state,index = conversions.bytearray_to_integer( message, index) global bloodFlowrate bloodFlowrate = state def handle_dialflow_request(message, timestamp = 0.0): message = message['message'] index = MsgFieldPositions.START_POS_FIELD_1 state,index = conversions.bytearray_to_integer( message, index) global dialflow dialflow = state def handle_dialtmp_request(message, timestamp = 0.0): message = message['message'] index = MsgFieldPositions.START_POS_FIELD_1 val,index = conversions.bytearray_to_float( message, index) global dialtemperature dialtemperature = val def handle_duration_request(message,timestamp =0.0): message = message['message'] index = MsgFieldPositions.START_POS_FIELD_1 state,index = conversions.bytearray_to_integer( message, index) global durationvalue durationvalue = state def handle_duration_confirm_request(message,timestamp =0.0): message = message['message'] index = MsgFieldPositions.START_POS_FIELD_1 state,index = conversions.bytearray_to_integer( message, index) global durationconfirm durationconfirm = state def check_pressure_edit_maintreatment(): test.startSection("Pressure Edit") td.td_tx_state( TDTreatmentStates.TREATMENT_DIALYSIS_STATE.value, 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0) td.td_pressure(H2_arterial_pressure = 40, H14_venous_pressure = 50 , limit_state = 0, H2_arterial_min = -390, H2_arterial_max = 220 , H14_venous_min = -90 , H14_venous_max = 410 , H2_arterial_long = 0 , H14_venous_long = 0 , tmp_pressure = 43 , tmp_min = -640 , tmp_max = 210) pressureEdit = waitForObject(names.o_treatmentHome_treatmentPressures_TreatmentPressures) pressureEditButton = utility.findObjectById(pressureEdit, "_editButton") mouseClick(pressureEditButton) arterialwindow_value = waitForObject(names.o_arterialWindow_LabelUnitValueAdjuster) arterial_value =arterialwindow_value.value test.log(str(arterial_value)) venouswindow_value = waitForObject(names.o_venousWindow_LabelUnitValueAdjuster) venous_value = venouswindow_value.value test.log(str(venous_value)) tmpwindow_value = waitForObject(names.o_tmpWindow_LabelUnitValueAdjuster) tmp_value =tmpwindow_value.value test.log(str(tmp_value)) utility.set_value_based_on_target(names.o_arterialWindow_LabelUnitValueAdjuster,80) arterialwindow_value = waitForObject(names.o_arterialWindow_LabelUnitValueAdjuster) change_arterialwindow_value =arterialwindow_value.value test.log(str(change_arterialwindow_value)) utility.set_value_based_on_target(names.o_venousWindow_LabelUnitValueAdjuster,60) venouswindow_value = waitForObject(names.o_venousWindow_LabelUnitValueAdjuster) change_venouswindow_value =venouswindow_value.value test.log(str(change_venouswindow_value)) utility.set_value_based_on_target(names.o_tmpWindow_LabelUnitValueAdjuster,100) tmpwindow_value = waitForObject(names.o_tmpWindow_LabelUnitValueAdjuster) change_tmpwindow_value =tmpwindow_value.value test.log(str(change_tmpwindow_value)) #rejection reason is 1 payload = conversions.integer_to_bytearray(0) payload += conversions.integer_to_bytearray(1) td.cmd_send_general_response(message_id =MsgIds.MSG_ID_TD_PRESSURE_LIMITS_CHANGE_RESPONSE.value, reason=0, accepted=1, is_pure_data = False, has_parameters = True, parameters_payload= payload) rejectionReason = utility.get_object_from_names(names.o_notification_bar) test.compare(rejectionReason.text, "[1] Request is not allowed in the current operating mode", "Rejection Reason text should be :" + str("[1] Request is not allowed in the current operating mode")) # handle sent messages from UI mouseClick(waitForObject(names.o_confirmButton_TouchRect)) #rejection reason 0 payload = conversions.integer_to_bytearray(1) payload += conversions.integer_to_bytearray(0) td.cmd_send_general_response(message_id =MsgIds.MSG_ID_TD_PRESSURE_LIMITS_CHANGE_RESPONSE.value, reason=0, accepted=1, is_pure_data = False, has_parameters = True, parameters_payload= payload) if can_interface is not None: channel_id = CAN.DenaliChannels.ui_to_td_ch_id message_id = MsgIds.MSG_ID_UI_PRESSURE_LIMITS_CHANGE_REQUEST.value can_interface.register_receiving_publication_function(channel_id, message_id, handle_pressure_request) test.verify(waitFor( lambda: ArtWindow == change_arterialwindow_value, 5000), "Testing FW received Arterial Window Value") test.verify(waitFor( lambda: Venouspressurewindow == change_venouswindow_value,5000 ), "Testing Fw received Venous Window values") test.verify(waitFor( lambda: tmppressurelimut == change_tmpwindow_value,5000 ), "Testing Fw received temp Window values") pressurepopup = waitFor(lambda: not object.exists(names.o_HeaderBar_WiFi_Popup), 3000) test.compare(pressurepopup, True, "Popup is not present") test.endSection() def check_saline_edit_maintreatment(): test.startSection("Saline data") td.td_saline( 100 , # target_volume 150 , # cumulative_volume 75 , # bolus_volume 0 ) mouseClick(waitForObject(names.o_treatmentHome_editButton_IconButton)) fluidbolusvolume_value = waitForObject(names.o_valueAdjuster_ValueAdjuster) test.log(str(fluidbolusvolume_value.value)) utility.set_value_based_on_target(names.o_valueAdjuster_ValueAdjuster,200) change_fluidbolusvolume_value = waitForObject(names.o_valueAdjuster_ValueAdjuster).value test.log(str(change_fluidbolusvolume_value)) #saline rejection reason is 1 payload = conversions.integer_to_bytearray(0) payload += conversions.integer_to_bytearray(1) td.cmd_send_general_response(message_id =MsgIds.MSG_ID_TD_BOLUS_VOLUME_CHANGE_RESPONSE.value, reason=0, accepted=1, is_pure_data = False, has_parameters = True, parameters_payload= payload) rejectionReason = utility.get_object_from_names(names.o_notification_bar) test.compare(rejectionReason.text, "[1] Request is not allowed in the current operating mode", "Rejection Reason text should be :" + str("[1] Request is not allowed in the current operating mode")) #rejection reason 0 mouseClick(waitForObject(names.o_confirmButton_TouchRect)) payload = conversions.integer_to_bytearray(1) payload += conversions.integer_to_bytearray(0) td.cmd_send_general_response(message_id =MsgIds.MSG_ID_TD_BOLUS_VOLUME_CHANGE_RESPONSE.value, reason=0, accepted=1, is_pure_data = False, has_parameters = True, parameters_payload= payload) # handle sent messages from UI if can_interface is not None: channel_id = CAN.DenaliChannels.ui_to_td_ch_id message_id = MsgIds.MSG_ID_UI_BOLUS_VOLUME_CHANGE_REQUEST.value can_interface.register_receiving_publication_function(channel_id, message_id, handle_saline_request) test.verify(waitFor( lambda: saline == change_fluidbolusvolume_value, 5000), "Testing FW received Bolus volumeValue") salinepopup = waitFor(lambda: not object.exists(names.o_HeaderBar_WiFi_Popup), 3000) test.compare(salinepopup, True, "Popup is not present") test.endSection() def check_treatement_edit_maintreatment(): test.startSection("Treatment Parameters") td.td_treatment_set_points( blood_flow = 42, dialysate_flow = 43, dialysate_temp = 49) treatmentEdit = waitForObject(names.o_treatmentHome_treatmentFlows_TreatmentFlows) treatmentEditbutton = utility.findObjectById(treatmentEdit, "_editButton") mouseClick(treatmentEditbutton) bloodFlow = waitForObject(names.o_bloodFlowRate_LabelUnitValueAdjuster) bloodflowvalue = utility.findObjectById(bloodFlow, "_valueAdjuster") test.log(str(bloodflowvalue.value)) bloodflowcolor = waitForObject(names.o_bloodFlowRate_LabelUnitValueAdjuster).valueTextColor.name test.compare(str(bloodflowcolor),config.RED_COLOR,"Blood flow text color should be:"+str(config.RED_COLOR)) utility.set_value_based_on_target(names.o_bloodFlowRate_LabelUnitValueAdjuster,"50") changedbloodflowvalue = bloodflowvalue.value test.log(str(changedbloodflowvalue)) changedbloodflowcolor = waitForObject(names.o_bloodFlowRate_LabelUnitValueAdjuster).valueTextColor.name test.compare(str(changedbloodflowcolor), config.WHITE_COLOR, "Blood Flow text color changed to"+ str(config.WHITE_COLOR)) #dialysate flow dialysateFlow = waitForObject(names.o_dialysateFlowRate_LabelUnitValueAdjuster) dialysateflowvalue = utility.findObjectById(dialysateFlow, "_valueAdjuster") test.log(str(dialysateflowvalue.value)) dialysateflowcolor = waitForObject(names.o_dialysateFlowRate_LabelUnitValueAdjuster).valueTextColor.name test.compare(str(dialysateflowcolor),config.RED_COLOR,"Dialysate flow text color should be"+str(config.RED_COLOR)) utility.set_value_based_on_target(names.o_dialysateFlowRate_LabelUnitValueAdjuster,"50") changeddialysateflowvalue =dialysateflowvalue.value test.log(str(changeddialysateflowvalue)) changeddialysateflowcolor = waitForObject(names.o_dialysateFlowRate_LabelUnitValueAdjuster).valueTextColor.name test.compare(str(changeddialysateflowcolor),config.WHITE_COLOR,"Dialysate flow text color changed to"+str(changeddialysateflowcolor)) #dialysate temp dialysateTemp = waitForObject(names.o_dialysateTemperature_LabelUnitValueAdjuster) dialysatetempvalue = utility.findObjectById(dialysateTemp, "_valueAdjuster") test.log(str(dialysatetempvalue.value)) dialysatetempcolor = waitForObject(names.o_dialysateTemperature_LabelUnitValueAdjuster).valueTextColor.name test.compare(str(dialysatetempcolor),config.RED_COLOR,"Dialysate temp color should be"+str(dialysatetempcolor)) utility.set_value_based_on_target(names.o_dialysateTemperature_LabelUnitValueAdjuster,"38") changedialysatetemp = dialysatetempvalue.value test.log(str(changedialysatetemp)) changeddialysatetempcolor =waitForObject(names.o_dialysateTemperature_LabelUnitValueAdjuster).valueTextColor.name test.compare(str(changeddialysatetempcolor),config.WHITE_COLOR,"Dialysate temp text color changed to"+str(config.WHITE_COLOR)) #rejection reason is 1 payload = conversions.integer_to_bytearray(0) payload += conversions.integer_to_bytearray(1) td.cmd_send_general_response(message_id =MsgIds.MSG_ID_TD_TREATMENT_SET_POINTS_CHANGE_RESPONSE.value, reason=0, accepted=1, is_pure_data = False, has_parameters = True, parameters_payload= payload) rejectionReason = utility.get_object_from_names(names.o_notification_bar).text test.compare(rejectionReason, "[1] Request is not allowed in the current operating mode", "Rejection Reason text should be :" + str("[1] Request is not allowed in the current operating mode")) #rejection reason is 0 mouseClick(waitForObject(names.o_confirmButton_TouchRect)) payload = conversions.integer_to_bytearray(1) payload += conversions.integer_to_bytearray(0) td.cmd_send_general_response(message_id =MsgIds.MSG_ID_TD_TREATMENT_SET_POINTS_CHANGE_RESPONSE.value, reason=0, accepted=1, is_pure_data = False, has_parameters = True, parameters_payload= payload) if can_interface is not None: channel_id = CAN.DenaliChannels.ui_to_td_ch_id message_id = MsgIds.MSG_ID_UI_TREATMENT_SET_POINTS_CHANGE_REQUEST.value can_interface.register_receiving_publication_function(channel_id, message_id, handle_treatment_request) test.verify(waitFor( lambda: bloodflowrate == changedbloodflowvalue, 5000), "Testing FW received blood flow Value") test.verify(waitFor( lambda: dialysateflow == changeddialysateflowvalue, 5000), "Testing FW received dialysate flow Value") # test.verify(waitFor( lambda: dialysatetemp == changedialysatetemp, 5000), "Testing FW received dialysate temp Value") treatmentpopup = waitFor(lambda: not object.exists(names.o_HeaderBar_WiFi_Popup), 3000) test.compare(treatmentpopup, True, "Popup is not present") test.endSection() test.startSection("Main treatment screen check the set points") td.td_treatment_set_points( blood_flow = 70, dialysate_flow = 70, dialysate_temp = 36) bloodflowUpArrow = waitForObject(names.o_blood_flow_value) bloodflowUpArrowbutton = utility.findObjectById(bloodflowUpArrow,"_upArrowIcon") mouseClick(bloodflowUpArrowbutton) bloodFlow = utility.get_object_from_names(names.o_blood_flow_value) bloodFlow_properties = object.properties(bloodFlow) changedbloodflow = bloodFlow_properties["value"] if can_interface is not None: channel_id = CAN.DenaliChannels.ui_to_td_ch_id message_id = MsgIds.MSG_ID_UI_TREATMENT_SET_POINT_BLOOD_FLOW_CHANGE_REQUEST.value can_interface.register_receiving_publication_function(channel_id, message_id, handle_bloodflow_request) # handle_bloodflow_request(MsgIds.MSG_ID_UI_TREATMENT_SET_POINT_BLOOD_FLOW_CHANGE_REQUEST.value) test.verify(waitFor( lambda: bloodFlowrate == changedbloodflow+10, 10000), "Testing FW received blood flow Value in main treatment screen") bloodflowdownArrowbutton = utility.findObjectById(bloodflowUpArrow,"_downArrowIcon") mouseClick(bloodflowdownArrowbutton) bloodFlow = utility.get_object_from_names(names.o_blood_flow_value) bloodFlow_properties = object.properties(bloodFlow) changedbloodflow = bloodFlow_properties["value"] if can_interface is not None: channel_id = CAN.DenaliChannels.ui_to_td_ch_id message_id = MsgIds.MSG_ID_UI_TREATMENT_SET_POINT_BLOOD_FLOW_CHANGE_REQUEST.value can_interface.register_receiving_publication_function(channel_id, message_id, handle_bloodflow_request) test.verify(waitFor( lambda: bloodFlowrate == changedbloodflow-10, 5000), "Testing FW received blood flow Value in main treatment screen") dialysateflowuparrow = waitForObject(names.o_dial_flow_value) dialysateflowuparrowbutton = utility.findObjectById(dialysateflowuparrow,"_upArrowIcon") mouseClick(dialysateflowuparrowbutton) dialFlow = utility.get_object_from_names(names.o_dial_flow_value) dialFlow_properties = object.properties(dialFlow) changeddialflow = dialFlow_properties["value"] if can_interface is not None: channel_id = CAN.DenaliChannels.ui_to_td_ch_id message_id = MsgIds.MSG_ID_UI_TREATMENT_SET_POINT_DIALYSATE_FLOW_CHANGE_REQUEST.value can_interface.register_receiving_publication_function(channel_id, message_id, handle_dialflow_request) test.verify(waitFor( lambda: dialflow == changeddialflow+5, 3000), "Testing FW received dial flow Value in main treatment screen") dialysateflowdownarrowbutton = utility.findObjectById(dialysateflowuparrow,"_downArrowIcon") mouseClick(dialysateflowdownarrowbutton) dialFlow = utility.get_object_from_names(names.o_dial_flow_value) dialFlow_properties = object.properties(dialFlow) changeddialflow = dialFlow_properties["value"] if can_interface is not None: channel_id = CAN.DenaliChannels.ui_to_td_ch_id message_id = MsgIds.MSG_ID_UI_TREATMENT_SET_POINT_DIALYSATE_FLOW_CHANGE_REQUEST.value can_interface.register_receiving_publication_function(channel_id, message_id, handle_dialflow_request) test.verify(waitFor( lambda: dialflow == changeddialflow-20, 3000), "Testing FW received dial flow Value in main treatment screen") dialysatetmpuparrow = waitForObject(names.o_dial_tmp_value) dialysatetmpuparrowbutton = utility.findObjectById(dialysatetmpuparrow,"_upArrowIcon") mouseClick(dialysatetmpuparrowbutton) dialtmp = utility.get_object_from_names(names.o_dial_tmp_value) dialtmp_properties = object.properties(dialtmp) changeddialtmp = dialtmp_properties["value"] if can_interface is not None: channel_id = CAN.DenaliChannels.ui_to_td_ch_id message_id = MsgIds.MSG_ID_UI_TREATMENT_SET_POINT_DIALYSATE_TEMPERATURE_CHANGE_REQUEST.value can_interface.register_receiving_publication_function(channel_id, message_id, handle_dialtmp_request) test.verify(waitFor( lambda: dialtemperature == changeddialtmp+0.5, 3000), "Testing FW received dial tmp Value in main treatment screen") dialysatetmpdownarrowbutton = utility.findObjectById(dialysatetmpuparrow,"_downArrowIcon") mouseClick(dialysatetmpdownarrowbutton) dialtmp = utility.get_object_from_names(names.o_dial_tmp_value) dialtmp_properties = object.properties(dialtmp) changeddialtmp = dialtmp_properties["value"] if can_interface is not None: channel_id = CAN.DenaliChannels.ui_to_td_ch_id message_id = MsgIds.MSG_ID_UI_TREATMENT_SET_POINT_DIALYSATE_TEMPERATURE_CHANGE_REQUEST.value can_interface.register_receiving_publication_function(channel_id, message_id, handle_dialtmp_request) test.verify(waitFor( lambda: dialtemperature == changeddialtmp-0.5, 3000), "Testing FW received dial tmp Value in main treatment screen") #rejection reason is 1 payload = conversions.integer_to_bytearray(0) payload += conversions.integer_to_bytearray(1) td.cmd_send_general_response(message_id =MsgIds.MSG_ID_TD_TREATMENT_SET_POINT_BLOOD_FLOW_CHANGE_RESPONSE.value, reason=0, accepted=1, is_pure_data = False, has_parameters = True, parameters_payload= payload) rejectionReason = utility.get_object_from_names(names.o_treatmentHome_notification_NotificationBarSmall) test.compare(rejectionReason.text, "[1] Request is not allowed in the current operating mode", "Rejection Reason text should be :" + str("[1] Request is not allowed in the current operating mode")) #rejection reason is 1 payload = conversions.integer_to_bytearray(1) payload += conversions.integer_to_bytearray(0) td.cmd_send_general_response(message_id =MsgIds.MSG_ID_TD_TREATMENT_SET_POINT_BLOOD_FLOW_CHANGE_RESPONSE.value, reason=0, accepted=1, is_pure_data = False, has_parameters = True, parameters_payload= payload) td.td_treatment_set_points( blood_flow = 94, dialysate_flow = 94, dialysate_temp = 28) bloodflowUpArrow = waitForObject(names.o_blood_flow_value) bloodflowUpArrowbutton = utility.findObjectById(bloodflowUpArrow,"_upArrowIcon") mouseClick(bloodflowUpArrowbutton) if can_interface is not None: channel_id = CAN.DenaliChannels.ui_to_td_ch_id message_id = MsgIds.MSG_ID_UI_TREATMENT_SET_POINT_BLOOD_FLOW_CHANGE_REQUEST.value can_interface.register_receiving_publication_function(channel_id, message_id, handle_bloodflow_request) test.verify(waitFor( lambda: bloodFlowrate == 100, 3000), "Testing FW received blood flow Value in main treatment screen") dialysateflowuparrow = waitForObject(names.o_dial_flow_value) dialysateflowuparrowbutton = utility.findObjectById(dialysateflowuparrow,"_upArrowIcon") mouseClick(dialysateflowuparrowbutton) if can_interface is not None: channel_id = CAN.DenaliChannels.ui_to_td_ch_id message_id = MsgIds.MSG_ID_UI_TREATMENT_SET_POINT_DIALYSATE_FLOW_CHANGE_REQUEST.value can_interface.register_receiving_publication_function(channel_id, message_id, handle_bloodflow_request) test.verify(waitFor( lambda: dialflow == 100, 3000), "Testing FW received dial flow Value in main treatment screen") dialysatetempuparrow = waitForObject(names.o_dial_tmp_value) dialysatetempuparrowbutton = utility.findObjectById(dialysatetempuparrow,"_upArrowIcon") mouseClick(dialysatetempuparrowbutton) if can_interface is not None: channel_id = CAN.DenaliChannels.ui_to_td_ch_id message_id = MsgIds.MSG_ID_UI_TREATMENT_SET_POINT_DIALYSATE_TEMPERATURE_CHANGE_REQUEST.value can_interface.register_receiving_publication_function(channel_id, message_id, handle_bloodflow_request) test.verify(waitFor( lambda: dialtemperature == 35, 50000), "Testing FW received dial tmp Value in main treatment screen") test.endSection() def check_duration_edit_maintreatment(): test.startSection("Treatment Duration Edit") td.td_treatment_time( tx_duration_s = 51 , tx_elapsed_s = 5 , tx_remaining_s = 6 ) td.td_ultrafiltration(10,0.53,0.37,0) td.td_param_ranges(min_tx_time_s = 50, max_tx_time_s = 300, min_uf_volume_mL = 0.0, max_uf_volume_mL = 1790, min_dial_rate_mLH = 0, max_dial_rate_mLH = 0) treatmentEdit = waitForObject(names.o_treatment_duration) treatmentEditbutton = utility.findObjectById(treatmentEdit,"_editTimeIcon") mouseClick(treatmentEditbutton) ufvolumeremoved = waitForObject(names.o_ufVolumeRemoved_LabelUnitText).value test.log(str(ufvolumeremoved)) ufvolumegoal =waitForObject(names.o_ufVolumeGoal_LabelUnitText) test.log(str(ufvolumegoal)) treatmenttimeelapsed =waitForObject(names.o_timeElapsed_LabelUnitText) test.log(str(treatmenttimeelapsed)) utility.set_value_based_on_target(names.o_newTreatmentDuration_LabelUnitValueAdjuster,51) utility.set_value_based_on_target(names.o_newTreatmentDuration_LabelUnitValueAdjuster,300) mouseClick(names.o_continueButton_TouchRect) td.td_duration_validate_response(vRejectionReason =0, vDuration= 0, vUFVolume= 0.0, vUFRate= 0.0) if can_interface is not None: channel_id = CAN.DenaliChannels.ui_to_td_ch_id message_id = MsgIds.MSG_ID_UI_DURATION_VALIDATE_REQUEST.value can_interface.register_receiving_publication_function(channel_id, message_id, handle_duration_request) test.verify(waitFor( lambda: durationvalue == 300, 3000), "Testing FW received duration Value in main treatment screen") td.td_duration_validate_response(vRejectionReason =1, vDuration= 0, vUFVolume= 0.0, vUFRate= 0.0) rejectionReason = utility.get_object_from_names(names.o_notification_bar) test.compare(rejectionReason.text, "[1] Request is not allowed in the current operating mode", "Rejection Reason text should be :" + str("[1] Request is not allowed in the current operating mode")) td.td_duration_validate_response(vRejectionReason =0, vDuration= 78, vUFVolume= 0.5, vUFRate= 0.6) #check the values in the ui newufrate = waitForObject(names.o_ufRate_LabelUnitText).value test.compare(newufrate,"0.60","Duration value is updated in"+str(newufrate)) newduration = waitForObject(names.o_newTreatmentDuration_LabelUnitText).value test.compare(newduration,"78","UF rate value is updated in"+str(newduration)) payload = conversions.integer_to_bytearray(0) payload += conversions.integer_to_bytearray(1) td.cmd_send_general_response(message_id =MsgIds.MSG_ID_TD_DURATION_CONFIRM_RESPONSE.value, reason=0, accepted=1, is_pure_data = False, has_parameters = True, parameters_payload= payload) rejectionReason = utility.get_object_from_names(names.o_notification_bar).text test.compare(rejectionReason, "[1] Request is not allowed in the current operating mode", "Rejection Reason text should be :" + str("[1] Request is not allowed in the current operating mode")) #rejection reason is 0 mouseClick(waitForObject(names.o_confirmButton_TouchRect)) payload = conversions.integer_to_bytearray(1) payload += conversions.integer_to_bytearray(0) td.cmd_send_general_response(message_id =MsgIds.MSG_ID_TD_DURATION_CONFIRM_RESPONSE.value, reason=0, accepted=1, is_pure_data = False, has_parameters = True, parameters_payload= payload) if can_interface is not None: channel_id = CAN.DenaliChannels.ui_to_td_ch_id message_id = MsgIds.MSG_ID_UI_DURATION_CONFIRM_REQUEST.value can_interface.register_receiving_publication_function(channel_id, message_id, handle_duration_confirm_request) test.verify(waitFor( lambda: durationconfirm == 78, 5000), "Testing FW received duration Value in main treatment screen") treatmentpopup = waitFor(lambda: not object.exists(names.o_HeaderBar_WiFi_Popup), 3000) test.compare(treatmentpopup, True, "Popup is not present") test.endSection() def main(): utils.tstStart(__file__) startApplication(config.AUT_NAME) td.td_operation_mode(TDOpModes.MODE_STAN.value) mouseClick(waitForObject(names.o_createTreatmentRect_TouchRect)) td.td_operation_mode(TDOpModes.MODE_PRET.value) utility.verify_create_treatment_parameters() check_pressure_edit_maintreatment() check_saline_edit_maintreatment() check_treatement_edit_maintreatment() check_duration_edit_maintreatment()