Index: tst_settings_date_and_time/test.py =================================================================== diff -u -rc79559a8ecd6dc676c7aed956ba1a5d1e45534a0 -r6f1e1819d6605964e7ba8366d0408cc26890be99 --- tst_settings_date_and_time/test.py (.../test.py) (revision c79559a8ecd6dc676c7aed956ba1a5d1e45534a0) +++ tst_settings_date_and_time/test.py (.../test.py) (revision 6f1e1819d6605964e7ba8366d0408cc26890be99) @@ -63,15 +63,40 @@ return names.o_settings_date_and_time_text -def navigate_to_service_screen(): +def navigate_to_service_menu(): """ Method to navigate to "Service" screen """ - test.startSection("Navigating to 'Service' screen") + test.startSection("Navigating to 'Service' menu") hd_simulator.cmd_send_hd_operation_mode(op_mode=HDOpModes.MODE_SERV.value, sub_mode=HDStandbyStates.STANDBY_START_STATE.value) utils.waitForGUI(0.5) service_screen_text = waitForObjectExists(service_text_obj(config.SERVICE_SCREEN_TITLE_TEXT)) test.compare(service_screen_text.text, config.SERVICE_SCREEN_TITLE_TEXT, "{} screen is displayed".format(config.SERVICE_SCREEN_TITLE_TEXT)) + test.compare(waitForObjectExists(names.o_service_text).text,config.SERVICE_TEXT, "{} screen is displayed".format(config.SERVICE_TEXT)) + mouseClick(waitForObjectExists(names.o_service_text)) + services_password_title = (waitForObjectExists(names.o_service_text_title).text) + test.compare(services_password_title, config.SERVICES_TITLE_TEXT, "{} should display once user is navigated to services password screen".format(config.SERVICES_TITLE_TEXT)) + utils.waitForGUI(0.5) + + #enter the password to access screen + test.log("Clicking on password entry field") + utils.waitForGUI(0.5) + mouseClick(waitForObjectExists(names.o_password_text_field)) + mouseClick(waitForObjectExists(names.o_switch_keyboard_to_keypad)) + password = config.DEFAULT_SERVICE_PASSWORD_RAW + type(waitForObject(names.o_password_text_field), str(password)) + mouseClick(waitForObjectExists(names.o_service_show_password)) + test.log("Verifying the entered password") + password = str((waitForObjectExists(names.o_password_text_field)).text) + test.compare(password, str(password), "Entered password should be {}".format(str(password))) + confirm_button = (waitForObjectExists(names.o_service_confirm_btn).text) + test.compare(confirm_button, config.CONFIRM_TEXT, "Button text should be {}".format(config.CONFIRM_TEXT)) + mouseClick(waitForObjectExists(names.o_service_confirm_btn)) + utils.waitForGUI(0.5) + + # HD response to advance to the service menu + hd_simulator.cmd_send_hd_operation_mode(op_mode=HDOpModes.MODE_SERV.value, sub_mode=HDStandbyStates.STANDBY_START_STATE.value) + test.endSection() @@ -124,59 +149,55 @@ date_row_children = object.children(date_row) time_title_text = time_row_children[TITLE_OBJECT_ITEM_NUMBER_0] date_title_text = date_row_children[TITLE_OBJECT_ITEM_NUMBER_0] + test.log("Verifying time title text") test.compare(time_title_text.text, TIME_TITLE, "{} should be the time title text".format(TIME_TITLE)) + test.log("Verifying date title text") test.compare(date_title_text.text, DATE_TITLE_TEXT, "{} should be the date title text".format(DATE_TITLE_TEXT)) hour_parent = time_row_children[1] hour_parent_children = object.children(hour_parent) - INPUT_FIELD_INDEX = 1 - hour_input_field = hour_parent_children[INPUT_FIELD_INDEX] - minute_parent = time_row_children[-1] - minute_parent_children = object.children(minute_parent) - minute_input_field = minute_parent_children[ INPUT_FIELD_INDEX] - test.log("Entering hour") + utils.waitForGUI(0.5) - mouseClick(hour_input_field) + + test.log("Entering hour") + hour_input_field = waitForObject(names.o_SettingsBase_serviceScreen_TextInput_hours) + mouseClick(waitForObject(hour_input_field)) utility.erase_entered_value(hour_input_field) utility.enter_keypad_value(hour) verify_valid_and_invalid_entry_and_its_color(entry=hour, date_time_parameter=HOUR_TEXT, input_field=hour_input_field) + test.log("Entering minute") + minute_input_field = waitForObject(names.o_SettingsBase_serviceScreen_TextInput_mins) mouseClick(minute_input_field) utility.erase_entered_value(minute_input_field) utility.enter_keypad_value(min) verify_valid_and_invalid_entry_and_its_color(entry=min, date_time_parameter=MINUTE_TEXT, input_field=minute_input_field) - MONTH_PARENT_INDEX = 1 - DAY_PARENT_INDEX = 3 - YEAR_PARENT_INDEX = -1 - month_parent = date_row_children[MONTH_PARENT_INDEX] - month_children = object.children(month_parent) - month_input_field = month_children[INPUT_FIELD_INDEX] - day_parent = date_row_children[DAY_PARENT_INDEX] - day_children = object.children(day_parent) - day_input_field = day_children[INPUT_FIELD_INDEX] - year_parent = date_row_children[YEAR_PARENT_INDEX] - year_children = object.children(year_parent) - year_input_field = year_children[INPUT_FIELD_INDEX] + test.log("Entering Month") + month_input_field = waitForObject(names.o_SettingsBase_serviceScreen_TextInput_month) mouseClick(month_input_field) utility.erase_entered_value(month_input_field) utility.enter_keypad_value(month) verify_valid_and_invalid_entry_and_its_color(entry=month, date_time_parameter=MONTH_TEXT, input_field=month_input_field) + test.log("Entering Day") + day_input_field = waitForObject(names.o_SettingsBase_serviceScreen_TextInput_day) mouseClick(day_input_field) utility.erase_entered_value(day_input_field) utility.enter_keypad_value(day) - verify_valid_and_invalid_entry_and_its_color(entry=day, date_time_parameter=DAY_TEXT, input_field=day_input_field, month=month) + verify_valid_and_invalid_entry_and_its_color(entry=day, date_time_parameter=DAY_TEXT, input_field=day_input_field, month=month, year=year) + test.log("Entering Year") + year_input_field = waitForObject(names.o_SettingsBase_serviceScreen_TextInput_year) mouseClick(year_input_field) utility.erase_entered_value(year_input_field) utility.enter_keypad_value(year) verify_valid_and_invalid_entry_and_its_color(entry=year, date_time_parameter=YEAR_TEXT, input_field=year_input_field) verify_confirm_btn(valid_parameter_passed) test.endSection() -def verify_valid_and_invalid_entry_and_its_color(entry, date_time_parameter, input_field, month=None): +def verify_valid_and_invalid_entry_and_its_color(entry, date_time_parameter, input_field, month=None, year=None): """ Method to verify the valid and invalid entry of date and time and its color @@ -207,7 +228,7 @@ elif date_time_parameter is DAY_TEXT: if(month == 4 or month == 6 or month == 9 or month == 11): day_upper_limit = DAY_UPPER_LIMIT - 1 - elif(month == 2 and isleap(date_time_parameter is YEAR_TEXT)): + elif(month == 2 and year!=None and isleap(year)): day_upper_limit = DAY_UPPER_LIMIT - 2 elif(month == 2): day_upper_limit = DAY_UPPER_LIMIT - 3 @@ -262,10 +283,9 @@ startApplication(config.AUT_NAME+ " -l") - navigate_to_service_screen() + navigate_to_service_menu() navigate_to_set_date_and_time() - verify_back_btn() verify_entered_date_and_time(hour="24", min="33", day="1", month="3", year="2022", valid_parameter_passed=config.INVALID) verify_entered_date_and_time(hour="00", min="60", day="29", month="2", year="2020", valid_parameter_passed=config.INVALID) verify_entered_date_and_time(hour="13", min="33", day="32", month="2", year="2022", valid_parameter_passed=config.INVALID)