Index: suite_leahi/shared/scripts/configuration/config.py =================================================================== diff -u -r75e3ab588237239452761d2ec90e8b3aec6a916b -rb0ef2e099ea10d4ec265b06bd6c0325630f69a58 --- suite_leahi/shared/scripts/configuration/config.py (.../config.py) (revision 75e3ab588237239452761d2ec90e8b3aec6a916b) +++ suite_leahi/shared/scripts/configuration/config.py (.../config.py) (revision b0ef2e099ea10d4ec265b06bd6c0325630f69a58) @@ -90,5 +90,25 @@ VALIDATE = "VALIDATE" CONFIRM = "CONFIRM" NEXT ="Next" +# Settings Service +DEFAULT_SERVICE_PASSWORD_RAW = "Atal.Matal.22leh" # TODO need to update if we ever change the default +NEW_PASSWORD_RAW = "Test4.Ksah.sk43sa" +MANUFACTURING_SCREEN_TITLE_TEXT = "Manufacturing Setup" +SERVICE_SCREEN_TITLE_TEXT = "Service" +ADVANCED_MODES_SCREEN_TITLE_TEXT = "Advanced Mode" +DATE_AND_TIME_SCREEN_TITLE_TEXT = "Date and Time" +DATE_AND_TIME_PARAMETERS_TEXTS = ["NTP", "(Network Time Protocol)", "Time", "(HH:mm:ss)", "Date", "(MM/dd/yyyy)"] +ENABLE_ROOT_SSH_SCREEN_TITLE_TEXT = "Enable Root SSH" +ENABLE_ROOT_SSH_PARAMETERS_TEXTS = ["Enable SSH Login", "Enable Root Login"] +FACTORY_RESET_SCREEN_TITLE_TEXT = "Factory Reset" +FACTORY_RESET_SCREEN_TEXT = "Do you want to perform the factory reset?" +# Service Institutional +INSTITUTIONAL_CONFIGURATIONS_SCREEN_TITLE_TEXT = "Institutional Configurations" +ADVANCED_INSTITUTIONAL_SETTINGS_SCREEN_TITLE_TEXT = "Advanced Institutional Settings" +ADVANCED_INSTITUTIONAL_SETTINGS_NOTIFICATION_TEXT = "Advanced Institutional records and preferences updated" +INSTITUTIONAL_SETTINGS_NOTIFICATION_TEXT = "Institutional records and preferences updated" +CREATERX = "Rx" +NEXT = "Next" + Index: suite_leahi/shared/scripts/configuration/navigation.py =================================================================== diff -u -rc7d96b722594bb29a7bbc3689715b90af6e3d616 -rb0ef2e099ea10d4ec265b06bd6c0325630f69a58 --- suite_leahi/shared/scripts/configuration/navigation.py (.../navigation.py) (revision c7d96b722594bb29a7bbc3689715b90af6e3d616) +++ suite_leahi/shared/scripts/configuration/navigation.py (.../navigation.py) (revision b0ef2e099ea10d4ec265b06bd6c0325630f69a58) @@ -12,28 +12,52 @@ Method to navigate to "Service" screen """ td_simulator.td_operation_mode(TDOpModes.MODE_STAN.value, 0) - settings_menu_object = utility.get_object_from_names( - names.o_Settings_Menu, - error_message="Settings menu object missing", - timeout_ms=1000, + headerbar_container = squish.waitForObject(names.o_mainMenu_MainMenu, 2000) + settings_menu_object = utility.findChildByText( + headerbar_container, "Settings" ) if settings_menu_object is not None: squish.mouseClick(settings_menu_object) - device_setting_screen_title_text = utility.get_object_from_names( - names.o_DeviceSettingsTitleText, - error_message="Device Settings Screen title text object missing", - timeout_ms=2000, + headerbar_container = squish.waitForObject(names.o_headerBar_HeaderBar, 2000) + device_setting_screen_headerbar_title_text = utility.findChildByText( + headerbar_container, "Device Settings" ) - if device_setting_screen_title_text is not None: + if device_setting_screen_headerbar_title_text is not None: test.compare( - device_setting_screen_title_text.text, + device_setting_screen_headerbar_title_text.text, config.DEVICE_SETTINGS_SCREEN_TITLE_TEXT, "{} screen is displayed and Comparison of Device Settings Screen Title text".format( config.DEVICE_SETTINGS_SCREEN_TITLE_TEXT ), ) +def navigate_to_device_settings_using_service_password(): + td_simulator.td_operation_mode(TDOpModes.MODE_SERV.value, 0) + grid_container = squish.waitForObject(names.o_DeviceSettingsGrid) + service_option = utility.findChildByText(grid_container, "Service") + + if service_option is not None: + squish.mouseClick(service_option) + + headerbar_container = squish.waitForObject(names.o_headerBar_HeaderBar) + service_screen_headerbar_title_text = utility.findChildByText( + headerbar_container, "Service" + ) + if service_screen_headerbar_title_text is not None: + test.compare( + service_screen_headerbar_title_text.text, + config.SERVICE_SCREEN_TITLE_TEXT, + "{} screen is displayed and Comparison of Device Settings Screen Title text".format( + config.SERVICE_SCREEN_TITLE_TEXT + ), + ) + input_field = squish.waitForObject(names.o_userConfirmation_TextInput, 1000) + + squish.type(input_field, config.DEFAULT_SERVICE_PASSWORD_RAW) + confirm_button = squish.waitForObject(names.o_userConfirmation_ConfirmButton, 1000) + squish.mouseClick(confirm_button) + def navigation_pageIndicator_step(vStep_name): """ Navigate to the specified page using the step indicator component. @@ -47,6 +71,30 @@ test.startSection("Method to navigation in the pretreatment page ") stepId = squish.waitForObjectExists(names.o_preTreatmentStack_stepIndicator_StepIndicator) values = utility.findAllObjectsById(stepId, "_text") + for index, input_field in enumerate(values[1:]): + test.log(str(index)); + test.log(str(input_field.text)) + if str(input_field.text) == vStep_name: + test.log("Reached the target step") + break + else: + Nextbutton = utility.setObjectText(obj=names.o_preTreatmentStack_Text, text=config.NEXT) + squish.mouseClick(Nextbutton) + test.endSection() + +def navigation_pageIndicator_step(vStep_name): + """ + Navigate to the specified page using the step indicator component. + + This method selects the given step from the page step indicator + Args: + vStep_name (str): The name of the step to navigate to as displayed + in the step indicator. + + """ + test.startSection("Method to navigation in the pretreatment page ") + stepId = squish.waitForObjectExists(names.o_preTreatmentStack_stepIndicator_StepIndicator) + values = utility.findAllObjectsById(stepId, "_text") for index, input_field in enumerate(values[2:]): test.log(str(index)); test.log(str(input_field.text)) Index: suite_leahi/shared/scripts/configuration/utility.py =================================================================== diff -u -rc7d96b722594bb29a7bbc3689715b90af6e3d616 -rb0ef2e099ea10d4ec265b06bd6c0325630f69a58 --- suite_leahi/shared/scripts/configuration/utility.py (.../utility.py) (revision c7d96b722594bb29a7bbc3689715b90af6e3d616) +++ suite_leahi/shared/scripts/configuration/utility.py (.../utility.py) (revision b0ef2e099ea10d4ec265b06bd6c0325630f69a58) @@ -9,6 +9,13 @@ td =TD_Messaging() from leahi_dialin.ui import utils from builtins import int as pyInt + +def aut(*args): + """ + Joins the executable name and argument + into a single command string + """ + return " ".join(('leahi', *args)) def get_object_from_names(names_dict, error_message = "Missing object", timeout_ms = 200): """ @@ -73,7 +80,26 @@ found = findChildByText(child, target_text) if found: return found - + + return None + +def findAllObjectsById(parent, target_id): + """ + Recursively finds all child objects by their id property. + Returns a list of all matching objects found. + """ + results = [] + + # Use hasattr to safely check for 'id' property + if hasattr(parent, 'id') and str(parent.id) == target_id: + results.append(parent) + + # Recurse through all children to collect all instances + for child in object.children(parent): + results.extend(findAllObjectsById(child, target_id)) + + return results + def set_value_based_on_target(obj, target_value): """ obj: dictionary containing object paths @@ -242,6 +268,17 @@ utils.waitForGUI(0.2) # Small delay to allow UI to update return None + +def get_row_object(screen_obj, num): + """ + To obtain a row object based on occurrence provided. + @param screen_obj: provides the container on which the row must be present + @param num: provides the occurrence value (0-based index) + @returns a real name object + """ + names.o_Row_Object["container"] = screen_obj + names.o_Row_Object["occurrence"] = num + 1 + return names.o_Row_Object def get_object_color(names_dict, error_message = "Missing object color", timeout_ms = 2000): """ @@ -251,7 +288,6 @@ """ try: return squish.waitForObject(names_dict, timeout_ms).color.name - except LookupError: test.fail("ERROR : " + error_message) return None Index: suite_leahi/shared/scripts/names.py =================================================================== diff -u -r0e16f6d7e1f8349a7ccf945c666f6fdab7752d16 -rb0ef2e099ea10d4ec265b06bd6c0325630f69a58 --- suite_leahi/shared/scripts/names.py (.../names.py) (revision 0e16f6d7e1f8349a7ccf945c666f6fdab7752d16) +++ suite_leahi/shared/scripts/names.py (.../names.py) (revision b0ef2e099ea10d4ec265b06bd6c0325630f69a58) @@ -224,3 +224,23 @@ o_preTreatmentStack_Text = {"container": o_preTreatmentStack_PreTreatmentStack, "type": "Text", "unnamed": 1 } o_preTreatmentStack_stepIndicator_StepIndicator = {"container": o_preTreatmentStack_PreTreatmentStack, "id": "_stepIndicator", "type": "StepIndicator", "unnamed": 1 } + +# Service Institutional +o_Row_Object = { "id": "_row", "type": "Row", "unnamed": 1 } +o_SettingsBase_SettingsInstitutionalRecord = {"container": o_Gui_MainView, "objectName": "_SettingsBase", "type": "SettingsInstitutionalRecord", } +o_SettingsInstitutionalRecord_ListView = {"container": o_SettingsBase_SettingsInstitutionalRecord, "id": "_listView", "type": "ListView", "unnamed": 1 } +o_SettingsInstitutionalRecord_BackButton = {"container": o_SettingsBase_SettingsInstitutionalRecord, "objectName": "_backButton", "type": "BackButton", } +o_SettingsInstitutionalRecord_NotificationBar= {"container": o_SettingsBase_SettingsInstitutionalRecord, "objectName": "NotificationBar", "type": "NotificationBarSmall", } +o_SettingsInstitutional_min_ValueAdjuster = {"container": o_SettingsBase_SettingsInstitutionalRecord, "id": "_min", "type": "ValueAdjuster", "unnamed": 1 } +o_SettingsInstitutional_max_ValueAdjuster = {"container": o_SettingsBase_SettingsInstitutionalRecord, "id": "_max", "type": "ValueAdjuster", "unnamed": 1 } +o_SettingsInstitutional_def_ValueAdjuster = {"container": o_SettingsBase_SettingsInstitutionalRecord, "id": "_def", "type": "ValueAdjuster", "unnamed": 1 } +o_SettingsInstitutional_ConfirmButton = {"container": o_SettingsBase_SettingsInstitutionalRecord, "objectName": "_confirmButton", "type": "ConfirmButton", } +o_SettingsBase_SettingsAdvancedInstitutional= {"container": o_Gui_MainView, "objectName": "_SettingsBase", "type": "SettingsAdvancedInstitutional", } +o_SettingsAdvancedInstitutional_Notification= {"container": o_SettingsBase_SettingsAdvancedInstitutional, "objectName": "NotificationBar", "type": "NotificationBarSmall", } +o_SettingsAdvancedInstitutional_ConfirmButton= {"container": o_SettingsBase_SettingsAdvancedInstitutional, "objectName": "_confirmButton", "type": "ConfirmButton", } +o_SettingsAdvancedInstitutional_BackButton = {"container": o_SettingsBase_SettingsAdvancedInstitutional, "objectName": "_backButton", "type": "BackButton", } +o_SettingsAdvancedInstitutional_min_ValueAdjuster= {"container": o_SettingsBase_SettingsAdvancedInstitutional,"id": "_min", "type": "ValueAdjuster", "unnamed": 1 } +o_SettingsAdvancedInstitutional_max_ValueAdjuster= {"container": o_SettingsBase_SettingsAdvancedInstitutional,"id": "_max", "type": "ValueAdjuster", "unnamed": 1 } +o_SettingsAdvancedInstitutional_def_ValueAdjuster= {"container": o_SettingsBase_SettingsAdvancedInstitutional,"id": "_def", "type": "ValueAdjuster", "unnamed": 1 } +o_PreTreatmentCreate_leftArrow_IconButton = {"container": o_preTreatmentStack_PreTreatmentCreate_PreTreatmentCreate,"id": "_leftArrow", "type": "IconButton", "unnamed": 1 } +o_PreTreatmentCreate_rightArrow_IconButton = {"container": o_preTreatmentStack_PreTreatmentCreate_PreTreatmentCreate,"id": "_rightArrow", "type": "IconButton", "unnamed": 1 } \ No newline at end of file