diff --git a/tests/system/shared/editor_utils.py b/tests/system/shared/editor_utils.py index 72a844fec37..e5a652aae96 100644 --- a/tests/system/shared/editor_utils.py +++ b/tests/system/shared/editor_utils.py @@ -380,13 +380,13 @@ def openDocument(treeElement): except: treeElement = addBranchWildcardToRoot(treeElement) item = waitForObjectItem(navigator, treeElement) + expected = str(item.text).split("/")[-1] for _ in range(2): # Expands items as needed what might make scrollbars appear. # These might cover the item to click. # In this case, do it again to hit the item then. doubleClickItem(navigator, treeElement, 5, 5, 0, Qt.LeftButton) mainWindow = waitForObject(":Qt Creator_Core::Internal::MainWindow") - expected = str(item.text).split("/")[-1] if waitFor("str(mainWindow.windowTitle).startswith(expected + ' ')", 5000): return True test.log("Expected file (%s) was not being opened in openDocument()" % expected)