# Subject/Title: LDT- 1632 HeaderBar - SW - 02 - Prescription - Q&R - 15: SIT - Software Integration Tests - Squish Qt # # Functionalities: Testing all functionalities of Header bar prescription # # Steps: # 1.Launch the Leahi application. # 2.Change the Opmode to Pretreatment. # 3.Verify that the Create Rx header bar icon is visible. # 4.Verify the following conditions: # a. The three-dot menu in the Prescription screen is visible. # b. The Validate/Confirm button is visible. # c. The user can enter parameters and tap Validate/Confirm. # d. After confirmation, the popup closes. # 5.When the Opmode is switched to Treatment mode: # a. The three-dot menu in the Prescription screen is not visible. # b. The Validate/Confirm button is not visible. import names from leahi_dialin.ui import utils from configuration import config from configuration import utility from leahi_dialin.ui.td_messaging import TD_Messaging from leahi_dialin.common.td_defs import TDOpModes td = TD_Messaging() DIALYZER_TYPE = ["Diacap Pro 13H","Diacap Pro 16H", "Diacap Pro 19H", "Optiflux F160NRe", "Optiflux F180NRe", "Optiflux F200NRe","Optiflux F250NRe"] ACID_CONCENTRATE = ["2.0 K, 2.00 Ca, 1 Mg", "1.0 K, 2.50 Ca, 1 Mg","2.0 K, 2.50 Ca, 1 Mg","3.0 K, 2.50 Ca, 1 Mg"] BUTTON_TYPE = ["Select Rx","Edit Rx","Clear All"] VITALS = ["OFF","5","10","15","20","30","60"] BICARBONATE = ["Sodium Bicarbonate"] VALIDATE = "VALIDATE" CONFIRM = "CONFIRM" def verify_create_treatment_parameters(): test.startSection("Create treatment parameters") mouseClick(waitForObject(names.o_pretreatmentPatientIDEntry_TextEntry)) waitForObject(names.o_pretreatmentPatientIDEntry_TextEntry).text ="abcd" utility.set_value_based_on_target(names.o_bloodFlowRateControl_ValueAdjuster, 50) utility.set_value_based_on_target(names.o_dialysateFlowRateControl_ValueAdjuster, 50) utility.set_value_based_on_target(names.o_durationControl_ValueAdjuster, 60) utility.set_value_based_on_target(names.o_heparinBolusVolumeControl_ValueAdjuster, 0.2) utility.set_value_based_on_target(names.o_heparinDispensingRateControl_ValueAdjuster, 0.2) utility.set_value_based_on_target(names.o_heparinStopTimeControl_ValueAdjuster, 60) utility.select_different_dropdown(names.o_acidConcentrateComboBox_BaseComboBox,ACID_CONCENTRATE,2) utility.set_value_based_on_target(names.o_dialysateTemperatureControl_ValueAdjuster,37.0) utility.select_different_dropdown(names.o_dialyzerTypeComboBox_BaseComboBox,DIALYZER_TYPE,2) utility.set_value_based_on_target(names.o_salineBolusVolumeControl_ValueAdjuster, 100) utility.select_different_dropdown(names.o_bpMeasurementIntervalControl_BaseComboBox,VITALS,1) utility.select_different_dropdown(names.o_bicarbonateConcentrateComboBox_BaseComboBox,BICARBONATE,0) mouseClick(waitForObject(names.o_confirmButton_ConfirmButton)) td.td_Treatment_Parameters_Validation( vAccepted = 1, vBloodFlowRateRejectReason = 0, vDialysateFlowRateRejectReason = 0, vTreatmentDurationRejectReason = 0, vSalineBolusVolumeRejectReason = 0, vHeparinStopTimeRejectReason = 0, vHeparinTypeRejectReason = 0, vAcidConcentrateRejectReason = 0, vBicarbonateConcentrateRejectReason = 0, vDialyzerTypeRejectReason = 0, vBloodPressureMeasureIntervalRejectReason = 0, vRinsebackFlowRateRejectReason = 0, vRinsebackVolumeRejectReason = 0, vArterialPressureLimitWindowRejectReason = 0, vVenousPressureLimitWindowRejectReason = 0, vVenousPressureLimitAsymtrcRejectReason = 0, vTransmembranePressureLimitWindowRejectReason= 0, vDialysateTempRejectReason = 0, vHeparinDispensingRateRejectReason = 0, vHeparinBolusVolumeRejectReason = 0 ) test.compare(waitForObjectExists(names.o_qrCode_Image,1000).visible, True,"QR Code is visible") #Check the confirm button text and perform the mouse click confirmButton = waitForObject(names.o_confirmButton_ConfirmButton) confirmText = utility.findObjectById(confirmButton, "_text") test.compare(confirmText.text, CONFIRM, "Button text should be"+str(CONFIRM)) test.compare(confirmButton.enabled, True, "Confirm button is enabled") mouseClick(confirmText) test.compare(waitForObject(names.o_PreTreatmentBase_instructionView_InstructionView,2000).visible, True, "After click on confirm button Popup is closed") test.endSection() def main(): utils.tstStart(__file__) startApplication(config.AUT_NAME + " -q") td.td_operation_mode(TDOpModes.MODE_STAN.value) # verify Standby screen test.verify(waitForObjectExists(names.o_standByScreen_MainHome), "In Standby") td.td_operation_mode(TDOpModes.MODE_TPAR.value, 0) test.startSection("Verify the Prescription Header bar in Pretreatment mode" ) td.td_operation_mode(TDOpModes.MODE_PRET.value, 0) test.compare(waitForObject(names.o_prescriptionButton_IconButton).visible, True,"The Create Rx button is visible") mouseClick(waitForObject(names.o_prescriptionButton_IconButton)) test.compare(waitForObject(names.o_prescriptionMenu_BaseComboBox).visible, True, "Prescription menu is visible") verify_create_treatment_parameters() test.endSection() test.startSection("Verify the Prescription Header bar in treatment mode") td.td_operation_mode(TDOpModes.MODE_TREA.value, 0) test.compare(waitForObject(names.o_prescriptionButton_IconButton).visible, True,"The Create Rx button is visible") mouseClick(waitForObject(names.o_prescriptionButton_IconButton)) test.compare(waitForObjectExists(names.o_prescriptionMenu_BaseComboBox).visible, False,"Prescription menu is not visible") validateButton =waitForObjectExists(names.o_confirmButton_ConfirmButton) test.compare(validateButton.visible, False, "Validate button is not enabled") test.endSection() utils.tstDone()