SquishTests: Allow designer test to progress further

Explicitly chose a newer kit as the kit we would use by default
lacks some compiler features on Windows.
This patch here only fixes the test crash when trying to access
a disabled menu item due to cmake dropping out with error when
parsing the project with the active kit.
Drive by change: removed workaround for fixed bug.

Change-Id: I783626f30d27ab1852536ae0d1f936ec8323feb8
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
This commit is contained in:
Christian Stenger
2023-12-07 13:35:58 +01:00
parent 049ac852a6
commit 1633d76b76
2 changed files with 20 additions and 6 deletions

View File

@@ -139,7 +139,12 @@ def __createProjectHandleQtQuickSelection__(minimumQtVersion):
# param buildSystem is a string holding the build system selected for the project # param buildSystem is a string holding the build system selected for the project
# param checks turns tests in the function on if set to True # param checks turns tests in the function on if set to True
# param available a list holding the available targets # param available a list holding the available targets
def __selectQtVersionDesktop__(buildSystem, checks, available=None): # param targets a list holding the wanted targets - defaults to all desktop targets if empty
# returns checked targets
def __selectQtVersionDesktop__(buildSystem, checks, available=None, targets=[]):
if len(targets):
wanted = targets
else:
wanted = Targets.desktopTargetClasses() wanted = Targets.desktopTargetClasses()
checkedTargets = __chooseTargets__(wanted, available) checkedTargets = __chooseTargets__(wanted, available)
if checks: if checks:
@@ -162,6 +167,7 @@ def __selectQtVersionDesktop__(buildSystem, checks, available=None):
verifyChecked(cbObject % ("Profile", objectMap.realName(detailsWidget))) verifyChecked(cbObject % ("Profile", objectMap.realName(detailsWidget)))
clickButton(detailsButton) clickButton(detailsButton)
clickButton(waitForObject(":Next_QPushButton")) clickButton(waitForObject(":Next_QPushButton"))
return checkedTargets
def __createProjectHandleLastPage__(expectedFiles=[], addToVersionControl="<None>", addToProject=None): def __createProjectHandleLastPage__(expectedFiles=[], addToVersionControl="<None>", addToProject=None):
if len(expectedFiles): if len(expectedFiles):
@@ -205,8 +211,10 @@ def __getProjectFileName__(projectName, buildSystem):
# param checks turns tests in the function on if set to True # param checks turns tests in the function on if set to True
# param addToVersionControl selects the specified VCS from Creator's wizard # param addToVersionControl selects the specified VCS from Creator's wizard
# param buildSystem selects the specified build system from Creator's wizard # param buildSystem selects the specified build system from Creator's wizard
# param targets specifies targets that should be checked
# returns the checked targets
def createProject_Qt_GUI(path, projectName, checks=True, addToVersionControl="<None>", def createProject_Qt_GUI(path, projectName, checks=True, addToVersionControl="<None>",
buildSystem=None): buildSystem=None, targets=[]):
template = "Qt Widgets Application" template = "Qt Widgets Application"
available = __createProjectOrFileSelectType__(" Application (Qt)", template) available = __createProjectOrFileSelectType__(" Application (Qt)", template)
__createProjectSetNameAndPath__(path, projectName, checks) __createProjectSetNameAndPath__(path, projectName, checks)
@@ -229,7 +237,7 @@ def createProject_Qt_GUI(path, projectName, checks=True, addToVersionControl="<N
clickButton(waitForObject(":Next_QPushButton")) clickButton(waitForObject(":Next_QPushButton"))
__createProjectHandleTranslationSelection__() __createProjectHandleTranslationSelection__()
__selectQtVersionDesktop__(buildSystem, checks, available) checkedTargets = __selectQtVersionDesktop__(buildSystem, checks, available, targets)
expectedFiles = [] expectedFiles = []
if checks: if checks:
@@ -243,6 +251,7 @@ def createProject_Qt_GUI(path, projectName, checks=True, addToVersionControl="<N
waitForProjectParsing() waitForProjectParsing()
if checks: if checks:
__verifyFileCreation__(path, expectedFiles) __verifyFileCreation__(path, expectedFiles)
return checkedTargets
# Creates a Qt Console project # Creates a Qt Console project
# param path specifies where to create the project # param path specifies where to create the project

View File

@@ -8,8 +8,13 @@ def main():
if not startedWithoutPluginError(): if not startedWithoutPluginError():
return return
projectName = "DesignerTestApp" projectName = "DesignerTestApp"
createProject_Qt_GUI(tempDir(), projectName, # explicitly chose new kit to avoid compiler issues on Windows
buildSystem="qmake" if JIRA.isBugStillOpen(28787) else "CMake") targets = createProject_Qt_GUI(tempDir(), projectName, buildSystem="CMake",
targets=[Targets.DESKTOP_6_2_4])
if len(targets) != 1:
earlyExit()
return
invokeMenuItem('Build', 'Build Project "%s"' % projectName) invokeMenuItem('Build', 'Build Project "%s"' % projectName)
selectFromLocator("mainwindow.ui") selectFromLocator("mainwindow.ui")
dragAndDrop(waitForObject("{container=':qdesigner_internal::WidgetBoxCategoryListView'" dragAndDrop(waitForObject("{container=':qdesigner_internal::WidgetBoxCategoryListView'"