diff --git a/testbed/tests/testbed.py b/testbed/tests/testbed.py index 8b6423e068..98eaf20acd 100644 --- a/testbed/tests/testbed.py +++ b/testbed/tests/testbed.py @@ -15,9 +15,13 @@ def run_tests(app, cov, args, report_coverage, run_slow, running_in_ci): try: - # Wait for the app's main window to be visible. + # Wait for the app's main window to be visible. Retrieving the actual main window + # will raise an exception until the app is actually initialized, so we check the + # underlying variable. print("Waiting for app to be ready for testing... ", end="", flush=True) - while app.main_window is None or not app.main_window.visible: + while app._main_window is None: + time.sleep(0.05) + while not app.main_window.visible: time.sleep(0.05) print("ready.") # Control the run speed of the test app.