Index: shared/scripts/configuration/utility.py =================================================================== diff -u -rb10a9da7dfcb6fbe4b56b0786fea8442779c4728 -re3d34569087834bc6a6e1758480b425819d72408 --- shared/scripts/configuration/utility.py (.../utility.py) (revision b10a9da7dfcb6fbe4b56b0786fea8442779c4728) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision e3d34569087834bc6a6e1758480b425819d72408) @@ -39,7 +39,7 @@ try: counter += 1 test.log("Starting {}".format(app_name)) - squish.startApplication(config.APPLICATION_NAME) + squish.startApplication(app_name) if counter == 1: test.log(f"Application launched at the {counter}'st try.") elif counter == 2: @@ -61,27 +61,13 @@ logErrorDetails("Failed to start the application") sys.exit(1) - -def color_verification(exp_val = "Red", act_val = "#c53b33"): - """ - Function to verify item color verification - Argument: - exp_val - Expected required value - act_val - Color displayed on UI - Return: - handle the application for log - """ - test.compare(config.COLOR_CODES[color_name],(act_val.color[name])) - - + def check_if_object_is_within_the_container(obj=None, container=None): """ check if an object is inside a container - Arguments: - obj - child UI object - container - container UI object - Return: - bool + @param obj - child UI object + @param container - container UI object + Return: boolean True/False """ container = squish.findObject(container) containerPos = container.mapToGlobal(squish.QPoint(0, 0)) @@ -103,11 +89,9 @@ def scroll_to_zone(zone=None, screen_object=None): """ scroll to the numeric if object is hidden - Arguments: - zone - UI object - screen_object - UI object (UI Home screen = waveforms + numerics) - Return: - bool + @param zone - UI object + @param screen_object - UI object + Return: boolean True/False """ counter = 0 while counter <= 100: Index: shared/scripts/names.py =================================================================== diff -u -r9b83f12cc68db53745c55d7317a6b364a00241d1 -re3d34569087834bc6a6e1758480b425819d72408 --- shared/scripts/names.py (.../names.py) (revision 9b83f12cc68db53745c55d7317a6b364a00241d1) +++ shared/scripts/names.py (.../names.py) (revision e3d34569087834bc6a6e1758480b425819d72408) @@ -19,14 +19,10 @@ o_PreTreatmentCreate_bloodFlowRateSlider_Slider = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "gradient": 0, "objectName": "_bloodFlowRateSlider", "type": "Slider", "visible": True} o_PreTreatmentCreate_dialysateFlowRate_SliderCreateTreatment = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "gradient": 0, "objectName": "_dialysateFlowRate", "type": "SliderCreateTreatment", "visible": True} o_PreTreatementCreateStack_PreTreatmentBase_TreatmentFlowBase = {"container":o_PreTreatmentCreateStack_PreTreatmentBase_TreatmentFlowBase,"objectName":"_PreTreatmentBase","type":"TreatmentFlowBase", "visible": True} -back_b = {"container": o_PreTreatementCreateStack_PreTreatmentBase_TreatmentFlowBase, "gradient": 0, "objectName": "_backButton", "type": "BackButton", "visible": True} - -conform_c={"container": o_Gui_MainView, "gradient": 0, "objectName": "_confirmButton", "type": "TouchRect", "visible": False} o_confirmButton_TouchRect = {"container": o_Gui_MainView, "gradient": 0, "objectName": "_confirmButton", "type": "TouchRect", "visible": False} o_backButton_BackButton = {"container": o_Gui_MainView, "gradient": 0, "objectName": "_backButton", "type": "BackButton", "visible": False} o_NinePatchImage = {"container": o_Gui_MainView, "occurrence": 6, "type": "NinePatchImage", "unnamed": 1, "visible": False} o_PreTreatmentBase_backgroundRect_Rectangle = {"container": o_PreTreatmentCreateStack_PreTreatmentBase_TreatmentFlowBase, "gradient": 0, "id": "_backgroundRect", "type": "Rectangle", "unnamed": 1, "visible": True} -keyBackground_Rectangle = {"container": o_Gui_MainView, "gradient": 0, "id": "keyBackground", "type": "Rectangle", "unnamed": 1, "visible": True} t_Text = {"container": o_Gui_MainView, "text": "t", "type": "Text", "unnamed": 1, "visible": True} o_PreTreatmentBase_confirmButton_TouchRect = {"container": o_PreTreatmentCreateStack_PreTreatmentBase_TreatmentFlowBase, "gradient": 0, "objectName": "_confirmButton", "type": "TouchRect", "visible": True} @@ -58,20 +54,20 @@ #authentication -confirm_button = {"container": o_PreTreatmentCreateStack_PreTreatmentBase_TreatmentFlowBase, "text": "CONFIRM", "type": "Text", "unnamed": 1, "visible": True} -back_button ={"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_image", "source": "qrc:/images/iBack", "type": "Image", "unnamed": 1, "visible": True} +o_confirm_button = {"container": o_PreTreatmentCreateStack_PreTreatmentBase_TreatmentFlowBase, "text": "CONFIRM", "type": "Text", "unnamed": 1, "visible": True} +o_back_button ={"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "id": "_image", "source": "qrc:/images/iBack", "type": "Image", "unnamed": 1, "visible": True} o_PreTreatmentBase_confirmButton_TouchRect = {"container": o_PreTreatmentCreateStack_PreTreatmentBase_TreatmentFlowBase, "text": "CONFIRM", "type": "Text", "unnamed": 1, "visible": True} o_PreTreatmentCreate_bloodFlowRate_SliderCreateTreatment = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "gradient": 0, "objectName": "_bloodFlowRate", "type": "SliderCreateTreatment", "visible": True} -input_patient_id = {"container": o_PreTreatmentCreateStack_PreTreatmentBase_TreatmentFlowBase, "echoMode": 0, "id": "_input", "type": "TextInput", "unnamed": 1, "visible": True} -keboard_input = {"container": o_Gui_MainView, "type": "Text", "unnamed": 1, "visible": True} -custom_treatment = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "text": "Create a Custom Treatment", "type": "Text", "unnamed": 1, "visible": True} -treatment_create_flickable = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "TreatmentCreateFlickable", "type": "Flickable", "visible": True} -operating_parameters = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "type": "Text", "unnamed": 1, "visible": True} +o_input_patient_id = {"container": o_PreTreatmentCreateStack_PreTreatmentBase_TreatmentFlowBase, "echoMode": 0, "id": "_input", "type": "TextInput", "unnamed": 1, "visible": True} +o_keboard_input = {"container": o_Gui_MainView, "type": "Text", "unnamed": 1, "visible": True} +o_custom_treatment = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "text": "Create a Custom Treatment", "type": "Text", "unnamed": 1, "visible": True} +o_treatment_create_flickable = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "objectName": "TreatmentCreateFlickable", "type": "Flickable", "visible": True} +o_operating_parameters = {"container": o_PreTreatmentCreateStack_PreTreatmentCreate_PreTreatmentCreate, "type": "Text", "unnamed": 1, "visible": True} 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} -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} -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_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} Index: tst_patient_id/test.py =================================================================== diff -u -r409d5e9c1e1ad2e07bcfc46ace6cf3a48c3a7f39 -re3d34569087834bc6a6e1758480b425819d72408 --- tst_patient_id/test.py (.../test.py) (revision 409d5e9c1e1ad2e07bcfc46ace6cf3a48c3a7f39) +++ tst_patient_id/test.py (.../test.py) (revision e3d34569087834bc6a6e1758480b425819d72408) @@ -29,17 +29,13 @@ @return: required object property's for keys """ if text is not None: - names.keboard_input["text"] = text - return names.keboard_input + names.o_keboard_input["text"] = text + return names.o_keboard_input else: - test.log(f"Invalid \"text\": {text} for object.") - names.keyboard_input["text"] = "Q" + test.log("Invalid ",text," for object.") + names.o_keyboard_input["text"] = "Q" -def validation_of_confirm_button_without_patient_id(): - pass - - def keyboard_switching_section(text): """ Tests to automate keyboard based on user input @@ -69,18 +65,18 @@ object_status = object.exists(keyboard_value) if object_status is True: return text - object_status = object.exists(names.keyboard_switch) + object_status = object.exists(names.o_keyboard_switch) if object_status is True: - keyboard_value = waitForObject(names.keyboard_switch) + 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 - object_status = object.exists(names.keyboard_switch2) + object_status = object.exists(names.o_keyboard_switch2) if object_status is True: - keyboard_value = waitForObject(names.keyboard_switch_2) + keyboard_value = waitForObject(names.o_keyboard_switch_2) mouseClick(keyboard_value) text = text.lower() keyboard_value = keyboard_object_map_helper(text) @@ -95,12 +91,12 @@ @return: N/A """ - patient_id_input = waitForObject(names.input_patient_id) + patient_id_input = waitForObject(names.o_input_patient_id) patient_id = str(patient_id_input.text) patient_id_length = len(patient_id) while (patient_id_length != 0): - type(waitForObject(names.input_patient_id), "") - type(waitForObject(names.input_patient_id), "") + type(waitForObject(names.o_input_patient_id), "") + type(waitForObject(names.o_input_patient_id), "") patient_id_length = patient_id_length - 1 @@ -110,7 +106,7 @@ @return: N/A """ - patient_id_input = waitForObject(names.input_patient_id) + patient_id_input = waitForObject(names.o_input_patient_id) mouseClick(patient_id_input) patient_id = list(expected_value) for text in patient_id: @@ -121,15 +117,15 @@ utils.waitForGUI(.2) test.compare(expected_value, (patient_id_input.text)) - test.log(f"Patient id should be -> {expected_value}") + test.log("Patient id should be -> "+ expected_value) verify_confirm_button_based_on_patient_id(expected_value) - mouseClick(waitForObject(names.confirm_button)) + mouseClick(waitForObject(names.o_confirm_button)) - custom_treatment = waitForObject(names.custom_treatment) + custom_treatment = waitForObject(names.o_custom_treatment) test.compare("Create a Custom Treatment", custom_treatment.text) - test.log(f"user successfully authenticated through patient id -> {expected_value} using keypad.") + test.log("user successfully authenticated through patient id -> " + expected_value + "using keypad.") - mouseClick(waitForObject(names.back_button)) + mouseClick(waitForObject(names.o_back_button)) def validation_of_valid_patient_id_through_user_input(expected_value): @@ -138,21 +134,22 @@ @return: N/A """ - patient_id_input = waitForObject(names.input_patient_id) + patient_id_input = waitForObject(names.o_input_patient_id) mouseClick(waitForObject(patient_id_input)) - type(waitForObject(names.input_patient_id), expected_value) + type(waitForObject(names.o_input_patient_id), expected_value) test.compare(expected_value, (patient_id_input.text)) - test.log(f"Patient id should be -> {expected_value}") + test.log("Patient id should be ->" + expected_value) verify_confirm_button_based_on_patient_id(expected_value) - mouseClick(waitForObject(names.confirm_button)) + mouseClick(waitForObject(names.o_confirm_button)) - custom_treatment = waitForObject(names.custom_treatment) + custom_treatment = waitForObject(names.o_custom_treatment) test.compare("Create a Custom Treatment", custom_treatment.text) - test.log(f"user successfully authenticated through patient id -> {expected_value}.") + test.log("user successfully authenticated through patient id ->"+ expected_value) - mouseClick(waitForObject(names.back_button)) + mouseClick(waitForObject(names.o_back_button)) + def verify_confirm_button_based_on_patient_id(patient_id): """ Tests verifies confirm button based on patient id. @@ -161,20 +158,20 @@ """ utils.waitForGUI(1) if patient_id is None: - patient_id_input = waitForObject(names.input_patient_id) - mouseClick(waitForObject(patient_id_input)) - type(patient_id_input, " ") - confirm_button_status = waitForObject(names.confirm_button) + mouseClick( waitForObject(names.o_input_patient_id)) + type( waitForObject(names.o_input_patient_id), " ") + confirm_button_status = waitForObject(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") else: - confirm_button_status = waitForObject(names.confirm_button) + confirm_button_status = waitForObject(names.o_confirm_button) if confirm_button_status.enabled == True: - test.passes(f"confirm button enabled with patient id -> {patient_id}") + test.passes("confirm button enabled with patient id -> " + str(patient_id)) else: - test.fail(f"confirm button disabled with patient id -> {patient_id}") + test.fail("confirm button disabled with patient id -> " + str(patient_id)) def validation_of_invalid_patient_id_through_user_input(expected_value): @@ -183,28 +180,29 @@ @return: N/A """ - patient_id_input = waitForObject(names.input_patient_id) - mouseClick(waitForObject(patient_id_input)) - type(waitForObject(names.input_patient_id), expected_value) + patient_id_input = waitForObject(names.o_input_patient_id) + mouseClick(patient_id_input) + type(waitForObject(names.o_input_patient_id), expected_value) if expected_value is not patient_id_input.text or patient_id_input.text is None: - test.passes(f"Patient ID -> {expected_value} should be invalid") + test.passes("Patient ID -> ", expected_value, " should be invalid") else: - test.xfail(f"Patient ID {expected_value} is valid") + #None patient id is accepting in application "space is accepting" - development stage + test.xfail("Patient ID" ,expected_value," is valid") user_input_clear_option() def main(): utils.tstStart("tst_patient_id") - utility.start_application("validation of patient ID") + utility.start_application(config.APPLICATION_NAME) utils.waitForGUI(2) hd = HDSimulator() hd.cmd_send_power_on_self_test_version_request() hd._handler_ui_first_check_in(message = None) - mouseClick(waitForObject(names.input_patient_id)) + 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)