Index: shared/scripts/configuration/config.py =================================================================== diff -u -reb6b44f678d46f2b0fab047200a020e738d80798 -r18c2d43e6ee4fe3d5a531fe4c67d210ec2f1b183 --- shared/scripts/configuration/config.py (.../config.py) (revision eb6b44f678d46f2b0fab047200a020e738d80798) +++ shared/scripts/configuration/config.py (.../config.py) (revision 18c2d43e6ee4fe3d5a531fe4c67d210ec2f1b183) @@ -26,11 +26,19 @@ "Magenta":"#fd28fd", "Orange": "#f2721c", "Peach":"#f1979a", "Red": "#c53b33", "Rose":"#fc178d", "Slate blue":"#7f7ffa", "Violet": "#6435c9", "White": "#ffffff", "Yellow": "#fcfc4d"} - #patient id -CHARACTER_PATIENT_ID = ["qwerty","sampleid","abcdefghijklmnop","patientid", "username"] -ALPHANUMERIC_PATIENT_ID = ["sA@MpLE#123", "A@BH&321","5432@qwerty"] -KEYBOARD_SWITCH = ["ABC", "A&123"] +PATIENT_ID = { + "qwerty" : "qwerty", + "sampleid" : "sampleid", + "abcdefghijklmnop" : "abcdefghijklmnop", + "patientid" : "patientid", + "username" : "username", + "sA@MpLE#123" : "sAMpLE123", + "A@BH&321" : "ABH321", + "5432@qwerty" : "5432qwerty" +} +KEYBOARD_SWITCH = ["ABC", "&123"] + Index: shared/scripts/names.py =================================================================== diff -u -r53ef89c1677928522ad63066c31b85346aeb3ccd -r18c2d43e6ee4fe3d5a531fe4c67d210ec2f1b183 --- shared/scripts/names.py (.../names.py) (revision 53ef89c1677928522ad63066c31b85346aeb3ccd) +++ shared/scripts/names.py (.../names.py) (revision 18c2d43e6ee4fe3d5a531fe4c67d210ec2f1b183) @@ -38,14 +38,11 @@ #in-treatment -#blood priming text object blood_priming = {"container": treatmentStack_TreatmentBloodPrime_ScreenItem, "text": "Blood Priming", "type": "Text", "unnamed": 1, "visible": True} blood_priming_value_by_default = {"container": treatmentStack_TreatmentBloodPrime_ScreenItem, "text": "0 mL", "type": "Text", "unnamed": 1, "visible": True} treatmentStack_treatmentHome_TreatmentHome = {"container": treatmentStack_TreatmentStack, "id": "_treatmentHome", "type": "TreatmentHome", "unnamed": 1, "visible": True} -#uf minimum and maximum value object uf_minimum_value = {"container": treatmentStack_treatmentHome_TreatmentHome, "text": "0.000", "type": "Text", "unnamed": 1, "visible": True} uf_maximum_value = {"container": treatmentStack_treatmentHome_TreatmentHome, "text": "0.600", "type": "Text", "unnamed": 1, "visible": True} -#uf minimum and maximum pop up uf_minimum_value_pop_up = {"container": o_Overlay, "text": "0.000", "type": "Text", "unnamed": 1, "visible": True} uf_maximum_value_pop_up = {"container": o_Overlay, "text": "0.600", "type": "Text", "unnamed": 1, "visible": True} edit_uf_value = {"container": o_Overlay, "text": "EDIT ULTRAFILTRATION VOLUME", "type": "Text", "unnamed": 1, "visible": True} @@ -69,9 +66,11 @@ o_PreTreatmentBase_confirmButton_TouchRect_2 = {"container": o_PreTreatmentCreateStack_PreTreatmentBase_TreatmentFlowBase, "gradient": 0, "objectName": "_confirmButton", "type": "TouchRect", "visible": True} o_PreTreatmentCreate_heparinDispensingRate_SliderCreateTreatment = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "gradient": 0, "objectName": "_heparinDispensingRate", "type": "SliderCreateTreatment", "visible": True} o_PreTreatmentBase_backgroundRect_Rectangle_2 = {"container": o_PreTreatmentCreateStack_PreTreatmentBase_TreatmentFlowBase, "gradient": 0, "id": "_backgroundRect", "type": "Rectangle", "unnamed": 1, "visible": True} -o_keyboard_switch = {"container": o_Gui_MainView, "id": "shiftKeyIcon", "source": "qrc:/QtQuick/VirtualKeyboard/content/styles/default/images/shift-868482.svg", "type": "Image", "unnamed": 1, "visible": True} -o_keyboard_switch_2 = {"container": o_Gui_MainView, "id": "shiftKeyIcon", "source": "qrc:/QtQuick/VirtualKeyboard/content/styles/default/images/shift-80c342.svg", "type": "Image", "unnamed": 1, "visible": True} +#o_keyboard_switch = {"container": o_Gui_MainView, "id": "shiftKeyIcon", "source": "qrc:/QtQuick/VirtualKeyboard/content/styles/default/images/shift-868482.svg", "type": "Image", "unnamed": 1, "visible": True} +#o_keyboard_switch2 = {"container": o_Gui_MainView, "id": "shiftKeyIcon", "source": "qrc:/QtQuick/VirtualKeyboard/content/styles/default/images/shift-80c342.svg", "type": "Image", "unnamed": 1, "visible": True} +#o_keyboard_switch = {"container": o_Gui_MainView, "text": "1/2", "type": "Text", "unnamed": 1, "visible": True} +#o_keyboard_switch2 = {"container": o_Gui_MainView, "text": "2/2", "type": "Text", "unnamed": 1, "visible": True} +o_keyboard_switch = {"container": o_Gui_MainView, "id": "_shiftKeyIcon", "source": "qrc:/plugins/QtQuick/VirtualKeyboard/Styles/denali/images/iShiftNormal.svg", "type": "Image", "unnamed": 1, "visible": True} +o_keyboard_switch2 = {"container": o_Gui_MainView, "id": "_shiftKeyIcon", "source": "qrc:/plugins/QtQuick/VirtualKeyboard/Styles/denali/images/iShiftActive.svg", "type": "Image", "unnamed": 1, "visible": True} - - Index: tst_patient_id/test.py =================================================================== diff -u -reb6b44f678d46f2b0fab047200a020e738d80798 -r18c2d43e6ee4fe3d5a531fe4c67d210ec2f1b183 --- tst_patient_id/test.py (.../test.py) (revision eb6b44f678d46f2b0fab047200a020e738d80798) +++ tst_patient_id/test.py (.../test.py) (revision 18c2d43e6ee4fe3d5a531fe4c67d210ec2f1b183) @@ -16,12 +16,12 @@ # This test is intended to be used to verify patient id in application. . import names - -from configuration import utility, config from dialin.ui import utils from dialin.ui.hd_simulator import HDSimulator +from configuration import utility, config + def keyboard_object_map_helper(text): """ Method for setting custom object property's for keyboard keys @@ -65,37 +65,27 @@ object_status = object.exists(keyboard_value) if object_status is True: return text - object_status = object.exists(names.o_keyboard_switch) + object_status = object.exists(names.o_keyboard_switch2) if object_status is True: - keyboard_value = waitForObject(names.o_keyboard_switch) + keyboard_value = waitForObject(names.o_keyboard_switch2) mouseClick(keyboard_value) text = text.lower() keyboard_value = keyboard_object_map_helper(text) object_status = object.exists(keyboard_value) if object_status is True: return text - object_status = object.exists(names.o_keyboard_switch_2) + object_status = object.exists(names.o_keyboard_switch) if object_status is True: - keyboard_value = waitForObject(names.o_keyboard_switch_2) + keyboard_value = waitForObject(names.o_keyboard_switch) mouseClick(keyboard_value) text = text.lower() keyboard_value = keyboard_object_map_helper(text) object_status = object.exists(keyboard_value) if object_status is True: return text + -def verify_patient_id(expected_patient_id): - expected_id = "" - for letter in expected_patient_id: - print(letter) - if letter.isalpha() or letter.isnumeric(): - expected_id += letter - else: - pass - patient_id_input = waitForObject(names.o_input_patient_id) - test.compare(patient_id_input.text, expected_id, "Patient id should be ->" + expected_id) - def user_input_clear_option(): """ Tests to clear retained patient id @@ -111,25 +101,22 @@ patient_id_length = patient_id_length - 1 -def validation_of_valid_patient_id_through_keypad(expected_value): +def validation_of_valid_patient_id_through_keypad(expected_value, actual_value): """ Tests verifies valid patient id set through application keyboard setup . @return: N/A """ patient_id_input = waitForObject(names.o_input_patient_id) mouseClick(patient_id_input) - patient_id = list(expected_value) - for text in patient_id: + for text in expected_value: keyword_state = keyboard_switching_section(text) if keyword_state is not None: keyboard_value = keyboard_object_map_helper(keyword_state) mouseClick(waitForObject(keyboard_value)) utils.waitForGUI(.2) - verify_patient_id(expected_value) -# test.compare(expected_value, (patient_id_input.text)) -# test.log("Patient id should be -> "+ expected_value) + test.compare(actual_value, (patient_id_input.text), "Patient id should be -> "+ str(actual_value)) verify_confirm_button_based_on_patient_id(expected_value) mouseClick(waitForObject(names.o_confirm_button)) @@ -140,7 +127,7 @@ mouseClick(waitForObject(names.o_back_button)) -def validation_of_valid_patient_id_through_user_input(expected_value): +def validation_of_valid_patient_id_through_user_input(expected_value, actual_value): """ Tests verifies valid patient id set through user's input. @@ -149,16 +136,15 @@ patient_id_input = waitForObject(names.o_input_patient_id) mouseClick(waitForObject(patient_id_input)) type(waitForObject(names.o_input_patient_id), expected_value) - verify_patient_id(expected_value) -# test.compare(expected_value, (patient_id_input.text)) -# test.log("Patient id should be ->" + expected_value) + test.compare(actual_value, (patient_id_input.text)) + test.log("Patient id should be ->" + expected_value) verify_confirm_button_based_on_patient_id(expected_value) mouseClick(waitForObject(names.o_confirm_button)) custom_treatment = waitForObject(names.o_custom_treatment) test.compare("Create a Custom Treatment", custom_treatment.text) - test.log("user successfully authenticated through patient id ->"+ expected_value) + test.log("user successfully authenticated through patient id ->"+ actual_value) mouseClick(waitForObject(names.o_back_button)) @@ -173,12 +159,11 @@ if patient_id is None: mouseClick( waitForObject(names.o_input_patient_id)) type( waitForObject(names.o_input_patient_id), " ") - confirm_button_status = waitForObject(names.o_confirm_button) + confirm_button_status = findObject(names.o_confirm_button) if confirm_button_status.enabled == False: test.passes("confirm button disabled without patient id") else: - #None patient id is accepting in application "space is accepting" - development stage - test.xfail("confirm button enabled without patient id") + test.fail("confirm button enabled without patient id") else: confirm_button_status = waitForObject(names.o_confirm_button) if confirm_button_status.enabled == True: @@ -208,24 +193,20 @@ utils.tstStart(__file__) startApplication(config.AUT_NAME) - utils.waitForGUI(1) - hd = HDSimulator() + hd = HDSimulator() - hd.cmd_send_power_on_self_test_version_request() hd.cmd_send_hd_operation_mode(4, 0) + utils.waitForGUI(2) mouseClick(waitForObject(names.o_input_patient_id)) - for patient_id in config.CHARACTER_PATIENT_ID: - validation_of_valid_patient_id_through_keypad(patient_id) - validation_of_valid_patient_id_through_user_input(patient_id) - - for patient_id in config.ALPHANUMERIC_PATIENT_ID: - validation_of_valid_patient_id_through_keypad(patient_id) - validation_of_valid_patient_id_through_user_input(patient_id) - + for expected_patient_id, actual_patient_id in config.PATIENT_ID.items(): + validation_of_valid_patient_id_through_keypad(expected_patient_id, actual_patient_id) + validation_of_valid_patient_id_through_user_input(expected_patient_id, actual_patient_id) + #verification of confirm button without giving patient id verify_confirm_button_based_on_patient_id(patient_id = None) utils.tstDone() +