Index: suite_leahi/shared/scripts/names.py =================================================================== diff -u -rbddd2fe08aac52e286b53a811f0ab41919c7fea2 -ra5a51ad738d0fb8a3db5627b222519a986c3e952 --- suite_leahi/shared/scripts/names.py (.../names.py) (revision bddd2fe08aac52e286b53a811f0ab41919c7fea2) +++ suite_leahi/shared/scripts/names.py (.../names.py) (revision a5a51ad738d0fb8a3db5627b222519a986c3e952) @@ -154,4 +154,25 @@ o_PreTreatment_vitalsCombobox_BaseCombobox = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_bpMeasurementIntervalControl", "type": "BaseComboBox", "unnamed": 1 } o_PreTreatmentCreate_Text = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "type": "Text", "unnamed": 1 } +#prescription header bar +o_prescriptionButton_IconButton = {"container": o_Gui_MainView, "id": "_prescriptionButton", "type": "IconButton", "unnamed": 1 } +o_prescriptionMenu_BaseComboBox = {"container": o_Overlay, "id": "_prescriptionMenu", "type": "BaseComboBox", "unnamed": 1 } +o_pretreatmentPatientIDEntry_TextEntry = {"container": o_Overlay, "id": "_pretreatmentPatientIDEntry", "type": "TextEntry", "unnamed": 1 } +o_bloodFlowRateControl_ValueAdjuster = {"container": o_Overlay, "id": "_bloodFlowRateControl", "type": "ValueAdjuster", "unnamed": 1 } +o_dialysateFlowRateControl_ValueAdjuster = {"container": o_Overlay, "id": "_dialysateFlowRateControl", "type": "ValueAdjuster", "unnamed": 1 } +o_durationControl_ValueAdjuster = {"container": o_Overlay, "id": "_durationControl", "type": "ValueAdjuster", "unnamed": 1 } +o_heparinBolusVolumeControl_ValueAdjuster = {"container": o_Overlay, "id": "_heparinBolusVolumeControl", "type": "ValueAdjuster", "unnamed": 1 } +o_heparinDispensingRateControl_ValueAdjuster = {"container": o_Overlay, "id": "_heparinDispensingRateControl", "type": "ValueAdjuster", "unnamed": 1 } +o_heparinStopTimeControl_ValueAdjuster = {"container": o_Overlay, "id": "_heparinStopTimeControl", "type": "ValueAdjuster", "unnamed": 1 } +o_acidConcentrateComboBox_BaseComboBox = {"container": o_Overlay, "id": "_acidConcentrateComboBox", "type": "BaseComboBox", "unnamed": 1 } +o_dialysateTemperatureControl_ValueAdjuster = {"container": o_Overlay, "id": "_dialysateTemperatureControl", "type": "ValueAdjuster", "unnamed": 1 } +o_dialyzerTypeComboBox_BaseComboBox = {"container": o_Overlay, "id": "_dialyzerTypeComboBox", "type": "BaseComboBox", "unnamed": 1 } +o_salineBolusVolumeControl_ValueAdjuster = {"container": o_Overlay, "id": "_salineBolusVolumeControl", "type": "ValueAdjuster", "unnamed": 1 } +o_bpMeasurementIntervalControl_BaseComboBox = {"container": o_Overlay, "id": "_bpMeasurementIntervalControl", "type": "BaseComboBox", "unnamed": 1 } +o_bicarbonateConcentrateComboBox_BaseComboBox = {"container": o_Overlay, "id": "_bicarbonateConcentrateComboBox", "type": "BaseComboBox", "unnamed": 1 } +o_confirmButton_ConfirmButton = {"container": o_Overlay, "id": "_confirmButton", "type": "ConfirmButton", "unnamed": 1 } +o_qrCode_Image = {"container": o_Overlay, "id": "_qrCode", "type": "Image", "unnamed": 1 } +o_preTreatmentStack_PreTreatmentStack = {"container": o_Gui_MainView, "id": "_preTreatmentStack", "type": "PreTreatmentStack", "unnamed": 1 } +o_preTreatmentStack_PreTreatmentBase_PreTreatmentBase = {"container": o_preTreatmentStack_PreTreatmentStack, "objectName": "_PreTreatmentBase", "type": "PreTreatmentBase" } +o_PreTreatmentBase_instructionView_InstructionView = {"container": o_preTreatmentStack_PreTreatmentBase_PreTreatmentBase, "id": "_instructionView", "type": "InstructionView", "unnamed": 1 } Index: suite_leahi/tst_headerbar_prescription/test.py =================================================================== diff -u --- suite_leahi/tst_headerbar_prescription/test.py (revision 0) +++ suite_leahi/tst_headerbar_prescription/test.py (revision a5a51ad738d0fb8a3db5627b222519a986c3e952) @@ -0,0 +1,116 @@ +# 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() + + + \ No newline at end of file