# Subject/Title: LDT -3672 SW Misc & Enhc - SW - 02 - New Design - CreateRx - Q&R - 15: SIT - Software Integration Tests - Squish Qt # # Functionalities: Testing all functionalities of Treatment parameters validation mode(Create RX) # # Steps: # 1 Create RX: # - Verify the treatment modality set to HD # - Verify the treatment modality set to HDF # - When Treatment mode set to HDF check the below buttons are visible # - a.In HDF mode HDF operation Mode button is visible # - b.In HDF mode Substitution Fluid Volume button is visible import names from names import * import squish from leahi_dialin.ui import utils from configuration import config,utility,navigation from leahi_dialin.ui.td_messaging import TD_Messaging from leahi_dialin.common.td_defs import TDOpModes from builtins import int as pyInt from squish import * from leahi_dialin.protocols import CAN from leahi_dialin.common.msg_defs import MsgIds, MsgFieldPositions td = TD_Messaging() postTreatmentState = "-1" def handle_post_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 postTreatmentState postTreatmentState = str(state) def main(): utils.tstStart(__file__) can_interface = td.can_interface global endTreatmentState # 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_ADJUST_PATIENT_DISCONNECT_CONFIRM_REQUEST.value can_interface.register_receiving_publication_function(channel_id, message_id, handle_post_treatment_request) test.startSection("Post-Treatment Foundation") startApplication(utility.aut("-q")) td.td_operation_mode(TDOpModes.MODE_STAN.value) td.td_operation_mode(TDOpModes.MODE_POST.value) test.compare(waitForObjectExists(names.o_PostTreatmentBase_instructionView_InstructionView, 3000).title, config.DISCONNECT_PATIENT_TITLE,"Comparison of Disconnect Page Title Text",) disconnect_obj = waitForObjectExists(names.o_PostTreatmentBase_instructionView_InstructionView, 3000) disconnect_text = utility.findChildByText(disconnect_obj, config.DISCONNECT_PATIENT_TEXT) test.compare(str(disconnect_text.text),config.DISCONNECT_PATIENT_TEXT,"Comparison of Disconnect Page Text") mouseClick(waitForObject(names.o_PostTreatmentStack_confirmButton_ConfirmButton)) test.verify(waitFor("'postTreatmentState == 6'", 5000), "Testing UI -> TD message end state") td.td_patient_disconnect_confirm_response(vAccepted= 1, vRejectionReason= 0) test.log("values")