Quellcode durchsuchen

fix failing tests

Signed-off-by: Daniel Tamkin <[email protected]>
Daniel Tamkin vor 2 Jahren
Ursprung
Commit
7484b2c2ee

+ 9 - 6
AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetBrowser_SearchFiltering.py

@@ -94,8 +94,11 @@ def AssetBrowser_SearchFiltering():
         editor_window = pyside_utils.get_editor_main_window()
         app = QtWidgets.QApplication.instance()
 
-        # 3) Type the name of an asset in the search bar and make sure it is filtered to and selectable
+        # 3) Switch to list view, type the name of an asset in the search bar and make sure it is filtered to and selectable
         asset_browser = editor_window.findChild(QtWidgets.QDockWidget, "Asset Browser")
+        tree_view_button = asset_browser.findChild(QtWidgets.QToolButton, "m_treeViewButton")
+        tree_view_button.click()
+        general.idle_wait(1.0)
         search_bar = asset_browser.findChild(QtWidgets.QLineEdit, "textSearch")
 
         # Add a small pause when typing in the search bar in order to check that the entries are updated properly
@@ -105,15 +108,15 @@ def AssetBrowser_SearchFiltering():
         general.idle_wait(0.5)
 
         asset_browser_tree = asset_browser.findChild(QtWidgets.QTreeView, "m_assetBrowserTreeViewWidget")
-        asset_browser_table = asset_browser.findChild(QtWidgets.QTreeView, "m_assetBrowserTableViewWidget")
-        found = await pyside_utils.wait_for_condition(lambda: pyside_utils.find_child_by_pattern(asset_browser_table, "cedar.fbx"), 5.0)
+        found = await pyside_utils.wait_for_condition(lambda: pyside_utils.find_child_by_pattern(asset_browser_tree, "cedar.fbx"), 5.0)
         if found:
-            model_index = pyside_utils.find_child_by_pattern(asset_browser_table, "cedar.fbx")
+            model_index = pyside_utils.find_child_by_pattern(asset_browser_tree, "cedar.fbx")
         else:
             Report.result(Tests.asset_filtered, found)
-        pyside_utils.item_view_index_mouse_click(asset_browser_table, model_index)
+        asset_browser_tree.scrollTo(model_index)
+        pyside_utils.item_view_index_mouse_click(asset_browser_tree, model_index)
         is_filtered = await pyside_utils.wait_for_condition(
-            lambda: asset_browser_table.currentIndex() == model_index, 5.0)
+            lambda: asset_browser_tree.currentIndex() == model_index, 5.0)
         Report.result(Tests.asset_filtered, is_filtered)
 
         # 4) Click the "X" in the search bar.

+ 4 - 1
AutomatedTesting/Gem/PythonTests/editor/EditorScripts/AssetBrowser_TreeNavigation.py

@@ -82,9 +82,12 @@ def AssetBrowser_TreeNavigation():
     else:
         Report.info("Asset Browser is already open")
 
-    # 3) Collapse all files initially
+    # 3) Switch to List view and collapse all files initially
     main_window = editor_window.findChild(QtWidgets.QMainWindow)
     asset_browser = pyside_utils.find_child_by_pattern(main_window, text="Asset Browser", type=QtWidgets.QDockWidget)
+    tree_view_button = asset_browser.findChild(QtWidgets.QToolButton, "m_treeViewButton")
+    tree_view_button.click()
+    general.idle_wait(1.0)
     tree = pyside_utils.find_child_by_pattern(asset_browser, "m_assetBrowserTreeViewWidget")
     scroll_area = tree.findChild(QtWidgets.QWidget, "qt_scrollarea_vcontainer")
     scroll_bar = scroll_area.findChild(QtWidgets.QScrollBar)