diff options
6 files changed, 28 insertions, 7 deletions
diff --git a/Tests/system/Readme.txt b/Tests/system/Readme.txt index a9490b49..df0ee782 100644 --- a/Tests/system/Readme.txt +++ b/Tests/system/Readme.txt @@ -1,5 +1,8 @@ This directory contains tests for The Qt VS Tools to be run with Squish. +WARNING: Do not run these tests in an environment where you use the Qt VS Tools. + They will permanently delete the settings you saved, see QTVSADDINBUG-1088 + To run these tests: 1. Run Windows with English or German UI. 2. Have Visual Studio with English language pack and the Visual Studio SDK installed. 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. diff --git a/Tests/system/suite_installation/shared/scripts/names.py b/Tests/system/suite_installation/shared/scripts/names.py index 2e8c2e12..781ed87f 100644 --- a/Tests/system/suite_installation/shared/scripts/names.py +++ b/Tests/system/suite_installation/shared/scripts/names.py @@ -35,3 +35,5 @@ msvs_ExtensionManager_UI_InstalledExtItem_Uninstall_Label= {"container": lvw_Ext microsoft_Visual_Studio_Yes_Button= {"container": globalnames.microsoft_Visual_Studio_Dialog, "text": RegularExpression("Yes|Ja"), "type": "Button"} pART_Popup_qt_io_MenuItem = {"text": "qt.io", "type": "MenuItem"} +Command_not_valid_Label = {"container": globalnames.microsoft_Visual_Studio_Dialog, "id": "65535", + "type": "Label"} diff --git a/Tests/system/suite_installation/tst_0_reset_testinstance/test.py b/Tests/system/suite_installation/tst_0_reset_testinstance/test.py index 0fd17830..fc894069 100644 --- a/Tests/system/suite_installation/tst_0_reset_testinstance/test.py +++ b/Tests/system/suite_installation/tst_0_reset_testinstance/test.py @@ -17,7 +17,7 @@ import subprocess def main(): # Start MSVS to determine its version and instanceID, then close it immediately. - version = startAppGetVersion(True) + version = startAppGetVersion(True, False) vsVersionNr = {"2019":"16.0", "2022":"17.0"}[version] vsInstance = "_".join([vsVersionNr, getAppProperty("instanceID")]) installationPath = getAppProperty("installationPath") @@ -31,7 +31,7 @@ def main(): % (installationPath, vsInstance, rootSuffix)) try: # Start MSVS again to click away the nagscreens shown on first start - startAppGetVersion(True) + startAppGetVersion(True, False) closeMainWindow() except (LookupError, TypeError) as e: if version != "2019": diff --git a/Tests/system/suite_installation/tst_1_install_from_marketplace/test.py b/Tests/system/suite_installation/tst_1_install_from_marketplace/test.py index 2ab4387e..c19c025e 100644 --- a/Tests/system/suite_installation/tst_1_install_from_marketplace/test.py +++ b/Tests/system/suite_installation/tst_1_install_from_marketplace/test.py @@ -15,7 +15,7 @@ def main(): test.warning("This is a semi-manual test.", "It is designed to run on VS without Qt VS Tools installed " "and requires manual steps.") - version = startAppGetVersion() + version = startAppGetVersion(clearSettings=False) if not version: return if downloadQtVsTools(version): diff --git a/Tests/system/suite_installation/tst_9_uninstall_verify/test.py b/Tests/system/suite_installation/tst_9_uninstall_verify/test.py index bbfce1c4..202a7831 100644 --- a/Tests/system/suite_installation/tst_9_uninstall_verify/test.py +++ b/Tests/system/suite_installation/tst_9_uninstall_verify/test.py @@ -12,7 +12,7 @@ import names def main(): - version = startAppGetVersion() + version = startAppGetVersion(clearSettings=False) if not version: return vsToolsLabelText = selectInstalledVsTools(version) |