Index: suite_leahi/tst_service_export_logs/test.py =================================================================== diff -u -r14e13c671eb6df2f9f100143a68c0fa86c3d2241 -r739f2dc38df443ffc1d30a76720dbd08dd99e43d --- suite_leahi/tst_service_export_logs/test.py (.../test.py) (revision 14e13c671eb6df2f9f100143a68c0fa86c3d2241) +++ suite_leahi/tst_service_export_logs/test.py (.../test.py) (revision 739f2dc38df443ffc1d30a76720dbd08dd99e43d) @@ -2,7 +2,6 @@ # Python -import builtins import names import os import glob @@ -13,22 +12,23 @@ from leahi_dialin.ui.td_messaging import TD_Messaging from leahi_dialin.common.td_defs import TDOpModes, TDStandbyStates from leahi_dialin.ui import utils -from calendar import isleap - td =TD_Messaging() +EXPORT_LOG_STATUS ="Application log export to USB is complete" +EXPORT_LOG_PROGRESS_STATUS ="Service log export to USB in progress ... " + def custom_object_for_export_log(text): """ Method to set custom object property for export option @param text : (string) parameter text """ - names.o_option_combo_box["text"] = text - return names.o_option_combo_box + names.optionComboBox["text"] = text + return names.optionComboBox def service_text_obj(text): - names.o_SettingsHome_Service_Text["text"] = text - return names.o_SettingsHome_Service_Text + names.serviceText["text"] = text + return names.serviceText def navigate_to_service_menu(): """ @@ -44,38 +44,44 @@ def navigate_to_export_logs(): test.startSection("Verifying the the export logs screen") - export_log_subscreen_menu_element = utility.get_object_from_names(names.o_SettingsHome_touchItem_ExportsLogs, error_message = "export log menu element object missing") + export_log_subscreen_menu_element = utility.get_object_from_names(names.settingsHomeExportLogs, error_message = "export log menu element object missing") if export_log_subscreen_menu_element is not None: mouseClick(export_log_subscreen_menu_element) utils.waitForGUI(1) - export_log_text = utility.get_object_from_names(names.o_export_logs_text, error_message = "export log text object missing") + export_log_text = utility.get_object_from_names(names.exportLogsText, error_message = "export log text object missing") if export_log_text is not None: test.compare(export_log_text.text,config.EXPORT_LOG_TEXT,"{} should be under export logs screen ".format(config.EXPORT_LOG_TEXT)) test.endSection() def select_different_log_type(whichTypeIndex): - log_type_combo_box = utility.get_object_from_names(names.o_combo_box, error_message="Combo box object is missing") + log_type_combo_box = utility.get_object_from_names(names.comboBox, error_message="Combo box object is missing") if log_type_combo_box is not None: - mouseClick(waitForObjectExists(names.o_combo_box)) + mouseClick(waitForObjectExists(names.comboBox)) log_type_option = utility.get_object_from_names(custom_object_for_export_log(config.EXPORT_LOGS_OPTIONS[whichTypeIndex]), error_message=f"Option {config.EXPORT_LOGS_OPTIONS[whichTypeIndex]} object is missing", timeout_ms = 500) if log_type_option is not None: mouseClick(log_type_option) utils.waitForGUI(2) - test.compare(config.EXPORT_LOGS_OPTIONS[whichTypeIndex], waitForObjectExists(names.o_combo_box ).displayText, "User should able to select {}".format(config.EXPORT_LOGS_OPTIONS[whichTypeIndex])) + test.compare(config.EXPORT_LOGS_OPTIONS[whichTypeIndex], waitForObjectExists(names.comboBox ).displayText, "User should able to select {}".format(config.EXPORT_LOGS_OPTIONS[whichTypeIndex])) utils.waitForGUI(1) - mouseClick(waitForObjectExists(names.o_SettingsBase_logTypeExportButton_ExportButton)) - mouseClick(waitForObjectExists(names.o_SettingsBase_usbEjectButton_USBButton)) + mouseClick(waitForObjectExists(names.exportButton)) + + export_log_progress_status = utility.get_object_from_names(names.notificationBar, error_message = "export log progress status missing") + if export_log_progress_status is not None: + test.compare(export_log_progress_status.text,EXPORT_LOG_PROGRESS_STATUS,"{}".format(EXPORT_LOG_PROGRESS_STATUS)) + + utils.waitForGUI(3) + mouseClick(waitForObjectExists(names.usbEjectButton)) return True return False # default return if not successful def check_eject_usb_button(is_enabled, is_clicking_button = False): """ For checking enabled/disabled state of the usb eject button """ - eject_usb_button = utility.get_object_from_names(names.o_SettingsBase_usbEjectButton_USBButton, error_message="eject usb button object not found") + eject_usb_button = utility.get_object_from_names(names.usbEjectButton, error_message="eject usb button object not found") if eject_usb_button is not None: test.compare(eject_usb_button.enabled, is_enabled, f"Check if the USB eject button enabled = {is_enabled}") if is_clicking_button: @@ -103,20 +109,22 @@ """ init_application_service_export_logs() - mouseClick(waitForObjectExists(names.o_SettingsBase_logTypeExportButton_ExportButton)) + mouseClick(waitForObjectExists(names.exportButton)) utils.waitForGUI(1) + export_log_status = utility.get_object_from_names(names.notificationBar, error_message = "export log status missing") + if export_log_status is not None: + test.compare(export_log_status.text,EXPORT_LOG_STATUS,"{}".format(EXPORT_LOG_STATUS)) check_eject_usb_button(config.ENABLED, is_clicking_button=True) utils.waitForGUI(1) - # check_eject_usb_button(config.DISABLED) stop_application() def select_a_log_file_and_export(): test.startSection("Selecting a log file and exporting it") - mouseClick(waitForObjectExists(names.o_SettingsBase_progressRect_ProgressRect)) + mouseClick(waitForObjectExists(names.progressRect)) utils.waitForGUI(1) - mouseClick(waitForObjectExists(names.o_SettingsBase_logTypeExportButton_ExportButton)) - mouseClick(waitForObjectExists(names.o_SettingsBase_usbEjectButton_USBButton)) + mouseClick(waitForObjectExists(names.exportButton)) + mouseClick(waitForObjectExists(names.usbEjectButton)) def delete_existing_files_usb_folders():