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)