From 9cbdfcd13ea8b19ab0bb905eb015abca6ff39a7f Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Tue, 18 Feb 2025 08:51:57 +0100 Subject: [PATCH] SquishTests: Fix welcome page test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix path used for the new MinGW Qt. Correctly clean up examples - newer Qt versions use cmake instead of qmake. 'Example' seems to have been removed from the title of the example docs. Change-Id: I6751d9b26a24bf0e53d79a8d4203c8f11bb2e026 Reviewed-by: Robert Löhning --- tests/system/shared/classes.py | 5 ++++- tests/system/suite_WELP/tst_WELP03/test.py | 21 ++++++++++++++------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/tests/system/shared/classes.py b/tests/system/shared/classes.py index 755234eacd5..74722c23ad2 100644 --- a/tests/system/shared/classes.py +++ b/tests/system/shared/classes.py @@ -32,7 +32,10 @@ class Targets: @staticmethod def isOnlineInstaller(target): - return target == Targets.DESKTOP_6_2_4 + onlineInstallerTargets = [Targets.DESKTOP_6_2_4] + if os.getenv("SYSTEST_NEW_SETTINGS") == "1": + onlineInstallerTargets.append(Targets.DESKTOP_6_7_3_GCC) + return target in onlineInstallerTargets @staticmethod def availableTargetClasses(ignoreValidity=False): diff --git a/tests/system/suite_WELP/tst_WELP03/test.py b/tests/system/suite_WELP/tst_WELP03/test.py index 8d4fa29a9bb..d73a84e35fa 100644 --- a/tests/system/suite_WELP/tst_WELP03/test.py +++ b/tests/system/suite_WELP/tst_WELP03/test.py @@ -38,8 +38,9 @@ def openExample(examplesLineEdit, input, exampleRegex, exampleName, waitForChild mouseClick(waitForObjectItem(listView, str(example.text))) handlePackagingMessageBoxes() helpWidget = waitForObject(":Help Widget_Help::Internal::HelpWidget") - test.verify(waitFor('exampleName in str(helpWidget.windowTitle)', 5000), - "Verifying: The example application is opened inside Help.") + if not test.verify(waitFor('exampleName in str(helpWidget.windowTitle)', 5000), + "Verifying: The example application is opened inside Help."): + test.log("%s vs %s" % (str(helpWidget.windowTitle), exampleName)) sendEvent("QCloseEvent", helpWidget) # assume the correct kit is selected, hit Configure Project clickButton(waitForObject(":Qt Creator.Configure Project_QPushButton")) @@ -80,8 +81,10 @@ def main(): example = findExampleOrTutorial(listView, ".*", True) test.verify(example is None, "Verifying: No example is shown.") - proFiles = [os.path.join(p, "opengl", "2dpainting", "2dpainting.pro") - for p in QtPath.getPaths(QtPath.EXAMPLES)] + proFiles = [] + for p in QtPath.getPaths(QtPath.EXAMPLES): + proFiles.append(os.path.join(p, "opengl", "2dpainting", "2dpainting.pro")) + proFiles.append(os.path.join(p, "opengl", "2dpainting", "CMakeLists.txt")) cleanUpUserFiles(proFiles) example = openExample(examplesLineEdit, "2d painting", "2D Painting.*", "2D Painting Example") @@ -97,12 +100,16 @@ def main(): # go to "Welcome" page and choose another example switchViewTo(ViewConstants.WELCOME) - proFiles = [os.path.join(p, "widgets", "itemviews", "addressbook", "addressbook.pro") - for p in QtPath.getPaths(QtPath.EXAMPLES)] + + proFiles = [] + for p in QtPath.getPaths(QtPath.EXAMPLES): + proFiles.append(os.path.join(p, "widgets", "itemviews", "addressbook", "addressbook.pro")) + proFiles.append(os.path.join(p, "widgets", "itemviews", "addressbook", "CMakeLists.txt")) + cleanUpUserFiles(proFiles) examplesLineEdit = waitForObject(search %(expect[1][0], expect[1][1])) example = openExample(examplesLineEdit, "address book", "(0000 )?Address Book.*", - "Address Book Example", 3) + "Address Book ", 3) if example is not None: # close second example application test.verify(checkIfObjectExists("{column='0' container=':Qt Creator_Utils::NavigationTreeView'"