Index: tst_patient_id/test.py =================================================================== diff -u -r9b83f12cc68db53745c55d7317a6b364a00241d1 -r176056d2bb26a77d531323d6fdd2e9d24720cbb3 --- tst_patient_id/test.py (.../test.py) (revision 9b83f12cc68db53745c55d7317a6b364a00241d1) +++ tst_patient_id/test.py (.../test.py) (revision 176056d2bb26a77d531323d6fdd2e9d24720cbb3) @@ -45,6 +45,10 @@ names.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 @@ -127,7 +131,7 @@ test.compare(expected_value, (patient_id_input.text)) test.log(f"Patient id should be -> {expected_value}") - + verify_confirm_button_based_on_patient_id(expected_value) mouseClick(waitForObject(names.confirm_button)) custom_treatment = waitForObject(names.custom_treatment) @@ -149,6 +153,7 @@ test.compare(expected_value, (patient_id_input.text)) test.log(f"Patient id should be -> {expected_value}") + verify_confirm_button_based_on_patient_id(expected_value) mouseClick(waitForObject(names.confirm_button)) custom_treatment = waitForObject(names.custom_treatment) @@ -157,7 +162,30 @@ mouseClick(waitForObject(names.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 + """ + 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) + if confirm_button_status.enabled == False: + test.passes("confirm button disabled without patient id") + else: + test.xfail("confirm button enabled without patient id") + else: + confirm_button_status = waitForObject(names.confirm_button) + if confirm_button_status.enabled == True: + test.passes(f"confirm button enabled with patient id -> {patient_id}") + else: + test.fail(f"confirm button disabled with patient id -> {patient_id}") + + def validation_of_invalid_patient_id_through_user_input(expected_value): """ Tests verifies invalid patient id set through user's input. @@ -182,16 +210,23 @@ 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)) for patient_id in CHARACTER_PATIENT_ID: validation_of_valid_patient_id_through_keypad(patient_id) validation_of_valid_patient_id_through_user_input(patient_id) - + + hd.cmd_send_hd_operation_mode(3) + hd._handler_ui_first_check_in(message = None) + for patient_id in ALPHANUMERIC_PATIENT_ID: validation_of_valid_patient_id_through_keypad(patient_id) validation_of_valid_patient_id_through_user_input(patient_id) - + + #verification of confirm button without giving patient id + verify_confirm_button_based_on_patient_id(patient_id = None) + utils.tstDone()