Index: suite_leahi/tst_settings_service/test.py =================================================================== diff -u -r4d3ce0eac45db33379f71308b11191ee2312f31b -rf7c5babf0cceeac7cacd155523b3fca43ac25a95 --- suite_leahi/tst_settings_service/test.py (.../test.py) (revision 4d3ce0eac45db33379f71308b11191ee2312f31b) +++ suite_leahi/tst_settings_service/test.py (.../test.py) (revision f7c5babf0cceeac7cacd155523b3fca43ac25a95) @@ -39,7 +39,7 @@ test.startSection("Navigating to 'Manufacture Login' menu") headerbar_container = waitForObject(names.o_headerBar_HeaderBar) service_screen_headerbar_title_text = utility.findChildByText( - headerbar_container, "Manufacturing Setup" + headerbar_container, config.MANUFACTURING_SCREEN_TITLE_TEXT ) if service_screen_headerbar_title_text is not None: test.compare( @@ -58,7 +58,7 @@ container = waitForObject(names.o_UserConfirmation_SettingsServicePassword) # Find all TextInput objects that share the id "_input" - password_inputs = utility.findAllObjectsById(container, "_input") + password_inputs = utility.findAllChildrenById(container, "_input") # Use enumerate to track the index (0, 1, 2) for index, input_field in enumerate(password_inputs): @@ -73,7 +73,6 @@ confirm_button = utility.get_object_from_names( names.o_SettingsHome_confirmButton, "Error Missing Confirm Button", - 2000 ) if confirm_button is not None: mouseClick(confirm_button) @@ -98,7 +97,7 @@ """ container = waitForObject(names.o_UserConfirmation_SettingsServicePassword) - password_inputs = utility.findAllObjectsById(container, "_input") + password_inputs = utility.findAllChildrenById(container, "_input") for index, input_field in enumerate(password_inputs): # # Clear the field before typing a new value for the test case @@ -125,14 +124,14 @@ td_simulator.td_operation_mode(TDOpModes.MODE_SERV.value, 0) grid_container = waitForObject(names.o_DeviceSettingsGrid) - service_option = utility.findChildByText(grid_container, "Service") + service_option = utility.findChildByText(grid_container, config.SERVICE) if service_option is not None: mouseClick(service_option) headerbar_container = waitForObject(names.o_headerBar_HeaderBar) service_screen_headerbar_title_text = utility.findChildByText( - headerbar_container, "Service" + headerbar_container, config.SERVICE_SCREEN_TITLE_TEXT ) if service_screen_headerbar_title_text is not None: test.compare( @@ -149,14 +148,14 @@ mouseClick(confirm_button) grid_container = waitForObject(names.o_DeviceSettingsGrid, 2000) - advanced_modes_option = utility.findChildByText(grid_container, "Advanced Mode") + advanced_modes_option = utility.findChildByText(grid_container, config.ADVANCED_MODE) if advanced_modes_option is not None: mouseClick(advanced_modes_option) headerbar_container = waitForObject(names.o_headerBar_HeaderBar, 2000) advanced_modes_screen_headerbar_title_text = utility.findChildByText( - headerbar_container, "Advanced Mode" + headerbar_container, config.ADVANCED_MODES_SCREEN_TITLE_TEXT ) if advanced_modes_screen_headerbar_title_text is not None: test.compare( @@ -203,14 +202,14 @@ def date_and_time_screen(): test.startSection("Navigating to 'Date and Time' Screen and Verify Parameters") grid_container = waitForObject(names.o_DeviceSettingsGrid) - date_and_time_option = utility.findChildByText(grid_container, "Date and Time") + date_and_time_option = utility.findChildByText(grid_container, config.DATE_AND_TIME) if date_and_time_option is not None: mouseClick(date_and_time_option) headerbar_container = waitForObject(names.o_headerBar_HeaderBar) date_and_time_screen_headerbar_title_text = utility.findChildByText( - headerbar_container, "Date and Time" + headerbar_container, config.DATE_AND_TIME_SCREEN_TITLE_TEXT ) if date_and_time_screen_headerbar_title_text is not None: test.compare( @@ -223,12 +222,12 @@ grid_container = waitForObject( names.o_timeContainer_LabelUnitContainer ) - date_and_time_option = utility.findChildByText(grid_container, "Time") + date_and_time_option = utility.findChildByText(grid_container, config.TIME) if date_and_time_option is not None: test.compare( date_and_time_option.text, - "Time", + config.TIME, "{} should be available in Date and Time Screen".format( date_and_time_option.text ), @@ -296,14 +295,14 @@ def enable_root_ssh_screen(): test.startSection("Navigating to 'Enable Root SSH' screen") grid_container = waitForObject(names.o_DeviceSettingsGrid) - enable_root_ssh_option = utility.findChildByText(grid_container, "Enable Root SSH") + enable_root_ssh_option = utility.findChildByText(grid_container, config.ENABLE_ROOT_SSH) if enable_root_ssh_option is not None: mouseClick(enable_root_ssh_option) headerbar_container = waitForObject(names.o_headerBar_HeaderBar) enable_root_ssh_screen_headerbar_title_text = utility.findChildByText( - headerbar_container, "Enable Root SSH" + headerbar_container, config.ENABLE_ROOT_SSH_SCREEN_TITLE_TEXT ) if enable_root_ssh_screen_headerbar_title_text is not None: test.compare( @@ -397,14 +396,14 @@ def factory_reset_screen(): test.startSection("Navigating to 'Factory Reset' screen") grid_container = waitForObject(names.o_DeviceSettingsGrid) - factory_reset_option = utility.findChildByText(grid_container, "Factory Reset") + factory_reset_option = utility.findChildByText(grid_container, config.FACTORY_RESET) if factory_reset_option is not None: mouseClick(factory_reset_option) headerbar_container = waitForObject(names.o_headerBar_HeaderBar) factory_reset_screen_headerbar_title_text = utility.findChildByText( - headerbar_container, "Factory Reset" + headerbar_container, config.FACTORY_RESET_SCREEN_TITLE_TEXT ) if factory_reset_screen_headerbar_title_text is not None: test.compare( @@ -419,7 +418,7 @@ names.o_userConfirmation_SettingsFactoryReset ) factory_reset_screen_text = utility.findChildByText( - factory_reset_container, "Do you want to perform the factory reset?" + factory_reset_container, config.FACTORY_RESET_SCREEN_TEXT ) if factory_reset_screen_text is not None: test.compare( @@ -446,9 +445,8 @@ login_page_title_text = utility.get_object_from_names( names.o_loginPage_Titletext, error_message="Login Page Title text not found", - timeout_ms=2000, ) - if login_page_title_text.text == 'Set Password': + if login_page_title_text.text == config.SET_PASSWORD: manufacture_login() else: closeWindow(names.o_Gui_MainView)