SquishTests: Ignore non-kit items

Change-Id: Id9b209171fc296fc65b6c6c1755df491ba7d4997
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
This commit is contained in:
Christian Stenger
2024-05-17 11:04:59 +02:00
parent 63a93760d9
commit 29b1727b16

View File

@@ -8,7 +8,9 @@ def verifyProjectsMode(expectedKits):
bAndRIndex = getQModelIndexStr("text='Build & Run'",
":Projects.ProjectNavigationTreeView")
foundKits = dumpItems(treeView.model(), waitForObject(bAndRIndex))
relevantKits = list(filter(lambda x: 'Python' not in x,foundKits)) # ignore Python kits
# ignore Python kits and non-kit item
excludes = ('Python', 'Hide Inactive Kits', 'Show All Kits')
relevantKits = list(filter(lambda x: all(ex not in x for ex in excludes), foundKits))
test.compare(len(relevantKits), len(expectedKits), "Verify number of listed kits.")
test.compare(set(relevantKits), set(expectedKits), "Verify if expected kits are listed.")
hasKits = len(expectedKits) > 0