diff --git a/tests/system/shared/editor_utils.py b/tests/system/shared/editor_utils.py index 52baf8b4cd7..543cb24ba6c 100644 --- a/tests/system/shared/editor_utils.py +++ b/tests/system/shared/editor_utils.py @@ -309,18 +309,11 @@ def maskSpecialCharsForSearchResult(filename): return filename def waitForSearchResults(): - def __noCancelButton__(): - global passes - passes += 1 - return not object.exists("{text='Cancel' type='QToolButton' unnamed='1' visible='1' " - "window=':Qt Creator_Core::Internal::MainWindow'}") + cancelButton = ("{text='Cancel' type='QToolButton' unnamed='1' visible='1' " + "window=':Qt Creator_Core::Internal::MainWindow'}") - global passes - passes = 0 - waitFor("__noCancelButton__()", 20000) - if passes < 2: - test.warning("Did not have to wait for search results.", - "Either Creator was really quick or the GUI was changed.") + waitFor("object.exists(cancelButton)", 3000) + waitFor("not object.exists(cancelButton)", 20000) def validateSearchResult(expectedCount): searchResult = waitForObject(":Qt Creator_SearchResult_Core::Internal::OutputPaneToggleButton")