SquishTests: Improve toggling filter names in "Issues" view

- Explicitly set a shorter timeout. After the menu appears, it
  should not take that long until the item is there, too.

- Warn when an item can't be found. This should not go unnoticed,
  because it either means that the GUI changed or that there's a
  bug in the test. Both require a fix.

Change-Id: Id7faa2b91926c392bd0d894214f498d8ba8edaa1
Reviewed-by: Jukka Nokso <jukka.nokso@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Robert Löhning
2024-02-15 17:16:32 +01:00
parent c4abbef0a8
commit cfb26a06a7

View File

@@ -9,7 +9,7 @@ def toggleIssuesFilter(filterName, checked):
filterMenu = waitForObject("{type='QMenu' unnamed='1' visible='1'}") filterMenu = waitForObject("{type='QMenu' unnamed='1' visible='1'}")
waitFor("filterMenu.visible", 1000) waitFor("filterMenu.visible", 1000)
filterCategory = waitForObjectItem(filterMenu, filterName) filterCategory = waitForObjectItem(filterMenu, filterName, 1000)
waitFor("filterCategory.visible", 2000) waitFor("filterCategory.visible", 2000)
if filterCategory.checked == checked: if filterCategory.checked == checked:
test.log("Filter '%s' has already check state %s - not toggling." test.log("Filter '%s' has already check state %s - not toggling."
@@ -20,8 +20,8 @@ def toggleIssuesFilter(filterName, checked):
test.log("Filter '%s' check state changed to %s." % (filterName, checked)) test.log("Filter '%s' check state changed to %s." % (filterName, checked))
except: except:
t,v = sys.exc_info()[:2] t,v = sys.exc_info()[:2]
test.log("Exception while toggling filter '%s'" % filterName, test.warning("Exception while toggling filter '%s'" % filterName,
"%s: %s" % (t.__name__, str(v))) "%s: %s" % (t.__name__, str(v)))
def getBuildIssues(ignoreCodeModel=True): def getBuildIssues(ignoreCodeModel=True):