Index: suite_leahi/shared/scripts/names.py =================================================================== diff -u -rd75105d743a558f0e9260e0b0339611bc99ae586 -r5262e5d8ab63730fc628ebb6a9059bcdccfe2e09 --- suite_leahi/shared/scripts/names.py (.../names.py) (revision d75105d743a558f0e9260e0b0339611bc99ae586) +++ suite_leahi/shared/scripts/names.py (.../names.py) (revision 5262e5d8ab63730fc628ebb6a9059bcdccfe2e09) @@ -84,29 +84,27 @@ o_heparinStopTime_OffText = {"container": o_heparinStopTimeControl_ValueAdjuster, "type": "Text", "unnamed": 1} o_acidConcentrate_LabelUnitContainer = {"container": o_Overlay, "id": "_acidConcentrate", "type": "LabelUnitContainer", "unnamed": 1} o_acidConcentrateComboBox_BaseComboBox = {"container": o_Overlay, "id": "_acidConcentrateComboBox", "type": "BaseComboBox", "unnamed": 1} -o_icon_Image = {"container": o_Overlay, "id": "_icon", "source": "qrc:/images/iChevronDown", "type": "Image", "unnamed": 1} + o_potassiumValueControl_ValueAdjuster = {"container": o_Overlay, "id": "_potassiumValueControl", "type": "ValueAdjuster", "unnamed": 1} o_calciumValueControl_ValueAdjuster = {"container": o_Overlay, "id": "_calciumValueControl", "type": "ValueAdjuster", "unnamed": 1} o_save_button = {"container": o_Overlay, "id": "_saveButton", "type": "TouchRect", "unnamed": 1} -o_iconImage_Image_2 = {"container": o_Gui_MainView, "id": "_iconImage", "source": "qrc:/images/iPrescription", "type": "Image", "unnamed": 1} + o_editImage = {"container": o_acidConcentrate_LabelUnitContainer, "id": "_iconImage", "source": "qrc:/images/iEdit", "type": "Image", "unnamed": 1} -o_iconImage_Image_4 = {"container": o_Overlay, "id": "_iconImage", "occurrence": 9, "source": "qrc:/images/iArrowRight", "type": "Image", "unnamed": 1} + o_dialyzerTypeComboBox_BaseComboBox = {"container": o_Overlay, "id": "_dialyzerTypeComboBox", "type": "BaseComboBox", "unnamed": 1} o_potassium_LabelUnitContainer = {"container": o_Overlay, "id": "_potassium", "type": "LabelUnitContainer", "unnamed": 1} -o_leftArrow_IconButton = {"container": o_potassium_LabelUnitContainer, "id": "_leftArrow", "type": "IconButton", "unnamed": 1} +o_potassium_leftIconButton = {"container": o_potassium_LabelUnitContainer, "id": "_leftArrow", "type": "IconButton", "unnamed": 1} o_calcium_LabelUnitContainer = {"container": o_Overlay, "id": "_calcium", "type": "LabelUnitContainer", "unnamed": 1} -o_leftArrow_IconButton2 = {"container": o_calcium_LabelUnitContainer, "id": "_leftArrow", "type": "IconButton", "unnamed": 1} +o_calcium_leftIconButton = {"container": o_calcium_LabelUnitContainer, "id": "_leftArrow", "type": "IconButton", "unnamed": 1} o_dialyzerType_LabelUnitContainer = {"container": o_Overlay, "id": "_dialyzerType", "type": "LabelUnitContainer", "unnamed": 1} o_qrCode_Image = {"container": o_Overlay, "id": "_qrCode", "type": "Image" } -o_prescriptionMenu_BaseComboBox = {"container": o_Overlay, "id": "_prescriptionMenu", "type": "BaseComboBox", "unnamed": 1} + o_bicarbonateConcentrate_LabelUnitContainer = {"container": o_Overlay, "id": "_bicarbonateConcentrate", "type": "LabelUnitContainer", "unnamed": 1} -o_bicarbonateConcentrateComboBox_BaseComboBox={"container": o_Overlay, "id": "_bicarbonateConcentrateComboBox", "type": "BaseComboBox", "unnamed": 1} -o_icon_Image_2 = {"container": o_bicarbonateConcentrateComboBox_BaseComboBox, "id": "_icon", "source": "qrc:/images/iChevronDown", "type": "Image", "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} -keyboard_input = {"container": o_Gui_MainView, "type": "Text", "unnamed": 1, "visible": True } -keyboard_switch = {"container": o_Gui_MainView, "id": "_shiftKeyIcon", "source": "qrc:/plugins/QtQuick/VirtualKeyboard/Styles/denali/images/iShiftNormal.svg", "type": "Image", "unnamed": 1, "visible": True} -keyboard_switch2 = {"container": o_Gui_MainView, "id": "_shiftKeyIcon", "source": "qrc:/plugins/QtQuick/VirtualKeyboard/Styles/denali/images/iShiftActive.svg", "type": "Image", "unnamed": 1, "visible": True} -o_delegate_ItemDelegate = {"checkable": False, "container": o_Overlay, "id": "_delegate", "type": "ItemDelegate", "unnamed": 1 } -o_delegate_ItemDelegate_2 = {"checkable": False, "container": o_Overlay, "id": "_delegate", "occurrence": 2, "type": "ItemDelegate", "unnamed": 1 } -o_delegate_ItemDelegate_3 = {"checkable": False, "container": o_Overlay, "id": "_delegate", "occurrence": 4, "type": "ItemDelegate", "unnamed": 1 } -o_delegate_ItemDelegate_4 = {"checkable": False, "container": o_Overlay, "id": "_delegate", "occurrence": 3, "type": "ItemDelegate", "unnamed": 1 } \ No newline at end of file +keyboard_input = {"container": o_Gui_MainView, "type": "Text", "unnamed": 1, "visible": True } +keyboard_switch = {"container": o_Gui_MainView, "id": "_shiftKeyIcon", "source": "qrc:/plugins/QtQuick/VirtualKeyboard/Styles/denali/images/iShiftNormal.svg", "type": "Image", "unnamed": 1} +keyboard_switch2 = {"container": o_Gui_MainView, "id": "_shiftKeyIcon", "source": "qrc:/plugins/QtQuick/VirtualKeyboard/Styles/denali/images/iShiftActive.svg", "type": "Image", "unnamed": 1} +o_option_combo_box = {"container": o_Overlay, "type": "Text", "unnamed": 1 } +o_prescriptionMenu_BaseComboBox = {"container": o_Overlay, "id": "_prescriptionMenu", "type": "BaseComboBox", "unnamed": 1} Index: suite_leahi/tst_Headerbar_Prescription/test.py =================================================================== diff -u -rd75105d743a558f0e9260e0b0339611bc99ae586 -r5262e5d8ab63730fc628ebb6a9059bcdccfe2e09 --- suite_leahi/tst_Headerbar_Prescription/test.py (.../test.py) (revision d75105d743a558f0e9260e0b0339611bc99ae586) +++ suite_leahi/tst_Headerbar_Prescription/test.py (.../test.py) (revision 5262e5d8ab63730fc628ebb6a9059bcdccfe2e09) @@ -21,18 +21,11 @@ from leahi_dialin.ui.td_messaging import TD_Messaging from leahi_dialin.common.td_defs import TDOpModes from builtins import int as pyInt +from configuration import utility import squish PATIENT_ID_COMBINATION = { - "qwerty" : "qwerty", - "sampleid" : "sampleid", - "abcdefghijklmnop" : "abcdefghijklmnop", - "patientid" : "patientid", - "username" : "username", - "sA@MpLE#123" : "sAMpLE123", - "A@BH&321" : "ABH321", - "5432@qwerty" : "5432qwerty", - "abcd-SAMPLe" : "abcd-SAMPLe" + "qwertyuio-2345678901" : "qwertyuio-2345678901", } KEYBOARD_SWITCH = ["ABC", "&123"] @@ -94,7 +87,7 @@ "Rinseback Flow Rate" : [75], } COLOR_CODES = "#ffa500" - +BUTTON_TYPE =["Select Rx","Edit Rx","Clear All"] td =TD_Messaging() def keyboard_object_map_helper(text): """ @@ -178,6 +171,25 @@ test.compare(actual_value, (patient_id_input.text), "Patient id should be -> "+ str(actual_value)) test.log("User successfully authenticated through patient id -> " + expected_value + "using keypad.") +def custom_object_for_combo_box(text): + """ + Method to set custom object property for export option + @param text : (string) parameter text + """ + names.o_option_combo_box["text"] = text + return names.o_option_combo_box + +def select_different_dropdown(object,type,whichTypeIndex): + type_combo_box = utility.get_object_from_names(object, error_message="Combo box object is missing") + if type_combo_box is not None: + mouseClick(waitForObjectExists(object)) + + type_option = utility.get_object_from_names(custom_object_for_combo_box(type[whichTypeIndex]),error_message=f"Option {DIALYZER_TYPE[whichTypeIndex]} object is missing",timeout_ms=5000) + if type_option is not None: + mouseClick(type_option) + return True + return False # default return if not successful + def verify_create_custom_treatment_parameter(): """ Method to set create custom treatment value @@ -247,52 +259,40 @@ test.startSection("Verification of Bicarbonate Value") test.compare(waitForObject(names.o_bicarbonateConcentrate_LabelUnitContainer).text, BICARBONATE_CONCENTRATE_TITLE, "Parameter should be -> "+str(BICARBONATE_CONCENTRATE_TITLE)) - mouseClick(waitForObject(names.o_bicarbonateConcentrateComboBox_BaseComboBox)) - mouseClick(waitForObject(names.o_delegate_ItemDelegate)) + select_different_dropdown(names.o_bicarbonateConcentrateComboBox_BaseComboBox,BICARBONATE_CONCENTRATE_TITLE,0) test.compare(waitForObject(names.o_bicarbonateConcentrateComboBox_BaseComboBox).currentText, "Sodium Bicarbonate", " Biconcentrate value should be :"+str("Sodium Bicarbonate")) - + test.startSection("Verification of acid concentrate type") test.compare(waitForObject(names.o_acidConcentrate_LabelUnitContainer).text, ACID_CONCENTRATE_TITLE, "Parameter should be -> "+str(ACID_CONCENTRATE_TITLE)) mouseClick(waitForObject(names.o_editImage)) - mouseClick(waitForObject(names.o_leftArrow_IconButton)) - mouseClick(waitForObject(names.o_leftArrow_IconButton2)) + mouseClick(waitForObject(names.o_potassium_leftIconButton)) + mouseClick(waitForObject(names.o_calcium_leftIconButton)) mouseClick(waitForObject(names.o_save_button)) - mouseClick(waitForObject(names.o_acidConcentrateComboBox_BaseComboBox)) - mouseClick(waitForObject(names.o_delegate_ItemDelegate_3)) - test.compare(waitForObject(names.o_acidConcentrateComboBox_BaseComboBox).currentText, ACID_CONCENTRATE[3], "Acid concentrate value should be :"+str(ACID_CONCENTRATE[3])) - mouseClick(waitForObject(names.o_acidConcentrateComboBox_BaseComboBox)) - mouseClick(waitForObject(names.o_delegate_ItemDelegate_2)) - test.compare(waitForObject(names.o_acidConcentrateComboBox_BaseComboBox).currentText, ACID_CONCENTRATE[2], "Acid concentrate value should be :"+str(ACID_CONCENTRATE[2])) - mouseClick(waitForObject(names.o_acidConcentrateComboBox_BaseComboBox)) - mouseClick(waitForObject(names.o_delegate_ItemDelegate_2)) - test.compare(waitForObject(names.o_acidConcentrateComboBox_BaseComboBox).currentText, ACID_CONCENTRATE[1], "Acid concentrate value should be :"+str(ACID_CONCENTRATE[1])) - mouseClick(waitForObject(names.o_acidConcentrateComboBox_BaseComboBox)) - mouseClick(waitForObject(names.o_delegate_ItemDelegate_2)) + select_different_dropdown(names.o_acidConcentrateComboBox_BaseComboBox,ACID_CONCENTRATE,0) test.compare(waitForObject(names.o_acidConcentrateComboBox_BaseComboBox).currentText, ACID_CONCENTRATE[0], "Acid concentrate value should be :"+str(ACID_CONCENTRATE[0])) + select_different_dropdown(names.o_acidConcentrateComboBox_BaseComboBox,ACID_CONCENTRATE,1) + test.compare(waitForObject(names.o_acidConcentrateComboBox_BaseComboBox).currentText, ACID_CONCENTRATE[1], "Acid concentrate value should be :"+str(ACID_CONCENTRATE[1])) + select_different_dropdown(names.o_acidConcentrateComboBox_BaseComboBox,ACID_CONCENTRATE,2) + test.compare(waitForObject(names.o_acidConcentrateComboBox_BaseComboBox).currentText, ACID_CONCENTRATE[2], "Acid concentrate value should be :"+str(ACID_CONCENTRATE[2])) + select_different_dropdown(names.o_acidConcentrateComboBox_BaseComboBox,ACID_CONCENTRATE,3) + test.compare(waitForObject(names.o_acidConcentrateComboBox_BaseComboBox).currentText, ACID_CONCENTRATE[3], "Acid concentrate value should be :"+str(ACID_CONCENTRATE[3])) test.endSection() test.startSection("Verification of dialyzer type") test.compare(waitForObject(names.o_dialyzerType_LabelUnitContainer).text, DIALYZER_TYPE_TITLE, "Parameter should be -> "+str(DIALYZER_TYPE_TITLE)) - mouseClick(names.o_dialyzerTypeComboBox_BaseComboBox) - mouseClick(waitForObject(names.o_delegate_ItemDelegate)) + select_different_dropdown(names.o_dialyzerTypeComboBox_BaseComboBox,DIALYZER_TYPE,0) test.compare(waitForObject(names.o_dialyzerTypeComboBox_BaseComboBox).currentText, DIALYZER_TYPE[0], "Dialyzer type value should be :"+str(DIALYZER_TYPE[0])) - mouseClick(names.o_dialyzerTypeComboBox_BaseComboBox) - mouseClick(waitForObject(names.o_delegate_ItemDelegate_2)) + select_different_dropdown(names.o_dialyzerTypeComboBox_BaseComboBox,DIALYZER_TYPE,1) test.compare(waitForObject(names.o_dialyzerTypeComboBox_BaseComboBox).currentText, DIALYZER_TYPE[1], "Dialyzer type value should be :"+str(DIALYZER_TYPE[1])) - mouseClick(names.o_dialyzerTypeComboBox_BaseComboBox) - mouseClick(waitForObject(names.o_delegate_ItemDelegate_2)) + select_different_dropdown(names.o_dialyzerTypeComboBox_BaseComboBox,DIALYZER_TYPE,2) test.compare(waitForObject(names.o_dialyzerTypeComboBox_BaseComboBox).currentText, DIALYZER_TYPE[2], "Dialyzer type value should be :"+str(DIALYZER_TYPE[2])) - mouseClick(names.o_dialyzerTypeComboBox_BaseComboBox) - mouseClick(waitForObject(names.o_delegate_ItemDelegate_2)) + select_different_dropdown(names.o_dialyzerTypeComboBox_BaseComboBox,DIALYZER_TYPE,3) test.compare(waitForObject(names.o_dialyzerTypeComboBox_BaseComboBox).currentText, DIALYZER_TYPE[3], "Dialyzer type value should be :"+str(DIALYZER_TYPE[3])) - mouseClick(names.o_dialyzerTypeComboBox_BaseComboBox) - mouseClick(waitForObject(names.o_delegate_ItemDelegate_2)) + select_different_dropdown(names.o_dialyzerTypeComboBox_BaseComboBox,DIALYZER_TYPE,4) test.compare(waitForObject(names.o_dialyzerTypeComboBox_BaseComboBox).currentText, DIALYZER_TYPE[4], "Dialyzer type value should be :"+str(DIALYZER_TYPE[4])) - mouseClick(names.o_dialyzerTypeComboBox_BaseComboBox) - mouseClick(waitForObject(names.o_delegate_ItemDelegate_2)) + select_different_dropdown(names.o_dialyzerTypeComboBox_BaseComboBox,DIALYZER_TYPE,5) test.compare(waitForObject(names.o_dialyzerTypeComboBox_BaseComboBox).currentText, DIALYZER_TYPE[5], "Dialyzer type value should be :"+str(DIALYZER_TYPE[5])) - mouseClick(names.o_dialyzerTypeComboBox_BaseComboBox) - mouseClick(waitForObject(names.o_delegate_ItemDelegate_2)) + select_different_dropdown(names.o_dialyzerTypeComboBox_BaseComboBox,DIALYZER_TYPE,6) test.compare(waitForObject(names.o_dialyzerTypeComboBox_BaseComboBox).currentText, DIALYZER_TYPE[6], "Dialyzer type value should be :"+str(DIALYZER_TYPE[6])) test.endSection() @@ -416,7 +416,8 @@ utils.waitForGUI(3) mouseClick(waitForObjectExists(names.o_prescriptionMenu_BaseComboBox)) - mouseClick(waitForObject(names.o_delegate_ItemDelegate)) + utils.waitForGUI(10) + select_different_dropdown(names.o_prescriptionMenu_BaseComboBox,BUTTON_TYPE,1) test.startSection("Verification of blood flow values") test.compare(waitForObject(names.o_bloodFlowRate_LabelUnitContainer).text, BLOOD_FLOW_RATE, "Parameter should be -> "+str(BLOOD_FLOW_RATE)) for blood_flow_rate in CREATE_TREATMENT_PARAMETER[BLOOD_FLOW_RATE]: @@ -501,8 +502,8 @@ ) utils.waitForGUI(3) mouseClick(waitForObjectExists(names.o_prescriptionButton_IconButton)) - mouseClick(waitForObjectExists(names.o_prescriptionMenu_BaseComboBox)) - mouseClick(waitForObject(names.o_delegate_ItemDelegate_4)) + utils.waitForGUI(2) + select_different_dropdown(names.o_prescriptionMenu_BaseComboBox,BUTTON_TYPE,2) button = waitForObjectExists(names.o_confirmButton_ConfirmButton) test.verify(not button.enabled, "Validate that the button is disabled") test.endSection() @@ -570,6 +571,7 @@ mouseClick(waitForObject(names.o_PatientIDEntry_TextEntry)) for expected_patient_id, actual_patient_id in PATIENT_ID_COMBINATION.items(): verify_valid_patient_id_through_keypad(expected_patient_id, actual_patient_id) + verify_create_custom_treatment_parameter() test.endSection() test.startSection("Verify the parameters in Create Rx Popup ") @@ -589,4 +591,4 @@ test.endSection() utils.tstDone() - \ No newline at end of file +