forked from qt-creator/qt-creator
Squish: Moved remaining functions for creating projects to project.py
Change-Id: I92b56ed9401be41d0a54dd32c623b55b7d1e4f71 Reviewed-by: Christian Stenger <christian.stenger@nokia.com>
This commit is contained in:
committed by
Robert Löhning
parent
d723e19765
commit
584a8f016e
@@ -162,3 +162,55 @@ def createNewQtQuickApplication(workingDir, projectName = None, templateFile = N
|
|||||||
clickButton(nextButton)
|
clickButton(nextButton)
|
||||||
selectFromCombo(":addToVersionControlComboBox_QComboBox", "<None>")
|
selectFromCombo(":addToVersionControlComboBox_QComboBox", "<None>")
|
||||||
clickButton(waitForObject("{type='QPushButton' text~='(Finish|Done)' visible='1'}", 20000))
|
clickButton(waitForObject("{type='QPushButton' text~='(Finish|Done)' visible='1'}", 20000))
|
||||||
|
|
||||||
|
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))
|
||||||
|
baseLineEd = waitForObject("{type='Utils::BaseValidatingLineEdit' unnamed='1' visible='1'}", 20000)
|
||||||
|
if workingDir == None:
|
||||||
|
workingDir = tempDir()
|
||||||
|
replaceEditorContent(baseLineEd, workingDir)
|
||||||
|
stateLabel = findObject("{type='QLabel' name='stateLabel'}")
|
||||||
|
labelCheck = stateLabel.text=="" and stateLabel.styleSheet == ""
|
||||||
|
test.verify(labelCheck, "Project name and base directory without warning or error")
|
||||||
|
# make sure this is not set as default location
|
||||||
|
cbDefaultLocation = waitForObject("{type='QCheckBox' name='projectsDirectoryCheckBox' visible='1'}", 20000)
|
||||||
|
if cbDefaultLocation.checked:
|
||||||
|
clickButton(cbDefaultLocation)
|
||||||
|
# now there's the 'untitled' project inside a temporary directory - step forward...!
|
||||||
|
clickButton(waitForObject("{text~='(Next.*|Continue)' type='QPushButton' visible='1'}", 20000))
|
||||||
|
selectFromCombo(":addToVersionControlComboBox_QComboBox", "<None>")
|
||||||
|
clickButton(waitForObject("{type='QPushButton' text~='(Finish|Done)' visible='1'}", 20000))
|
||||||
|
|
||||||
|
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))
|
||||||
|
baseLineEd = waitForObject("{type='Utils::BaseValidatingLineEdit' unnamed='1' visible='1'}", 20000)
|
||||||
|
if workingDir == None:
|
||||||
|
workingDir = tempDir()
|
||||||
|
replaceEditorContent(baseLineEd, workingDir)
|
||||||
|
stateLabel = findObject("{type='QLabel' name='stateLabel'}")
|
||||||
|
labelCheck = stateLabel.text=="" and stateLabel.styleSheet == ""
|
||||||
|
test.verify(labelCheck, "Project name and base directory without warning or error")
|
||||||
|
# make sure this is not set as default location
|
||||||
|
cbDefaultLocation = waitForObject("{type='QCheckBox' name='projectsDirectoryCheckBox' visible='1'}", 20000)
|
||||||
|
if cbDefaultLocation.checked:
|
||||||
|
clickButton(cbDefaultLocation)
|
||||||
|
# now there's the 'untitled' project inside a temporary directory - step forward...!
|
||||||
|
nextButton = waitForObject("{text~='(Next.*|Continue)' type='QPushButton' visible='1'}", 20000)
|
||||||
|
clickButton(nextButton)
|
||||||
|
chooseTargets()
|
||||||
|
clickButton(nextButton)
|
||||||
|
nameLineEd = waitForObject("{buddy={type='QLabel' text='Object Class-name:' unnamed='1' visible='1'} "
|
||||||
|
"type='QLineEdit' unnamed='1' visible='1'}", 20000)
|
||||||
|
replaceEditorContent(nameLineEd, "TestItem")
|
||||||
|
uriLineEd = waitForObject("{buddy={type='QLabel' text='URI:' unnamed='1' visible='1'} "
|
||||||
|
"type='QLineEdit' unnamed='1' visible='1'}", 20000)
|
||||||
|
replaceEditorContent(uriLineEd, "com.nokia.test.qmlcomponents")
|
||||||
|
clickButton(nextButton)
|
||||||
|
selectFromCombo(":addToVersionControlComboBox_QComboBox", "<None>")
|
||||||
|
clickButton(waitForObject("{type='QPushButton' text~='(Finish|Done)' visible='1'}", 20000))
|
||||||
|
@@ -7,32 +7,12 @@ def main():
|
|||||||
startApplication("qtcreator" + SettingsPath)
|
startApplication("qtcreator" + SettingsPath)
|
||||||
# using a temporary directory won't mess up an eventually exisiting
|
# using a temporary directory won't mess up an eventually exisiting
|
||||||
workingDir = tempDir()
|
workingDir = tempDir()
|
||||||
createNewQtQuickUI()
|
createNewQtQuickUI(workingDir)
|
||||||
test.log("Running project")
|
test.log("Running project")
|
||||||
if runAndCloseQtQuickUI():
|
if runAndCloseQtQuickUI():
|
||||||
logApplicationOutput()
|
logApplicationOutput()
|
||||||
invokeMenuItem("File", "Exit")
|
invokeMenuItem("File", "Exit")
|
||||||
|
|
||||||
def createNewQtQuickUI():
|
|
||||||
global 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))
|
|
||||||
baseLineEd = waitForObject("{type='Utils::BaseValidatingLineEdit' unnamed='1' visible='1'}", 20000)
|
|
||||||
replaceEditorContent(baseLineEd, workingDir)
|
|
||||||
stateLabel = findObject("{type='QLabel' name='stateLabel'}")
|
|
||||||
labelCheck = stateLabel.text=="" and stateLabel.styleSheet == ""
|
|
||||||
test.verify(labelCheck, "Project name and base directory without warning or error")
|
|
||||||
# make sure this is not set as default location
|
|
||||||
cbDefaultLocation = waitForObject("{type='QCheckBox' name='projectsDirectoryCheckBox' visible='1'}", 20000)
|
|
||||||
if cbDefaultLocation.checked:
|
|
||||||
clickButton(cbDefaultLocation)
|
|
||||||
# now there's the 'untitled' project inside a temporary directory - step forward...!
|
|
||||||
clickButton(waitForObject("{text~='(Next.*|Continue)' type='QPushButton' visible='1'}", 20000))
|
|
||||||
selectFromCombo(":addToVersionControlComboBox_QComboBox", "<None>")
|
|
||||||
clickButton(waitForObject("{type='QPushButton' text~='(Finish|Done)' visible='1'}", 20000))
|
|
||||||
|
|
||||||
def cleanup():
|
def cleanup():
|
||||||
global workingDir
|
global workingDir
|
||||||
# waiting for a clean exit - for a full-remove of the temp directory
|
# waiting for a clean exit - for a full-remove of the temp directory
|
||||||
|
@@ -7,7 +7,7 @@ def main():
|
|||||||
startApplication("qtcreator" + SettingsPath)
|
startApplication("qtcreator" + SettingsPath)
|
||||||
# using a temporary directory won't mess up an eventually exisiting
|
# using a temporary directory won't mess up an eventually exisiting
|
||||||
workingDir = tempDir()
|
workingDir = tempDir()
|
||||||
createNewQmlExtension()
|
createNewQmlExtension(workingDir)
|
||||||
# wait for parsing to complete
|
# wait for parsing to complete
|
||||||
waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)", 30000)
|
waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)", 30000)
|
||||||
test.log("Building project")
|
test.log("Building project")
|
||||||
@@ -17,36 +17,6 @@ def main():
|
|||||||
checkLastBuild()
|
checkLastBuild()
|
||||||
invokeMenuItem("File", "Exit")
|
invokeMenuItem("File", "Exit")
|
||||||
|
|
||||||
def createNewQmlExtension():
|
|
||||||
global 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))
|
|
||||||
baseLineEd = waitForObject("{type='Utils::BaseValidatingLineEdit' unnamed='1' visible='1'}", 20000)
|
|
||||||
replaceEditorContent(baseLineEd, workingDir)
|
|
||||||
stateLabel = findObject("{type='QLabel' name='stateLabel'}")
|
|
||||||
labelCheck = stateLabel.text=="" and stateLabel.styleSheet == ""
|
|
||||||
test.verify(labelCheck, "Project name and base directory without warning or error")
|
|
||||||
# make sure this is not set as default location
|
|
||||||
cbDefaultLocation = waitForObject("{type='QCheckBox' name='projectsDirectoryCheckBox' visible='1'}", 20000)
|
|
||||||
if cbDefaultLocation.checked:
|
|
||||||
clickButton(cbDefaultLocation)
|
|
||||||
# now there's the 'untitled' project inside a temporary directory - step forward...!
|
|
||||||
nextButton = waitForObject("{text~='(Next.*|Continue)' type='QPushButton' visible='1'}", 20000)
|
|
||||||
clickButton(nextButton)
|
|
||||||
chooseTargets()
|
|
||||||
clickButton(nextButton)
|
|
||||||
nameLineEd = waitForObject("{buddy={type='QLabel' text='Object Class-name:' unnamed='1' visible='1'} "
|
|
||||||
"type='QLineEdit' unnamed='1' visible='1'}", 20000)
|
|
||||||
replaceEditorContent(nameLineEd, "TestItem")
|
|
||||||
uriLineEd = waitForObject("{buddy={type='QLabel' text='URI:' unnamed='1' visible='1'} "
|
|
||||||
"type='QLineEdit' unnamed='1' visible='1'}", 20000)
|
|
||||||
replaceEditorContent(uriLineEd, "com.nokia.test.qmlcomponents")
|
|
||||||
clickButton(nextButton)
|
|
||||||
selectFromCombo(":addToVersionControlComboBox_QComboBox", "<None>")
|
|
||||||
clickButton(waitForObject("{type='QPushButton' text~='(Finish|Done)' visible='1'}", 20000))
|
|
||||||
|
|
||||||
def cleanup():
|
def cleanup():
|
||||||
global workingDir
|
global workingDir
|
||||||
# waiting for a clean exit - for a full-remove of the temp directory
|
# waiting for a clean exit - for a full-remove of the temp directory
|
||||||
|
Reference in New Issue
Block a user