Squish: Adapt to changed UI

New File and New Project are nowadays separate menu entries.

Change-Id: I36c619d5a2eb4b5ac36bb25a20a1cb62f33493bb
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
This commit is contained in:
Christian Stenger
2021-12-08 11:31:10 +01:00
parent 420b5bf541
commit 8039aa9ddb
3 changed files with 8 additions and 4 deletions

View File

@@ -79,13 +79,17 @@ def openCmakeProject(projectPath, buildDir):
# this list can be used in __chooseTargets__() # this list can be used in __chooseTargets__()
def __createProjectOrFileSelectType__(category, template, fromWelcome = False, isProject=True): def __createProjectOrFileSelectType__(category, template, fromWelcome = False, isProject=True):
if fromWelcome: if fromWelcome:
if not isProject:
test.fatal("'New' on Welcome screen only handles projects nowadays.")
wsButtonFrame, wsButtonLabel = getWelcomeScreenMainButton("New") wsButtonFrame, wsButtonLabel = getWelcomeScreenMainButton("New")
if not all((wsButtonFrame, wsButtonLabel)): if not all((wsButtonFrame, wsButtonLabel)):
test.fatal("Could not find 'New' button on Welcome Page") test.fatal("Could not find 'New' button on Welcome Page")
return [] return []
mouseClick(wsButtonLabel) mouseClick(wsButtonLabel)
elif isProject:
invokeMenuItem("File", "New Project...")
else: else:
invokeMenuItem("File", "New File or Project...") invokeMenuItem("File", "New File...")
categoriesView = waitForObject(":New.templateCategoryView_QTreeView") categoriesView = waitForObject(":New.templateCategoryView_QTreeView")
if isProject: if isProject:
mouseClick(waitForObjectItem(categoriesView, "Projects." + category)) mouseClick(waitForObjectItem(categoriesView, "Projects." + category))

View File

@@ -69,7 +69,7 @@ def main():
clickButton(waitForObject("{text='Yes' type='QPushButton' window=%s}" % mBox)) clickButton(waitForObject("{text='Yes' type='QPushButton' window=%s}" % mBox))
else: else:
# modify the current and the former file after AUT had lost focus and use 'Yes to All' # modify the current and the former file after AUT had lost focus and use 'Yes to All'
invokeMenuItem("File", "New File or Project...") invokeMenuItem("File", "New Project...")
modifyExternally(currentFile) modifyExternally(currentFile)
modifyExternally(files[i - 1]) modifyExternally(files[i - 1])
# clicking Cancel does not work when running inside Squish - mBox would not come up # clicking Cancel does not work when running inside Squish - mBox would not come up

View File

@@ -39,7 +39,7 @@ def main():
kits = getConfiguredKits() kits = getConfiguredKits()
test.log("Collecting potential project types...") test.log("Collecting potential project types...")
availableProjectTypes = [] availableProjectTypes = []
invokeMenuItem("File", "New File or Project...") invokeMenuItem("File", "New Project...")
categoriesView = waitForObject(":New.templateCategoryView_QTreeView") categoriesView = waitForObject(":New.templateCategoryView_QTreeView")
catModel = categoriesView.model() catModel = categoriesView.model()
projects = catModel.index(0, 0) projects = catModel.index(0, 0)
@@ -146,7 +146,7 @@ def __createProject__(category, template):
except: except:
return "" return ""
invokeMenuItem("File", "New File or Project...") invokeMenuItem("File", "New Project...")
selectFromCombo(waitForObject(":New.comboBox_QComboBox"), "All Templates") selectFromCombo(waitForObject(":New.comboBox_QComboBox"), "All Templates")
categoriesView = waitForObject(":New.templateCategoryView_QTreeView") categoriesView = waitForObject(":New.templateCategoryView_QTreeView")
mouseClick(waitForObjectItem(categoriesView, "Projects." + category)) mouseClick(waitForObjectItem(categoriesView, "Projects." + category))