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

Squish: Let one function handle last page of all project wizards

Change-Id: I74e2c2f0c50a3131ad66fbde5e4a7fe004b7ebff
Reviewed-by: default avatarChristian Stenger <christian.stenger@nokia.com>
parent dbcd5715
...@@ -21,14 +21,13 @@ ...@@ -21,14 +21,13 @@
:Project Setup.scrollArea_QScrollArea {name='scrollArea' type='QScrollArea' visible='1' window=':Project Setup_Qt4ProjectManager::Internal::ProjectLoadWizard'} :Project Setup.scrollArea_QScrollArea {name='scrollArea' type='QScrollArea' visible='1' window=':Project Setup_Qt4ProjectManager::Internal::ProjectLoadWizard'}
:Project Setup_Qt4ProjectManager::Internal::ProjectLoadWizard {type='Qt4ProjectManager::Internal::ProjectLoadWizard' unnamed='1' visible='1' windowTitle='Project Setup'} :Project Setup_Qt4ProjectManager::Internal::ProjectLoadWizard {type='Qt4ProjectManager::Internal::ProjectLoadWizard' unnamed='1' visible='1' windowTitle='Project Setup'}
:Qt Creator.QtCreator.MenuBar_QMenuBar {name='QtCreator.MenuBar' type='QMenuBar' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator.QtCreator.MenuBar_QMenuBar {name='QtCreator.MenuBar' type='QMenuBar' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator.ReRun_QToolButton {toolTip='Re-run this run-configuration' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator.Stop_QToolButton {text='Stop' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator.Stop_QToolButton {text='Stop' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_Core::Internal::MainWindow {type='Core::Internal::MainWindow' visible='1' windowTitle?='*Qt Creator'} :Qt Creator_Core::Internal::MainWindow {type='Core::Internal::MainWindow' visible='1' windowTitle?='*Qt Creator'}
:Qt Creator_Core::Internal::OutputPaneToggleButton {occurrence='3' type='Core::Internal::OutputPaneToggleButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_Core::Internal::OutputPaneToggleButton {occurrence='3' type='Core::Internal::OutputPaneToggleButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_CppEditor::Internal::CPPEditorWidget {type='CppEditor::Internal::CPPEditorWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_CppEditor::Internal::CPPEditorWidget {type='CppEditor::Internal::CPPEditorWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator.ReRun_QToolButton {toolTip='Re-run this run-configuration' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_Utils::IconButton {occurrence='2' type='Utils::IconButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_Utils::IconButton {occurrence='2' type='Utils::IconButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_Utils::NavigationTreeView {type='Utils::NavigationTreeView' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_Utils::NavigationTreeView {type='Utils::NavigationTreeView' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Gui Application.Finish_QPushButton {text~='(Finish|Done)' type='QPushButton' unnamed='1' visible='1' window=':Qt Gui Application_Qt4ProjectManager::Internal::GuiAppWizardDialog'}
:Qt Gui Application.Form file:_QLabel {name='formLabel' text='Form file:' type='QLabel' visible='1' window=':Qt Gui Application_Qt4ProjectManager::Internal::GuiAppWizardDialog'} :Qt Gui Application.Form file:_QLabel {name='formLabel' text='Form file:' type='QLabel' visible='1' window=':Qt Gui Application_Qt4ProjectManager::Internal::GuiAppWizardDialog'}
: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.Header file:_QLabel {name='headerLabel' text='Header file:' type='QLabel' visible='1' window=':Qt Gui Application_Qt4ProjectManager::Internal::GuiAppWizardDialog'}
:Qt Gui Application.Next_QPushButton {name='__qt__passive_wizardbutton1' text~='(Next.*|Continue)' type='QPushButton' visible='1' window=':Qt Gui Application_Qt4ProjectManager::Internal::GuiAppWizardDialog'} :Qt Gui Application.Next_QPushButton {name='__qt__passive_wizardbutton1' text~='(Next.*|Continue)' type='QPushButton' visible='1' window=':Qt Gui Application_Qt4ProjectManager::Internal::GuiAppWizardDialog'}
......
...@@ -53,6 +53,17 @@ def shadowBuildDir(path, project, qtVersion, debugVersion): ...@@ -53,6 +53,17 @@ def shadowBuildDir(path, project, qtVersion, debugVersion):
else: else:
return buildDir + "_Release" return buildDir + "_Release"
def createProjectHandleLastPage(expectedFiles = None):
if expectedFiles != None:
summary = str(waitForObject(":scrollArea.Files to be added").text)
lastIndex = 0
for filename in expectedFiles:
index = summary.find(filename)
test.verify(index > lastIndex, "'" + filename + "' found at index " + str(index))
lastIndex = index
selectFromCombo(":addToVersionControlComboBox_QComboBox", "<None>")
clickButton(waitForObject("{type='QPushButton' text~='(Finish|Done)' visible='1'}", 20000))
def createProject_Qt_GUI(path, projectName, qtVersion, checks): def createProject_Qt_GUI(path, projectName, qtVersion, checks):
invokeMenuItem("File", "New File or Project...") invokeMenuItem("File", "New File or Project...")
waitForObjectItem(":New.templateCategoryView_QTreeView", "Projects.Qt Widget Project") waitForObjectItem(":New.templateCategoryView_QTreeView", "Projects.Qt Widget Project")
...@@ -97,23 +108,10 @@ def createProject_Qt_GUI(path, projectName, qtVersion, checks): ...@@ -97,23 +108,10 @@ def createProject_Qt_GUI(path, projectName, qtVersion, checks):
clickButton(verifyEnabled(":Qt Gui Application.Next_QPushButton")) clickButton(verifyEnabled(":Qt Gui Application.Next_QPushButton"))
expectedFiles = None
if checks: if checks:
summary = str(waitForObject(":scrollArea.Files to be added").text) expectedFiles = [os.path.join(path, projectName), cpp_file, h_file, ui_file, pro_file]
createProjectHandleLastPage(expectedFiles)
path_found = summary.find(os.path.join(path, projectName))
cpp_found = summary.find(cpp_file)
h_found = summary.find(h_file)
ui_found = summary.find(ui_file)
pro_found = summary.find(pro_file)
test.verify(path_found > 0, "'" + path + "' found at index " + str(path_found))
test.verify(cpp_found > path_found, "'" + cpp_file + "' found at index " + str(cpp_found))
test.verify(h_found > cpp_found, "'" + h_file + "' found at index " + str(h_found))
test.verify(ui_found > cpp_found, "'" + ui_file + "' found at index " + str(ui_found))
test.verify(pro_found > ui_found, "'" + pro_file + "' found at index " + str(pro_found))
selectFromCombo(":addToVersionControlComboBox_QComboBox", "<None>")
clickButton(waitForObject(":Qt Gui Application.Finish_QPushButton"))
if checks: if checks:
waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)", 20000) waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)", 20000)
...@@ -160,8 +158,7 @@ def createNewQtQuickApplication(workingDir, projectName = None, templateFile = N ...@@ -160,8 +158,7 @@ def createNewQtQuickApplication(workingDir, projectName = None, templateFile = N
chooseTargets(targets) chooseTargets(targets)
snooze(1) snooze(1)
clickButton(nextButton) clickButton(nextButton)
selectFromCombo(":addToVersionControlComboBox_QComboBox", "<None>") createProjectHandleLastPage()
clickButton(waitForObject("{type='QPushButton' text~='(Finish|Done)' visible='1'}", 20000))
def createNewQtQuickUI(workingDir): def createNewQtQuickUI(workingDir):
invokeMenuItem("File", "New File or Project...") invokeMenuItem("File", "New File or Project...")
...@@ -181,8 +178,7 @@ def createNewQtQuickUI(workingDir): ...@@ -181,8 +178,7 @@ def createNewQtQuickUI(workingDir):
clickButton(cbDefaultLocation) clickButton(cbDefaultLocation)
# now there's the 'untitled' project inside a temporary directory - step forward...! # now there's the 'untitled' project inside a temporary directory - step forward...!
clickButton(waitForObject("{text~='(Next.*|Continue)' type='QPushButton' visible='1'}", 20000)) clickButton(waitForObject("{text~='(Next.*|Continue)' type='QPushButton' visible='1'}", 20000))
selectFromCombo(":addToVersionControlComboBox_QComboBox", "<None>") createProjectHandleLastPage()
clickButton(waitForObject("{type='QPushButton' text~='(Finish|Done)' visible='1'}", 20000))
def createNewQmlExtension(workingDir): def createNewQmlExtension(workingDir):
invokeMenuItem("File", "New File or Project...") invokeMenuItem("File", "New File or Project...")
...@@ -212,5 +208,4 @@ def createNewQmlExtension(workingDir): ...@@ -212,5 +208,4 @@ def createNewQmlExtension(workingDir):
"type='QLineEdit' unnamed='1' visible='1'}", 20000) "type='QLineEdit' unnamed='1' visible='1'}", 20000)
replaceEditorContent(uriLineEd, "com.nokia.test.qmlcomponents") replaceEditorContent(uriLineEd, "com.nokia.test.qmlcomponents")
clickButton(nextButton) clickButton(nextButton)
selectFromCombo(":addToVersionControlComboBox_QComboBox", "<None>") createProjectHandleLastPage()
clickButton(waitForObject("{type='QPushButton' text~='(Finish|Done)' visible='1'}", 20000))
...@@ -5,7 +5,7 @@ project = "SquishProject" ...@@ -5,7 +5,7 @@ project = "SquishProject"
def main(): def main():
startApplication("qtcreator" + SettingsPath) startApplication("qtcreator" + SettingsPath)
createProject_Qt_GUI(projectsPath, project, defaultQtVersion, 1) createProject_Qt_GUI(projectsPath, project, defaultQtVersion, True)
clickButton(verifyEnabled(":*Qt Creator.Run_Core::Internal::FancyToolButton")) clickButton(verifyEnabled(":*Qt Creator.Run_Core::Internal::FancyToolButton"))
waitForSignal("{type='ProjectExplorer::BuildManager' unnamed='1'}", "buildQueueFinished(bool)") waitForSignal("{type='ProjectExplorer::BuildManager' unnamed='1'}", "buildQueueFinished(bool)")
playButton = verifyEnabled(":Qt Creator.ReRun_QToolButton", False) playButton = verifyEnabled(":Qt Creator.ReRun_QToolButton", False)
......
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