Index: tst_settings_date_and_time/test.py =================================================================== diff -u -r3935abf92b7c75b8da62040ba4a2e9654a3952e7 -raa6920723efd6d2e2212b3305b03677c033b0621 --- tst_settings_date_and_time/test.py (.../test.py) (revision 3935abf92b7c75b8da62040ba4a2e9654a3952e7) +++ tst_settings_date_and_time/test.py (.../test.py) (revision aa6920723efd6d2e2212b3305b03677c033b0621) @@ -9,6 +9,7 @@ # file tst_settings_date_and_time # date 05/15/2022 # author Papiya Mandal +# author Amrita Debnath import builtins import names @@ -41,6 +42,8 @@ YEAR_UPPER_LIMIT = 2100 YEAR_LOWER_LIMIT = 1970 DATE_AND_TIME_MESSAGE = "AdjustHDDateTime" +INCORRECT_PASSWORD = "abcd" +INCORRECT_PASSWORD_MSG = "Incorrect service password" def settings_text_obj(text): names.o_settings_home_text_obj["text"] = text @@ -65,7 +68,26 @@ device_settings_text = waitForObjectExists(settings_text_obj(config.DEVICE_SETTINGS_TEXT)) test.compare(device_settings_text.text, config.DEVICE_SETTINGS_TEXT, "{} screen is displayed".format(config.DEVICE_SETTINGS_TEXT)) test.endSection() + +def verify_incorrect_password_msg(): + """ + Method to verify the message displayed + upon entering wrong password + """ + test.startSection("Verifying the functionalities with Incorrect password") + test.log("Clicking on password entry field") + utils.waitForGUI(0.3) + mouseClick(waitForObjectExists(names.o_password_text_field)) + utility.enter_keyboard_numeric_value(entry=str(INCORRECT_PASSWORD)) + mouseClick(waitForObjectExists(names.o_show_password)) + test.log("Verifying the entered password") + password = str((waitForObjectExists(names.o_password_text_field)).text) + test.compare(password, INCORRECT_PASSWORD, "Entered password should be {}".format(str(INCORRECT_PASSWORD))) + mouseClick(waitForObjectExists(services_screen_text_obj(config.CONFIRM_TEXT))) + incorrect_password_text = waitForObjectExists(settings_text_obj(INCORRECT_PASSWORD_MSG)) + test.compare(incorrect_password_text.text, INCORRECT_PASSWORD_MSG, "{} message should display upon entering wrong password".format(INCORRECT_PASSWORD_MSG)) + test.endSection() def navigate_to_services_password_screen_and_enter_password(): """ Method to navigate to services screen @@ -77,6 +99,10 @@ mouseClick(waitForObjectExists(settings_text_obj(config.SERIVCES_TITLE))) services_password_title = waitForObjectExists(services_screen_text_obj(SERVICES_TITLE_TEXT)) test.compare(services_password_title.text, SERVICES_TITLE_TEXT, "{} should display once user is navigated to services password screen".format(SERVICES_TITLE_TEXT)) + verify_incorrect_password_msg() + utils.waitForGUI(0.2) + mouseClick(waitForObjectExists(settings_text_obj(config.SERIVCES_TITLE))) + utils.waitForGUI(0.5) test.log("Clicking on password entry field") utils.waitForGUI(0.3) mouseClick(waitForObjectExists(names.o_switch_keyboard_to_keypad)) @@ -106,6 +132,7 @@ test.compare(waitForObjectExists(names.o_shutdown_text).enabled , True, "'SHUTDOWN' button should be enabled") test.endSection() + def navigate_to_set_date_and_time(): """ Method to navigate to set date and time