Index: suite_leahi/tst_service_export_logs/test.py =================================================================== diff -u -r98661ca0120138f0a071a0444750c7a39f03b5d9 -rf7c5babf0cceeac7cacd155523b3fca43ac25a95 --- suite_leahi/tst_service_export_logs/test.py (.../test.py) (revision 98661ca0120138f0a071a0444750c7a39f03b5d9) +++ suite_leahi/tst_service_export_logs/test.py (.../test.py) (revision f7c5babf0cceeac7cacd155523b3fca43ac25a95) @@ -43,16 +43,15 @@ def navigate_to_export_logs(): - grid_container = waitForObject(names.o_DeviceSettingsGrid) - export_logs_item = utility.findChildByText(grid_container, "Export Logs") + grid_container = utility.get_object_from_names(names.o_DeviceSettingsGrid) + export_logs_item = utility.findChildByText(grid_container, config.EXPORT_LOGS) if export_logs_item is not None: mouseClick(export_logs_item) - export_log_screen_title_text = utility.get_object_from_names( - names.o_ExportLogsPageTitleText, - error_message="export log screen title text object missing", - timeout_ms=1000, + headerbar_container = utility.get_object_from_names(names.o_headerBar_HeaderBar, 2000) + export_log_screen_title_text = utility.findChildByText( + headerbar_container, config.EXPORT_LOG_TEXT ) if export_log_screen_title_text is not None: test.compare( @@ -71,7 +70,6 @@ eject_usb_button = utility.get_object_from_names( names.o_USBEjectButton, error_message="eject usb button object not found", - timeout_ms=3000, ) if eject_usb_button is not None: test.compare( @@ -87,14 +85,18 @@ """ tests the case that the usb is ejected, requires restarting the application to get original state """ - mouseClick(waitForObjectExists(names.o_ExportButton)) + export_button = utility.get_object_from_names( + names.o_ExportButton, + error_message="Export button was not enabled", + ) + if export_button is not None: + mouseClick(export_button) utils.waitForGUI( 1 ) # This wait is to verify that the Application log export to USB is complete. Increase seconds in waitForGUI if the test compare fails. export_log_status = utility.get_object_from_names( names.o_ExportLogsNotificationBar, error_message="export log status missing", - timeout_ms=3000, ) if export_log_status is not None: @@ -110,22 +112,20 @@ def select_different_log_type(whichTypeIndex): log_type_combo_box = utility.get_object_from_names( - names.o_LogTypeComboBox, error_message="Combo box object is missing" + names.o_LogTypeComboBox, error_message="Combo box object is missing", ) if log_type_combo_box is not None: mouseClick(waitForObjectExists(names.o_LogTypeComboBox)) log_type_option = utility.get_object_from_names( utility.setObjectText(names.o_OptionComboBox, 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) combo_box_text = utility.get_object_from_names( names.o_LogTypeComboBox, error_message="unable to select from Combo Box", - timeout_ms=1000, ) test.compare( config.EXPORT_LOGS_OPTIONS[whichTypeIndex], @@ -134,19 +134,17 @@ config.EXPORT_LOGS_OPTIONS[whichTypeIndex] ), ) - + export_button = utility.get_object_from_names( names.o_ExportButton, error_message="Export button was not enabled", - timeout_ms=2000, ) if export_button is not None: mouseClick(export_button) export_log_progress_status = utility.get_object_from_names( names.o_ExportLogsNotificationBar, error_message="export log progress status missing", - timeout_ms=2000, ) if export_log_progress_status is not None: test.compare( @@ -164,12 +162,23 @@ def select_a_log_file_and_export(): - mouseClick(waitForObjectExists(names.o_ExportLogsProgressRect)) - mouseClick(waitForObjectExists(names.o_ExportButton)) + select_a_file = utility.get_object_from_names( + names.o_ExportLogsProgressRect, + error_message="eject o_ExportLogsProgressRect object not found", + ) + if select_a_file is not None: + mouseClick(select_a_file) + + export_button = utility.get_object_from_names( + names.o_ExportButton, + error_message="Export button was not enabled", + ) + if export_button is not None: + mouseClick(export_button) + export_log_status = utility.get_object_from_names( names.o_ExportLogsNotificationBar, error_message="export log status missing", - timeout_ms=3000, ) if export_log_status is not None: test.compare( @@ -229,16 +238,16 @@ test.startSection("Export Application log files") application_init.delete_existing_files_usb_folders() - startApplication(config.AUT_NAME) + startApplication(utility.aut("-q")) navigation.navigate_to_device_settings_screen() navigate_to_export_logs() test_export_logs_eject_usb_case() closeWindow(names.o_Gui_MainView) test.endSection() - + test.startSection("Export Service log files") - - startApplication(config.AUT_NAME) + + startApplication(utility.aut("-q")) navigation.navigate_to_device_settings_screen() navigate_to_export_logs() select_different_log_type(1) @@ -248,9 +257,9 @@ test.startSection("Export single log file") application_init.delete_existing_files_usb_folders() - startApplication(config.AUT_NAME) + startApplication(utility.aut("-q")) navigation.navigate_to_device_settings_screen() navigate_to_export_logs() select_a_log_file_and_export() - utils.tstDone() + utils.tstDone() \ No newline at end of file