Index: shared/scripts/configuration/config.py =================================================================== diff -u -r6f9555a5c09047dd070e7d6c6820e212f2199a55 -r98de6e3aae57ae6e06b6624fab7e183103149f33 --- shared/scripts/configuration/config.py (.../config.py) (revision 6f9555a5c09047dd070e7d6c6820e212f2199a55) +++ shared/scripts/configuration/config.py (.../config.py) (revision 98de6e3aae57ae6e06b6624fab7e183103149f33) @@ -60,3 +60,5 @@ OUT_OF_RANGE_COLOR = "#c53b33" IN_RANGE_COLOR = "#fcfcfc" SERVICE_CONF_LOCATION = "/home/denali/Projects/application/resources/settings/Service.conf" +VALID = True +INVALID = False Index: tst_settings_date_and_time/test.py =================================================================== diff -u -r6f9555a5c09047dd070e7d6c6820e212f2199a55 -r98de6e3aae57ae6e06b6624fab7e183103149f33 --- tst_settings_date_and_time/test.py (.../test.py) (revision 6f9555a5c09047dd070e7d6c6820e212f2199a55) +++ tst_settings_date_and_time/test.py (.../test.py) (revision 98de6e3aae57ae6e06b6624fab7e183103149f33) @@ -17,7 +17,7 @@ from dialin.ui.hd_simulator import HDSimulator from dialin.common.hd_defs import HDOpModes from dialin.ui import utils -from configuration.config import SERVICE_CONF_LOCATION +from configuration.config import SERVICE_CONF_LOCATION, ENABLED hd_simulator = HDSimulator() @@ -133,6 +133,8 @@ minute_parent_children = object.children(minute_parent) minute_input_field = minute_parent_children[1] test.log("Entering hour") + utils.waitForGUI(0.5) + mouseClick(hour_input_field) utility.erase_entered_value(hour_input_field) utility.enter_keypad_value(hour) test.compare(hour_input_field.text, hour, "Hour value should be {}".format(hour)) @@ -144,11 +146,14 @@ test.compare(minute_input_field.text, min, "Minute value should be {}".format(min)) verify_color_of_entry(entry=min, date_time_parameter=MINUTE_TEXT, input_field=minute_input_field) month_parent = date_row_children[1] - month_input_field = month_parent[1] + month_children = object.children(month_parent) + month_input_field = month_children[1] day_parent = date_row_children[3] - day_input_field = day_parent[1] + day_children = object.children(day_parent) + day_input_field = day_children[1] year_parent = date_row_children[-1] - year_input_field = year_parent[1] + year_children = object.children(year_parent) + year_input_field = year_children[1] test.log("Entering Month") mouseClick(month_input_field) utility.erase_entered_value(month_input_field) @@ -207,6 +212,15 @@ test.compare(input_field_color, config.IN_RANGE_COLOR, "Year value {} is in range of {} and {}".format(entry, YEAR_LOWER_LIMIT, YEAR_UPPER_LIMIT)) test.endSection() +def verify_confirm_btn(valid_parameter_passed): + if valid_parameter_passed is config.VALID: + if object.exists(date_time_screen_text_obj(text=config.CONFIRM_TEXT)): + confirm_btn = waitForObjectExists(date_time_screen_text_obj(text=config.CONFIRM_TEXT)) + test.compare(confirm_btn.enabled, config.ENABLED, "Confirm Button should be enabled") + mouseClick(confirm_btn) + else: + if not(object.exists(date_time_screen_text_obj(text=config.CONFIRM_TEXT))): + test.passes("Confirm button is not available") def main(): @@ -218,6 +232,21 @@ navigate_to_services_password_screen_and_enter_password() navigate_to_set_date_and_time() verify_entered_date_and_time(hour="12", min="33", day="1", month="3", year="2022") + verify_confirm_btn(config.VALID) + verify_entered_date_and_time(hour="24", min="33", day="1", month="3", year="2022") + verify_confirm_btn(config.INVALID) + verify_entered_date_and_time(hour="00", min="60", day="1", month="3", year="2022") + verify_confirm_btn(config.INVALID) + verify_entered_date_and_time(hour="13", min="33", day="32", month="3", year="2022") + verify_confirm_btn(config.INVALID) + verify_entered_date_and_time(hour="13", min="33", day="4", month="13", year="2022") + verify_confirm_btn(config.INVALID) + verify_entered_date_and_time(hour="22", min="33", day="22", month="12", year="2101") + verify_confirm_btn(config.INVALID) + verify_entered_date_and_time(hour="22", min="33", day="22", month="12", year="1969") + verify_confirm_btn(config.INVALID) + verify_entered_date_and_time(hour="23", min="12", day="7", month="8", year="1977") + verify_confirm_btn(config.VALID)