Squish: Fix tst_HELP02

We don't just need any items in the model,
we need an item that passes the filter.

Change-Id: I831a8a2d4ba27c838e7ea07625d066a19946a789
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Robert Loehning
2016-05-13 17:37:41 +02:00
parent 2e7361bb1e
commit 990e2a83ca

View File

@@ -50,12 +50,15 @@ def getQtCreatorVersionFromFile():
return ""
def checkQtCreatorHelpVersion(expectedVersion):
def rightStart(x):
return x.startswith('Qt Creator Manual')
switchViewTo(ViewConstants.HELP)
try:
helpContentWidget = waitForObject(':Qt Creator_QHelpContentWidget', 5000)
waitFor("helpContentWidget.model().rowCount > 0", 2000)
waitFor("any(map(rightStart, dumpItems(helpContentWidget.model())))", 2000)
items = dumpItems(helpContentWidget.model())
test.compare(filter(lambda x: x.startswith('Qt Creator Manual'), items)[0],
test.compare(filter(rightStart, items)[0],
'Qt Creator Manual %s' % expectedVersion,
'Verifying whether manual uses expected version.')
except: