aboutsummaryrefslogtreecommitdiffstats
path: root/Tests/system/shared/utils.py
diff options
context:
space:
mode:
authorRobert LΓΆhning <robert.loehning@qt.io>2024-04-08 16:49:40 +0200
committerRobert LΓΆhning <robert.loehning@qt.io>2024-05-27 14:04:43 +0000
commitc0c60222960e4f3d94f26390c63f12bfc85ee89c (patch)
tree8fe59276fccf288a54793e289fce4af6cfeca20e /Tests/system/shared/utils.py
parentbc9277b67350c7dd94e12e7e230689b924330706 (diff)
Squish: Clear Qt VS Tools' settings before running any test
Except for installation tests which expect the Qt VS Tools to not be installed. Change-Id: Ie7f5dbf3c5c0f77673bb9e207c4d40f78223a2f5 Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
Diffstat (limited to 'Tests/system/shared/utils.py')
-rw-r--r--Tests/system/shared/utils.py22
1 files changed, 19 insertions, 3 deletions
diff --git a/Tests/system/shared/utils.py b/Tests/system/shared/utils.py
index 5e0eac62..fe08fef8 100644
--- a/Tests/system/shared/utils.py
+++ b/Tests/system/shared/utils.py
@@ -22,8 +22,11 @@ def getAppProperty(property):
return plv.decode().strip()
-def startAppGetVersion(waitForInitialDialogs=False):
- startApplication("devenv /LCID 1033 /RootSuffix %s" % rootSuffix)
+def startAppGetVersion(waitForInitialDialogs=False, clearSettings=True):
+ command = "devenv /LCID 1033 /RootSuffix %s"
+ if clearSettings:
+ command += " /Command QtVSTools.ClearSettings"
+ startApplication(command % rootSuffix)
version = getAppProperty("catalog_productLineVersion")
if waitForInitialDialogs:
try:
@@ -34,7 +37,20 @@ def startAppGetVersion(waitForInitialDialogs=False):
clickButton(waitForObject(globalnames.msvs_Start_Visual_Studio_Button))
except:
pass
- mouseClick(waitForObject(globalnames.continueWithoutCode_Label))
+ if clearSettings:
+ try:
+ label = waitForObjectExists(names.Command_not_valid_Label, 3000)
+ if label.text == 'Command "QtVSTools.ClearSettings" is not valid.':
+ test.warning('Command "QtVSTools.ClearSettings" could not be handled.',
+ 'Qt VS Tools might be outdated or inactive.')
+ else:
+ test.warning('An unexpected error message appeared.', label.text)
+ clickButton(waitForObject(globalnames.microsoft_Visual_Studio_OK_Button))
+ except:
+ # "QtVSTools.ClearSettings" was handled successfully
+ pass
+ else:
+ mouseClick(waitForObject(globalnames.continueWithoutCode_Label))
try:
if version == "2022":
# If it appears, close the "Sign in" nagscreen.