SquishTests: Replace wait condition strings with lambdas

Squish allows passing wait conditions as strings containing python code.
The only advantage I see is that the notation is a little shorter than
using a lambda. On the other hand, the strings can't get proper syntax
highlighting and cause false positive warnings about unused variables.

Change-Id: I226840fa26dc75d07d89f20647d069e2e866bbc9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Robert Löhning
2024-04-05 11:06:26 +02:00
parent 87fb3358d1
commit 20f01b351c

View File

@@ -21,13 +21,13 @@ def main():
openQmakeProject(os.path.join(pathSpeedcrunch, "src", "speedcrunch.pro"),
[Targets.DESKTOP_5_14_1_DEFAULT])
# Wait for parsing to complete
waitFor("runButton.enabled", 30000)
waitFor(lambda: runButton.enabled, 30000)
# Starting before opening, because this is where Creator froze (QTCREATORBUG-10733)
startopening = datetime.utcnow()
openQmakeProject(pathCreator, [Targets.DESKTOP_5_14_1_DEFAULT])
# Wait for parsing to complete
startreading = datetime.utcnow()
waitFor("runButton.enabled", 300000)
waitFor(lambda: runButton.enabled, 300000)
secondsOpening = (datetime.utcnow() - startopening).seconds
secondsReading = (datetime.utcnow() - startreading).seconds
timeoutOpen = 45