Commit 5f763625 authored by Robert Loehning's avatar Robert Loehning Committed by Christian Stenger

Squish: Store text of item as early as possible

It seems that item.text can change after (not during!) the
double-click. Storing it earlier to workaround this problem.

Change-Id: I5da4ae7ea8e19b945e56349c2236940a9e5731cb
Reviewed-by: Christian Stenger's avatarChristian Stenger <christian.stenger@qt.io>
parent 4e4118dd
...@@ -380,13 +380,13 @@ def openDocument(treeElement): ...@@ -380,13 +380,13 @@ def openDocument(treeElement):
except: except:
treeElement = addBranchWildcardToRoot(treeElement) treeElement = addBranchWildcardToRoot(treeElement)
item = waitForObjectItem(navigator, treeElement) item = waitForObjectItem(navigator, treeElement)
expected = str(item.text).split("/")[-1]
for _ in range(2): for _ in range(2):
# Expands items as needed what might make scrollbars appear. # Expands items as needed what might make scrollbars appear.
# These might cover the item to click. # These might cover the item to click.
# In this case, do it again to hit the item then. # In this case, do it again to hit the item then.
doubleClickItem(navigator, treeElement, 5, 5, 0, Qt.LeftButton) doubleClickItem(navigator, treeElement, 5, 5, 0, Qt.LeftButton)
mainWindow = waitForObject(":Qt Creator_Core::Internal::MainWindow") mainWindow = waitForObject(":Qt Creator_Core::Internal::MainWindow")
expected = str(item.text).split("/")[-1]
if waitFor("str(mainWindow.windowTitle).startswith(expected + ' ')", 5000): if waitFor("str(mainWindow.windowTitle).startswith(expected + ' ')", 5000):
return True return True
test.log("Expected file (%s) was not being opened in openDocument()" % expected) test.log("Expected file (%s) was not being opened in openDocument()" % expected)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment