Index: tst_service_screen/test.py =================================================================== diff -u -r3791153311e93da4a8e3401ba149eae23a3c8d10 -ra81fa769324346dd2b15d19a869a83b91a3d3877 --- tst_service_screen/test.py (.../test.py) (revision 3791153311e93da4a8e3401ba149eae23a3c8d10) +++ tst_service_screen/test.py (.../test.py) (revision a81fa769324346dd2b15d19a869a83b91a3d3877) @@ -40,13 +40,13 @@ """ test.startSection("Navigating to 'Device Settings' screen") hd_simulator.cmd_send_hd_operation_mode(op_mode=HDOpModes.MODE_SERV.value, sub_mode=HDOpSubModes.STANDBY_START_STATE.value) - utils.waitForGUI(1) - mouseClick(waitForObjectExists(names.o_settings_Text)) + utils.waitForGUI(1) + device_settings_text = waitForObjectExists(settings_text_obj(config.SERIVCES_TITLE)) test.compare(device_settings_text.text, config.SERIVCES_TITLE, "{} screen is displayed".format(config.SERIVCES_TITLE)) + verify_export_logs_screen() mouseClick(waitForObjectExists(names.o_shutdown_btn)) test.compare(device_settings_text.text, config.SHUTDOWN_BUTTON_TEXT, "{} screen is displayed".format(config.SHUTDOWN_BUTTON_TEXT)) - 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.compare(device_settings_text.text, config.SERIVCES_TITLE, "{} screen is displayed".format(config.SERIVCES_TITLE)) test.endSection() def verify_export_logs_screen(): @@ -57,56 +57,20 @@ test.log("Navigating to service screen to export log screen") utils.waitForGUI(0.3) mouseClick(waitForObjectExists(settings_text_obj(EXPORT_LOGS))) + for logs in config.EXPORT_LOGS_OPTIONS: + logs_export = waitForObjectExists(services_screen_text_obj(logs)) + test.compare(logs_export.text, logs, "{} should be available under export logs screen".format(logs)) + + mouseClick(waitForObjectExists(names.o_back_btn)) test.compare(services_screen_text_obj.text, config.BACK_BUTTON_TEXT, "{} screen is displayed".format(config.BACK_BUTTON_TEXT)) - test.compare(services_screen_text_obj.text, config.BACK_BUTTON_TEXT, "{} screen is displayed".format(config.BACK_BUTTON_TEXT)) test.endSection() -def navigate_to_services_password_screen_and_enter_password(): - """ - Method to navigate to services screen - and verify the "Please Enter The Service Password" - title is displayed and enter password, verify the - password and click on confirm button - """ - test.startSection("Navigating to 'services password' screen and enter password") - 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)) - utils.waitForGUI(0.5) - verify_incorrect_password_msg() - utils.waitForGUI(0.5) - mouseClick(waitForObjectExists(settings_text_obj(config.SERIVCES_TITLE))) - utils.waitForGUI(0.5) - test.log("Clicking on password entry field") - utils.waitForGUI(0.5) - mouseClick(waitForObjectExists(names.o_switch_keyboard_to_keypad)) - mouseClick(waitForObjectExists(names.o_password_text_field)) - with open(SERVICE_CONF_LOCATION, "r") as file: - lines = file.readlines() - for index, line in enumerate(lines): - if "Service Password" in line: - services_password = lines[index+1][:-1] - break - else: - continue - utility.enter_keyboard_numeric_value(entry=str(services_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, str(services_password), "Entered password should be {}".format(str(services_password))) - mouseClick(waitForObjectExists(services_screen_text_obj(config.CONFIRM_TEXT))) - utils.waitForGUI(0.5) - for option in SERVICE_SCREEN_OPTIONS: - option_text = waitForObjectExists(settings_text_obj(option)) - test.compare(option_text.text, option, "{} should be available under services screen".format(option)) - test.endSection() def main(): utils.tstStart(__file__) startApplication(config.AUT_NAME) navigate_to_settings_screen() - navigate_to_services_password_screen_and_enter_password() utils.tstDone()