Index: tst_patient_id/test.py =================================================================== diff -u -rda46595d179733486cc338c18fc0df1f31eb7f0d -r433c0e7b21dd0f7df645e8a25c12b41abe004802 --- tst_patient_id/test.py (.../test.py) (revision da46595d179733486cc338c18fc0df1f31eb7f0d) +++ tst_patient_id/test.py (.../test.py) (revision 433c0e7b21dd0f7df645e8a25c12b41abe004802) @@ -18,15 +18,13 @@ import names 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 - - @return: required object property's for keys + Method for setting custom object property's for keyboard keys + @return: required object property's for keys """ if text is not None: names.o_keboard_input["text"] = text @@ -38,9 +36,8 @@ def keyboard_switching_section(text): """ - Tests to automate keyboard based on user input - - @return: key text (text displayed on keyboard) + Tests to automate keyboard based on user input + @return: key text (text displayed on keyboard) """ keyboard_value = keyboard_object_map_helper(text) object_status = object.exists(keyboard_value) @@ -84,13 +81,10 @@ if object_status is True: return text - - def user_input_clear_option(): """ - Tests to clear retained patient id - - @return: N/A + Tests to clear retained patient id + @return: N/A """ patient_id_input = waitForObject(names.o_input_patient_id) patient_id = str(patient_id_input.text) @@ -101,11 +95,10 @@ patient_id_length = patient_id_length - 1 -def validation_of_valid_patient_id_through_keypad(expected_value, actual_value): +def verify_valid_patient_id_through_keypad(expected_value, actual_value): """ - Tests verifies valid patient id set through application keyboard setup . - - @return: N/A + 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) @@ -122,16 +115,15 @@ 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 + "using keypad.") + test.log("User successfully authenticated through patient id -> " + expected_value + "using keypad.") mouseClick(waitForObject(names.o_create_back_button)) -def validation_of_valid_patient_id_through_user_input(expected_value, actual_value): +def verify_valid_patient_id_through_user_input(expected_value, actual_value): """ - Tests verifies valid patient id set through user's input. - - @return: N/A + Tests verifies valid patient id set through user's input. + @return: N/A """ patient_id_input = waitForObject(names.o_input_patient_id) mouseClick(waitForObject(patient_id_input)) @@ -144,39 +136,38 @@ custom_treatment = waitForObject(names.o_custom_treatment) test.compare("Create a Custom Treatment", custom_treatment.text) - test.log("user successfully authenticated through patient id ->"+ actual_value) + test.log("User successfully authenticated through patient id ->"+ actual_value) mouseClick(waitForObject(names.o_create_back_button)) def verify_confirm_button_based_on_patient_id(patient_id): """ - Tests verifies confirm button based on patient id. - @input : patient id to be set - @return: N/A + Tests verifies confirm button based on patient id. + @input : patient id to be set + @return: N/A """ utils.waitForGUI(1) if patient_id is None: mouseClick( waitForObject(names.o_input_patient_id)) type( waitForObject(names.o_input_patient_id), " ") confirm_button_status = findObject(names.o_confirm_button) if confirm_button_status.enabled == False: - test.passes("confirm button disabled without patient id") + test.passes("Confirm button disabled without patient id") else: - test.fail("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: - test.passes("confirm button enabled with patient id -> " + str(patient_id)) + test.passes("Confirm button enabled with patient id -> " + str(patient_id)) else: - test.fail("confirm button disabled with patient id -> " + str(patient_id)) + test.fail("Confirm button disabled with patient id -> " + str(patient_id)) -def validation_of_invalid_patient_id_through_user_input(expected_value): +def verify_invalid_patient_id_through_user_input(expected_value): """ - Tests verifies invalid patient id set through user's input. - - @return: N/A + Tests verifies invalid patient id set through user's input. + @return: N/A """ patient_id_input = waitForObject(names.o_input_patient_id) mouseClick(patient_id_input) @@ -201,9 +192,9 @@ mouseClick(waitForObject(names.o_input_patient_id)) for expected_patient_id, actual_patient_id in config.PATIENT_ID_COMBINATION.items(): - validation_of_valid_patient_id_through_keypad(expected_patient_id, actual_patient_id) + verify_valid_patient_id_through_keypad(expected_patient_id, actual_patient_id) mouseClick(waitForObject(names.o_PreTreatmentPatientid_back_button)) - validation_of_valid_patient_id_through_user_input(expected_patient_id, actual_patient_id) + verify_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)