diff options
author | Robert LΓΆhning <robert.loehning@qt.io> | 2025-04-09 13:22:56 +0200 |
---|---|---|
committer | Robert LΓΆhning <robert.loehning@qt.io> | 2025-06-12 15:34:47 +0000 |
commit | 5eafc6edd4c5907f48817c585aeeb38a7253f17d (patch) | |
tree | d74237280264984a4b297babf5be742952d8718c /Tests/system/shared/utils.py | |
parent | c98a7d9fe4b762b9f40155af38189570f0d144ec (diff) |
Squish: Fix crashing tests after updating MSVS
Change-Id: Ief7b663f1fc3145b4359506bf5be8502e99b8918
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
Diffstat (limited to 'Tests/system/shared/utils.py')
-rw-r--r-- | Tests/system/shared/utils.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Tests/system/shared/utils.py b/Tests/system/shared/utils.py index e27e876b..683de76a 100644 --- a/Tests/system/shared/utils.py +++ b/Tests/system/shared/utils.py @@ -41,8 +41,8 @@ def getMsvsVersionAsList(): return msvsVersion -def fixAppContext(wantedName="devenv"): - waitFor(lambda: len(applicationContextList()) > 1, 30000) +def fixAppContext(wantedName="devenv", timeout=30000): + waitFor(lambda: len(applicationContextList()) > 1, timeout) appContexts = applicationContextList() if len(appContexts) == 1: # Might have changed after waitFor() if appContexts[0].name != wantedName: @@ -61,6 +61,13 @@ def startApp(waitForInitialDialogs=False, clearSettings=True): command += " /Command QtVSTools.ClearSettings" startApplication(command % rootSuffix) version = getMsvsProductLine() + + # When MSVS with installed Qt VS Tools starts for the first time after an update, it creates a + # "ServiceHub.ThreadedWaitDialog" application context. Squish uses that as the current + # application context and cannot find any of MSVS' GUI elements. To fix that, wait for the + # additional application context and set the current context to "devenv". + fixAppContext(timeout=15000) + if waitForInitialDialogs: try: if version == "2022": |