diff options
author | Robert LΓΆhning <robert.loehning@qt.io> | 2024-04-08 21:47:22 +0200 |
---|---|---|
committer | Robert LΓΆhning <robert.loehning@qt.io> | 2024-05-27 14:08:50 +0000 |
commit | 40195bf96e1c39315480f772c55e9872b754c675 (patch) | |
tree | 55d1b6a3d3b4b91104a1eded257dfe6acd80d2c0 /Tests/system/shared/utils.py | |
parent | c0c60222960e4f3d94f26390c63f12bfc85ee89c (diff) |
Squish: Fix application context to avoid exception
Change-Id: If63dd0dbd5b9ad42af1cdb05c4cca138b9b0bf8a
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
Diffstat (limited to 'Tests/system/shared/utils.py')
-rw-r--r-- | Tests/system/shared/utils.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/Tests/system/shared/utils.py b/Tests/system/shared/utils.py index fe08fef8..300474ea 100644 --- a/Tests/system/shared/utils.py +++ b/Tests/system/shared/utils.py @@ -22,6 +22,20 @@ def getAppProperty(property): return plv.decode().strip() +def fixAppContext(): + waitFor(lambda: len(applicationContextList()) > 1, 30000) + appContexts = applicationContextList() + if len(appContexts) == 1: # Might have changed after waitFor() + if appContexts[0].name != "devenv": + test.fatal("The only application context is " + appContexts[0].name) + else: + for ctxt in appContexts: + if ctxt.name == "devenv": + setApplicationContext(ctxt) + return + test.fatal("There's no devenv application context, only: " + appContexts) + + def startAppGetVersion(waitForInitialDialogs=False, clearSettings=True): command = "devenv /LCID 1033 /RootSuffix %s" if clearSettings: @@ -33,8 +47,10 @@ def startAppGetVersion(waitForInitialDialogs=False, clearSettings=True): if version == "2022": clickButton(waitForObject(globalnames.msvs_Skip_this_for_now_Button, 10000)) else: - mouseClick(waitForObject(globalnames.msvs_Not_now_maybe_later_Label, 10000)) + mouseClick(waitForObject(globalnames.msvs_Not_now_maybe_later_Label, 20000)) clickButton(waitForObject(globalnames.msvs_Start_Visual_Studio_Button)) + if version == "2019": + fixAppContext() except: pass if clearSettings: |