2011-09-06 09:12:15 +02:00
|
|
|
source("../../shared/qtcreator.py")
|
|
|
|
|
|
|
|
|
|
workingDir = None
|
|
|
|
|
|
|
|
|
|
def main():
|
2011-09-21 13:55:23 +02:00
|
|
|
global workingDir
|
2011-09-06 09:12:15 +02:00
|
|
|
startApplication("qtcreator" + SettingsPath)
|
|
|
|
|
# using a temporary directory won't mess up an eventually exisiting
|
|
|
|
|
workingDir = tempDir()
|
|
|
|
|
createNewQtQuickUI()
|
|
|
|
|
test.log("Running project")
|
|
|
|
|
if runAndCloseQtQuickUI():
|
|
|
|
|
logApplicationOutput()
|
|
|
|
|
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)
|
2011-09-26 15:24:49 +02:00
|
|
|
replaceEditorContent(baseLineEd, workingDir)
|
2011-09-06 09:12:15 +02:00
|
|
|
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...!
|
2011-10-05 14:59:12 +02:00
|
|
|
clickButton(waitForObject("{text~='(Next.*|Continue)' type='QPushButton' visible='1'}", 20000))
|
2011-10-10 13:10:34 +02:00
|
|
|
selectFromCombo(":addToVersionControlComboBox_QComboBox", "<None>")
|
2011-10-05 14:59:12 +02:00
|
|
|
clickButton(waitForObject("{type='QPushButton' text~='(Finish|Done)' visible='1'}", 20000))
|
2011-09-06 09:12:15 +02:00
|
|
|
|
|
|
|
|
def cleanup():
|
|
|
|
|
global workingDir
|
|
|
|
|
# waiting for a clean exit - for a full-remove of the temp directory
|
2011-09-21 17:29:18 +02:00
|
|
|
waitForCleanShutdown()
|
2011-09-06 09:12:15 +02:00
|
|
|
if workingDir!=None:
|
|
|
|
|
deleteDirIfExists(workingDir)
|
|
|
|
|
|