Squish: Click again when hitting scroll bar in openDocument()

Change-Id: Iae5256c894fbd4fcb8b93fd5b6dbe7b56b428982
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Robert Loehning
2016-06-13 12:27:57 +02:00
parent 1c739aeccb
commit c8150dc918

View File

@@ -387,11 +387,16 @@ def openDocument(treeElement):
except:
treeElement = addBranchWildcardToRoot(treeElement)
item = waitForObjectItem(navigator, treeElement)
doubleClickItem(navigator, treeElement, 5, 5, 0, Qt.LeftButton)
mainWindow = waitForObject(":Qt Creator_Core::Internal::MainWindow")
expected = str(item.text).split("/")[-1]
waitFor("expected in str(mainWindow.windowTitle)")
return True
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("expected in str(mainWindow.windowTitle)", 5000):
return True
return False
except:
return False