Index: suite_leahi/shared/scripts/configuration/config.py =================================================================== diff -u -re74e550d3abff8c854a63ed41d5b01d78b110094 -rfddb8614c64345cc0ad8fe2a98a892529e76924d --- suite_leahi/shared/scripts/configuration/config.py (.../config.py) (revision e74e550d3abff8c854a63ed41d5b01d78b110094) +++ suite_leahi/shared/scripts/configuration/config.py (.../config.py) (revision fddb8614c64345cc0ad8fe2a98a892529e76924d) @@ -1,14 +1,30 @@ -from configuration.strings import * - # -S, --disable-sd-card-fail-log-stop disable-sd-card-fail-log-stop # -k, --enable-check-in-log Enables Check-In Log # -K, --enable-acknow-log Enables Acknowledgment Log AUT_NAME = "leahi -k -K -S -q" AUT_NAME_ONLY = "leahi" # Need only the AUT name for tst_ui_logs, do not add options -HOME_DIR_PATH = "/home/denali" + +# Configuration application_init.py TMP_DIR = "/tmp/" +APP_POST_LOG_LOCATION = "".join([str(TMP_DIR),'/post.log']) +#Service Export Logs ENABLED = True +DEVICE_SETTINGS_SCREEN_TITLE_TEXT = "Device Settings" +EXPORT_LOG_TEXT = "Export Logs" +EXPORT_LOGS_OPTIONS = ["Application", "Service", "Treatment"] +EXPORT_LOG_STATUS = "Application log export to USB is complete" +EXPORT_LOG_PROGRESS_STATUS = "Service log export to USB in progress ... " +SERVICE_SCREEN_TITLE_TEXT = "Service" -APP_POST_LOG_LOCATION = "".join([str(TMP_DIR),'/post.log']) +# Headerbar_information_popup +INFORMATION_PARAMETERS = [ + "OS Version", "UI Version", "TD Version", "TD FPGA Version", + "TD Serial Number", "DD Version", "DD FPGA Version", "DD Serial Number", +] +# Device Settings WiFi +WIFI_TEXT = "Wi-Fi" +WIFI_PARAMETERS_TEXTS = ["SSID", "IP Address", "Gateway", "Subnet Mask", "DNS"] +WIFI_SCREEN_SCAN_BUTTON_TEXT = "SCAN" +DISABLED = False \ No newline at end of file Index: suite_leahi/shared/scripts/names.py =================================================================== diff -u -re2c906a7b5fde31d48d168f097fe6a5a2ab0afea -rfddb8614c64345cc0ad8fe2a98a892529e76924d --- suite_leahi/shared/scripts/names.py (.../names.py) (revision e2c906a7b5fde31d48d168f097fe6a5a2ab0afea) +++ suite_leahi/shared/scripts/names.py (.../names.py) (revision fddb8614c64345cc0ad8fe2a98a892529e76924d) @@ -40,7 +40,6 @@ o_dialyste_cond_title_Text = {"container": mainTreatmentScreen, "id": "_dialysateCond", "objectName": "dialysateCondComponent", "type": "TreatmentFlowsComponent" } o_treatmentTimeNotificationBarSmall = {"container": mainTreatmentScreen, "objectName": "notification", "type": "NotificationBarSmall" } - # settings_service_export_logs o_listView_ListView = {"container": o_Gui_MainView, "id": "_listView", "type": "ListView", "unnamed": 1 } o_listView_delegateControl = {"container": o_listView_ListView, "index": 2, "objectName": "delegateControl", "type": "Item" } @@ -58,5 +57,10 @@ o_ExportLogsNotificationBar = {"container": o_SettingsExportLogs, "id": "_information", "type": "NotificationBarSmall" } o_DeviceSettingsGrid = {"container": o_SettingsHome, "id": "_grid", "type": "Grid", } - - +#Device Settings Wi-Fi +o_SettingsBase_SettingsInformation = {"container": o_Gui_MainView, "objectName": "_SettingsBase", "type": "SettingsBase" } +o_SettingsBase_Information_Text = {"container": o_SettingsBase_SettingsInformation, "type": "Text", "unnamed": 1 } +o_InformationPageTitleText = {"container": o_SettingsInformation, "id": "_titleText", "type": "Text", "unnamed": 1 } +o_SettingsBase_SettingsWiFi = {"container": o_Gui_MainView, "objectName": "_SettingsBase", "type": "SettingsWiFi" } +o_SettingsBase_WifiScreen_ScanButton = {"container": o_SettingsBase_SettingsWiFi, "id": "_scanButton", "type": "TouchRect", "unnamed": 1 } +o_SettingsBase_WifiScreen_BackButton = {"container": o_SettingsBase_SettingsWiFi, "objectName": "_backButton", "type": "BackButton" } Index: suite_leahi/tst_device_settings_wifi/test.py =================================================================== diff -u --- suite_leahi/tst_device_settings_wifi/test.py (revision 0) +++ suite_leahi/tst_device_settings_wifi/test.py (revision fddb8614c64345cc0ad8fe2a98a892529e76924d) @@ -0,0 +1,168 @@ +# Subject/Title: Device Settings - SW - 02 - Wifi - Q&R +# +# Functionalities: Testing items of Device Settings WiFi Screen +# +# Steps: +# 1 Set OS version, start Leahi Application, simulate TD standby mode, +# First, navigate to the Device Settings screen and Compare Device Settings title text +# Then, navigate to the WiFi screen and Compare WiFi screen title text +# 2 Verify the parameter under Device Settings WiFi screen +# 3 Set and Compare Information Parameters texts +# 4 Verify SCAN button is Disabled and Compare WiFi Screen Scan Button text +# 5 Click on WiFi Screen Back Button to navigate back from WiFi Screen + + +import names +from configuration import config, utility +from leahi_dialin.ui.td_messaging import TD_Messaging +from leahi_dialin.ui import utils +from leahi_dialin.common.td_defs import TDOpModes + + +td_simulator = TD_Messaging() + + +def text_obj(text): + """ + Method to set custom object property for WiFi screen. + @param text: (string) parameter text + """ + names.o_SettingsBase_Information_Text["text"] = text + return names.o_SettingsBase_Information_Text + + +def navigate_to_device_settings_screen(): + """ + Method to navigate to "Device Settings" 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=3000, + ) + if settings_menu_object is not None: + 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, + ) + if device_setting_screen_title_text is not None: + test.compare( + device_setting_screen_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 findChildByText(parent_object, target_text): + """Recursively finds a child object by its text property.""" + for child in object.children(parent_object): + if hasattr(child, "text") and str(child.text) == target_text: + return child + found = findChildByText(child, target_text) + if found: + return found + return None + + +def navigate_to_wifi_settings_screen(): + grid_container = waitForObject(names.o_DeviceSettingsGrid) + wifi_option = findChildByText(grid_container, "Wi-Fi") + + if wifi_option is not None: + mouseClick(wifi_option) + + wifi_screen_title_text = utility.get_object_from_names( + names.o_InformationPageTitleText, + error_message="Wi-Fi screen title text object missing", + timeout_ms=1000, + ) + if wifi_screen_title_text is not None: + test.compare( + wifi_screen_title_text.text, + config.WIFI_TEXT, + "{} screen is displayed and Comparison of WiFi Screen Title text".format( + config.WIFI_TEXT + ), + ) + + +def verify_wifi_setting_parameters(): + """ + Method to verify "Wi-Fi" screen in service + """ + test.startSection("Verifying Wi-Fi Setting Parameters") + for wifi_parameter in config.WIFI_PARAMETERS_TEXTS: + wifi_parameter_text = waitForObjectExists(text_obj(wifi_parameter)) + test.compare( + wifi_parameter_text.text, + wifi_parameter, + "{} should be available under Wi-Fi title".format(wifi_parameter), + ) + wifi_screen_scan_button = waitForObjectExists( + names.o_SettingsBase_WifiScreen_ScanButton, 2000 + ) + + if wifi_screen_scan_button is not None: + test.compare( + wifi_screen_scan_button.textString, + config.WIFI_SCREEN_SCAN_BUTTON_TEXT, + "{} button is displayed and Comparison of WiFi Screen Scan Button text".format( + config.WIFI_SCREEN_SCAN_BUTTON_TEXT + ), + ) + + if wifi_screen_scan_button is True: + test.compare( + wifi_screen_scan_button.enabled, + config.ENABLED, + f"Check if the WiFi Screen Scan Button enabled = {config.ENABLED}", + ) + else: + test.compare( + wifi_screen_scan_button.enabled, + config.DISABLED, + f"Check if the WiFi Screen Scan Button disabled = {config.DISABLED}", + ) + + wifi_screen_back_button = utility.get_object_from_names( + names.o_SettingsBase_WifiScreen_BackButton, + error_message="WiFi Screen Back Button missing", + timeout_ms=1000, + ) + if wifi_screen_back_button is not None: + mouseClick(wifi_screen_back_button) + + # Verify that UI navigated back to Device Setting Screen by Comparing Device Settings title after clicking on Back Button + 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, + ) + if device_setting_screen_title_text is not None: + test.compare( + device_setting_screen_title_text.text, + config.DEVICE_SETTINGS_SCREEN_TITLE_TEXT, + "{} screen is displayed after navigating back and Comparison of Device Settings Screen Title text".format( + config.DEVICE_SETTINGS_SCREEN_TITLE_TEXT + ), + ) + + +def main(): + utils.tstStart(__file__) + + test.startSection( + "Launch Leahi application and Navigate to Device Settings WiFi screen" + ) + startApplication(config.AUT_NAME + "-q") + navigate_to_device_settings_screen() + navigate_to_wifi_settings_screen() + test.endSection() + verify_wifi_setting_parameters() + test.endSection()