Commit edad3217 authored by Robert Loehning's avatar Robert Loehning Committed by Robert Löhning

Squish: Added function which selects template for new project

Change-Id: I7858e60c21641e39f6a5c23a12e3fd78a9d17334
Reviewed-by: default avatarBill King <bill.king@nokia.com>
Reviewed-by: default avatarChristian Stenger <christian.stenger@nokia.com>
parent 702b3f17
......@@ -14,7 +14,6 @@
:CMake Wizard_CMakeProjectManager::Internal::CMakeOpenProjectWizard {type='CMakeProjectManager::Internal::CMakeOpenProjectWizard' unnamed='1' visible='1' windowTitle='CMake Wizard'}
:Desktop_QLabel {container=':QtCreator.MenuBar_ProjectExplorer::Internal::ProjectListWidget' name='target' text='Desktop' type='QLabel' visible='1'}
:Generator:_QComboBox {buddy=':CMake Wizard.Generator:_QLabel' type='QComboBox' unnamed='1' visible='1'}
:New.Choose..._QPushButton {text='Choose...' type='QPushButton' unnamed='1' visible='1' window=':New_Core::Internal::NewDialog'}
:New.templateCategoryView_QTreeView {name='templateCategoryView' type='QTreeView' visible='1' window=':New_Core::Internal::NewDialog'}
:New.templatesView_QListView {name='templatesView' type='QListView' visible='1' window=':New_Core::Internal::NewDialog'}
:New_Core::Internal::NewDialog {name='Core__Internal__NewDialog' type='Core::Internal::NewDialog' visible='1' windowTitle='New'}
......
......@@ -53,6 +53,14 @@ def shadowBuildDir(path, project, qtVersion, debugVersion):
else:
return buildDir + "_Release"
def __createProjectSelectType__(category, template):
invokeMenuItem("File", "New File or Project...")
categoriesView = waitForObject("{type='QTreeView' name='templateCategoryView'}", 20000)
clickItem(categoriesView, "Projects." + category, 5, 5, 0, Qt.LeftButton)
templatesView = waitForObject("{name='templatesView' type='QListView'}", 20000)
clickItem(templatesView, template, 5, 5, 0, Qt.LeftButton)
clickButton(waitForObject("{text='Choose...' type='QPushButton' unnamed='1' visible='1'}", 20000))
def createProjectSetNameAndPath(path, projectName = None, checks = True):
directoryEdit = waitForObject("{type='Utils::BaseValidatingLineEdit' unnamed='1' visible='1'}", 20000)
replaceEditorContent(directoryEdit, path)
......@@ -85,12 +93,7 @@ def createProjectHandleLastPage(expectedFiles = None):
clickButton(waitForObject("{type='QPushButton' text~='(Finish|Done)' visible='1'}", 20000))
def createProject_Qt_GUI(path, projectName, qtVersion, checks):
invokeMenuItem("File", "New File or Project...")
waitForObjectItem(":New.templateCategoryView_QTreeView", "Projects.Qt Widget Project")
clickItem(":New.templateCategoryView_QTreeView", "Projects.Qt Widget Project", 125, 16, 0, Qt.LeftButton)
waitForObjectItem(":New.templatesView_QListView", "Qt Gui Application")
clickItem(":New.templatesView_QListView", "Qt Gui Application", 35, 12, 0, Qt.LeftButton)
clickButton(waitForObject(":New.Choose..._QPushButton"))
__createProjectSelectType__("Qt Widget Project", "Qt Gui Application")
createProjectSetNameAndPath(path, projectName, checks)
desktopCheckbox = waitForObject(":scrollArea.Desktop_QCheckBox", 20000)
......@@ -145,10 +148,7 @@ def createProject_Qt_GUI(path, projectName, qtVersion, checks):
test.verify(os.path.exists(pro_path), "Checking if '" + pro_path + "' was created")
def createNewQtQuickApplication(workingDir, projectName = None, templateFile = None, targets = QtQuickConstants.Targets.DESKTOP):
invokeMenuItem("File", "New File or Project...")
clickItem(waitForObject("{type='QTreeView' name='templateCategoryView'}", 20000), "Projects.Qt Quick Project", 5, 5, 0, Qt.LeftButton)
clickItem(waitForObject("{name='templatesView' type='QListView'}", 20000), "Qt Quick Application", 5, 5, 0, Qt.LeftButton)
clickButton(waitForObject("{text='Choose...' type='QPushButton' unnamed='1' visible='1'}", 20000))
__createProjectSelectType__("Qt Quick Project", "Qt Quick Application")
projectName = createProjectSetNameAndPath(workingDir, projectName)
if (templateFile==None):
chooseComponents()
......@@ -165,20 +165,14 @@ def createNewQtQuickApplication(workingDir, projectName = None, templateFile = N
createProjectHandleLastPage()
def createNewQtQuickUI(workingDir):
invokeMenuItem("File", "New File or Project...")
clickItem(waitForObject("{type='QTreeView' name='templateCategoryView'}", 20000), "Projects.Qt Quick Project", 5, 5, 0, Qt.LeftButton)
clickItem(waitForObject("{name='templatesView' type='QListView'}", 20000), "Qt Quick UI", 5, 5, 0, Qt.LeftButton)
clickButton(waitForObject("{text='Choose...' type='QPushButton' unnamed='1' visible='1'}", 20000))
__createProjectSelectType__("Qt Quick Project", "Qt Quick UI")
if workingDir == None:
workingDir = tempDir()
createProjectSetNameAndPath(workingDir)
createProjectHandleLastPage()
def createNewQmlExtension(workingDir):
invokeMenuItem("File", "New File or Project...")
clickItem(waitForObject("{type='QTreeView' name='templateCategoryView'}", 20000), "Projects.Qt Quick Project", 5, 5, 0, Qt.LeftButton)
clickItem(waitForObject("{name='templatesView' type='QListView'}", 20000), "Custom QML Extension Plugin", 5, 5, 0, Qt.LeftButton)
clickButton(waitForObject("{text='Choose...' type='QPushButton' unnamed='1' visible='1'}", 20000))
__createProjectSelectType__("Qt Quick Project", "Custom QML Extension Plugin")
if workingDir == None:
workingDir = tempDir()
createProjectSetNameAndPath(workingDir)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment