Commit 67644e6f authored by Robert Loehning's avatar Robert Loehning Committed by Robert Löhning
Browse files

Squish: Added function for creating new Console Application



Change-Id: Ia894d978ebb9b6add3e3ca55bc97054eef98214b
Reviewed-by: default avatarBill King <bill.king@nokia.com>
Reviewed-by: default avatarChristian Stenger <christian.stenger@nokia.com>
parent eef3d91e
......@@ -34,7 +34,7 @@
:Qt Gui Application.Header file:_QLabel {name='headerLabel' text='Header file:' type='QLabel' visible='1' window=':Qt Gui Application_Qt4ProjectManager::Internal::GuiAppWizardDialog'}
:Qt Gui Application.Source file:_QLabel {name='sourceLabel' text='Source file:' type='QLabel' visible='1' window=':Qt Gui Application_Qt4ProjectManager::Internal::GuiAppWizardDialog'}
:Qt Gui Application.frame_QFrame {name='frame' type='QFrame' visible='1' window=':Qt Gui Application_Qt4ProjectManager::Internal::GuiAppWizardDialog'}
:Qt Gui Application.scrollArea_QScrollArea {name='scrollArea' type='QScrollArea' visible='1' window=':Qt Gui Application_Qt4ProjectManager::Internal::GuiAppWizardDialog'}
:Qt Gui Application.scrollArea_QScrollArea {name='scrollArea' type='QScrollArea' visible='1'}
:Qt Gui Application_Qt4ProjectManager::Internal::GuiAppWizardDialog {type='Qt4ProjectManager::Internal::GuiAppWizardDialog' unnamed='1' visible='1' windowTitle='Qt Gui Application'}
:QtCreator.MenuBar_ProjectExplorer::Internal::MiniProjectTargetSelector {type='ProjectExplorer::Internal::MiniProjectTargetSelector'}
:addToVersionControlComboBox_QComboBox {name='addToVersionControlComboBox' type='QComboBox' visible='1'}
......@@ -46,8 +46,6 @@
:scrollArea.Create Build Configurations:_QComboBox_2 {container=':Qt Gui Application.scrollArea_QScrollArea' leftWidget=':scrollArea.Create Build Configurations:_QLabel_2' type='QComboBox' unnamed='1' visible='1'}
:scrollArea.Create Build Configurations:_QLabel {container=':Project Setup.scrollArea_QScrollArea' text='Create Build Configurations:' type='QLabel' unnamed='1' visible='1'}
:scrollArea.Create Build Configurations:_QLabel_2 {container=':Qt Gui Application.scrollArea_QScrollArea' text='Create Build Configurations:' type='QLabel' unnamed='1' visible='1'}
:scrollArea.Desktop_QCheckBox {container=':Qt Gui Application.scrollArea_QScrollArea' text='Desktop' type='QCheckBox' unnamed='1' visible='1'}
:scrollArea.Files to be added {container=':Qt Gui Application.scrollArea_QScrollArea' name='filesLabel' text?='<qt>Files to be added in<pre>*</pre>' type='QLabel' visible='1'}
:scrollArea.Qt 4 for Desktop - (Qt SDK) debug_QCheckBox {container=':Qt Gui Application.scrollArea_QScrollArea' text?='*Qt 4.* for *(Qt SDK) debug' type='QCheckBox' unnamed='1' visible='1'}
:scrollArea.Qt 4 for Desktop - (Qt SDK) release_QCheckBox {container=':Qt Gui Application.scrollArea_QScrollArea' text?='*Qt 4.* for *(Qt SDK) release' type='QCheckBox' unnamed='1' visible='1'}
:scrollArea.Qt Version:_QComboBox {aboveWidget=':scrollArea.Use Shadow Building_QCheckBox' container=':Qt Gui Application.scrollArea_QScrollArea' leftWidget=':scrollArea.Qt Version:_QLabel' type='QComboBox' unnamed='1' visible='1'}
......
......@@ -90,9 +90,21 @@ def __createProjectSetNameAndPath__(path, projectName = None, checks = True):
clickButton(waitForObject(":Next_QPushButton"))
return str(projectName)
def __selectQtVersionDesktop__(qtVersion, checks):
__chooseTargets__()
selectFromCombo(":scrollArea.Create Build Configurations:_QComboBox_2",
"For One Qt Version One Debug And One Release")
ensureChecked(":scrollArea.Use Shadow Building_QCheckBox")
selectFromCombo(":scrollArea.Qt Version:_QComboBox", qtVersion)
if checks:
verifyChecked(":scrollArea.Qt 4 for Desktop - (Qt SDK) debug_QCheckBox")
verifyChecked(":scrollArea.Qt 4 for Desktop - (Qt SDK) release_QCheckBox")
clickButton(waitForObject(":Next_QPushButton"))
def __createProjectHandleLastPage__(expectedFiles = None):
if expectedFiles != None:
summary = str(waitForObject(":scrollArea.Files to be added").text)
summary = str(waitForObject("{name='filesLabel' text?='<qt>Files to be added in<pre>*</pre>'"
"type='QLabel' visible='1'}").text)
lastIndex = 0
for filename in expectedFiles:
index = summary.find(filename)
......@@ -101,19 +113,16 @@ def __createProjectHandleLastPage__(expectedFiles = None):
selectFromCombo(":addToVersionControlComboBox_QComboBox", "<None>")
clickButton(waitForObject("{type='QPushButton' text~='(Finish|Done)' visible='1'}", 20000))
def __verifyFileCreation__(path, expectedFiles):
for filename in expectedFiles:
if filename != path:
filename = os.path.join(path, filename)
test.verify(os.path.exists(filename), "Checking if '" + filename + "' was created")
def createProject_Qt_GUI(path, projectName, qtVersion, checks):
__createProjectSelectType__("Other Qt Project", "Qt Gui Application")
__createProjectSetNameAndPath__(path, projectName, checks)
__chooseTargets__()
selectFromCombo(":scrollArea.Create Build Configurations:_QComboBox_2", "For One Qt Version One Debug And One Release")
selectFromCombo(":scrollArea.Qt Version:_QComboBox", qtVersion)
if checks:
if platform.system() in ('Windows', 'Microsoft'):
path = os.path.abspath(path)
verifyChecked(":scrollArea.Qt 4 for Desktop - (Qt SDK) debug_QCheckBox")
verifyChecked(":scrollArea.Qt 4 for Desktop - (Qt SDK) release_QCheckBox")
nextButton = waitForObject(":Next_QPushButton")
clickButton(nextButton)
__selectQtVersionDesktop__(qtVersion, checks)
if checks:
exp_filename = "mainwindow"
......@@ -130,26 +139,36 @@ def createProject_Qt_GUI(path, projectName, qtVersion, checks):
test.compare(findObject(":sourceFileLineEdit_Utils::FileNameValidatingLineEdit").text, cpp_file)
test.compare(findObject(":formFileLineEdit_Utils::FileNameValidatingLineEdit").text, ui_file)
clickButton(nextButton)
clickButton(waitForObject(":Next_QPushButton"))
expectedFiles = None
if checks:
if platform.system() in ('Windows', 'Microsoft'):
path = os.path.abspath(path)
path = os.path.join(path, projectName)
expectedFiles = [path, cpp_file, h_file, ui_file, pro_file]
__createProjectHandleLastPage__(expectedFiles)
if checks:
waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)", 20000)
waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)", 20000)
__verifyFileCreation__(path, expectedFiles)
def createProject_Qt_Console(path, projectName, qtVersion, checks):
__createProjectSelectType__("Other Qt Project", "Qt Console Application")
__createProjectSetNameAndPath__(path, projectName, checks)
__selectQtVersionDesktop__(qtVersion, checks)
cpp_path = os.path.join(path, cpp_file)
h_path = os.path.join(path, h_file)
ui_path = os.path.join(path, ui_file)
pro_path = os.path.join(path, pro_file)
expectedFiles = None
if checks:
if platform.system() in ('Windows', 'Microsoft'):
path = os.path.abspath(path)
path = os.path.join(path, projectName)
cpp_file = "main.cpp"
pro_file = projectName + ".pro"
expectedFiles = [path, cpp_file, pro_file]
__createProjectHandleLastPage__(expectedFiles)
test.verify(os.path.exists(cpp_path), "Checking if '" + cpp_path + "' was created")
test.verify(os.path.exists(h_path), "Checking if '" + h_path + "' was created")
test.verify(os.path.exists(ui_path), "Checking if '" + ui_path + "' was created")
test.verify(os.path.exists(pro_path), "Checking if '" + pro_path + "' was created")
waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)", 10000)
__verifyFileCreation__(path, expectedFiles)
def createNewQtQuickApplication(workingDir, projectName = None, templateFile = None, targets = QtQuickConstants.Targets.DESKTOP):
__createProjectSelectType__("Qt Quick Project", "Qt Quick Application")
......
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