summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Kerekes <jan.kerekes@ixonos.com>2012-05-10 12:46:43 +0200
committerRobert Löhning <robert.loehning@nokia.com>2012-05-31 13:22:37 +0200
commit20afae749d1838f6b38badb26821ffea3981dc81 (patch)
treeec807e73fc1be64f2b42d574f0a179e624ec3ab5
parent6026a4a51c04d589ae73b0204c2db54e7d0ff0c0 (diff)
downloadqt-creator-20afae749d1838f6b38badb26821ffea3981dc81.tar.gz
Squish: Added new test cases/suite for project templates
initial commit Change-Id: I0000bc8d3d0304ac37b135ea7b9c893b1054c958 Reviewed-by: Christian Stenger <christian.stenger@nokia.com> Reviewed-by: Robert Löhning <robert.loehning@nokia.com>
-rw-r--r--tests/system/shared/utils.py2
-rw-r--r--tests/system/suite_APTW/envvars1
-rw-r--r--tests/system/suite_APTW/objects.map24
-rwxr-xr-xtests/system/suite_APTW/shared/aptw.py29
-rw-r--r--tests/system/suite_APTW/suite.conf10
-rw-r--r--tests/system/suite_APTW/tst_APTW01/test.py13
-rw-r--r--tests/system/suite_APTW/tst_APTW02/test.py14
7 files changed, 93 insertions, 0 deletions
diff --git a/tests/system/shared/utils.py b/tests/system/shared/utils.py
index 7e6ba8eb0d..3a13e4269c 100644
--- a/tests/system/shared/utils.py
+++ b/tests/system/shared/utils.py
@@ -198,8 +198,10 @@ def logApplicationOutput():
try:
output = waitForObject("{type='Core::OutputWindow' visible='1' windowTitle='Application Output Window'}", 20000)
test.log("Application Output:\n%s" % output.plainText)
+ return str(output.plainText)
except:
test.fail("Could not find any Application Output - did the project run?")
+ return None
# get the output from a given cmdline call
def getOutputFromCmdline(cmdline):
diff --git a/tests/system/suite_APTW/envvars b/tests/system/suite_APTW/envvars
new file mode 100644
index 0000000000..00aad3eab7
--- /dev/null
+++ b/tests/system/suite_APTW/envvars
@@ -0,0 +1 @@
+QT_PLATFORM_PLUGIN=nonesuch
diff --git a/tests/system/suite_APTW/objects.map b/tests/system/suite_APTW/objects.map
new file mode 100644
index 0000000000..4ea1ec9a5c
--- /dev/null
+++ b/tests/system/suite_APTW/objects.map
@@ -0,0 +1,24 @@
+:*Qt Creator.Clear_QToolButton {text='Clear' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
+:Next_QPushButton {text~='(Next.*|Continue)' type='QPushButton' visible='1'}
+:Options.OK_QPushButton {text='OK' type='QPushButton' unnamed='1' visible='1' window=':Options_Core::Internal::SettingsDialog'}
+:Qt Creator.Compile Output_Core::OutputWindow {type='Core::OutputWindow' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow' windowTitle='Compile Output'}
+: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.scrollArea_QScrollArea {name='scrollArea' type='QScrollArea' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
+:Qt Creator_AppOutput_Core::Internal::OutputPaneToggleButton {occurrence='3' type='Core::Internal::OutputPaneToggleButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
+:Qt Creator_Core::Internal::MainWindow {type='Core::Internal::MainWindow' unnamed='1' visible='1' windowTitle?='*Qt Creator'}
+: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.Source file:_QLabel {name='sourceLabel' text='Source file:' type='QLabel' 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'}
+:addToVersionControlComboBox_QComboBox {name='addToVersionControlComboBox' type='QComboBox' visible='1'}
+:formFileLineEdit_Utils::FileNameValidatingLineEdit {buddy=':Qt Gui Application.Form file:_QLabel' name='formFileLineEdit' type='Utils::FileNameValidatingLineEdit' visible='1'}
+:headerFileLineEdit_Utils::FileNameValidatingLineEdit {buddy=':Qt Gui Application.Header file:_QLabel' name='headerFileLineEdit' type='Utils::FileNameValidatingLineEdit' visible='1'}
+: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_2 {container=':Qt Gui Application.scrollArea_QScrollArea' text='Create build configurations:' type='QLabel' unnamed='1' visible='1'}
+:scrollArea.Edit build configuration:_QComboBox {container=':Qt Creator.scrollArea_QScrollArea' leftWidget=':scrollArea.Edit build configuration:_QLabel' type='QComboBox' unnamed='1' visible='1'}
+:scrollArea.Edit build configuration:_QLabel {container=':Qt Creator.scrollArea_QScrollArea' text='Edit build configuration:' type='QLabel' unnamed='1' visible='1'}
+:scrollArea.Use Shadow Building_QCheckBox {container=':Qt Gui Application.scrollArea_QScrollArea' text='Shadow build' type='QCheckBox' unnamed='1' visible='1'}
+:sourceFileLineEdit_Utils::FileNameValidatingLineEdit {buddy=':Qt Gui Application.Source file:_QLabel' name='sourceFileLineEdit' type='Utils::FileNameValidatingLineEdit' visible='1'}
diff --git a/tests/system/suite_APTW/shared/aptw.py b/tests/system/suite_APTW/shared/aptw.py
new file mode 100755
index 0000000000..eed8dd7e94
--- /dev/null
+++ b/tests/system/suite_APTW/shared/aptw.py
@@ -0,0 +1,29 @@
+# shared script for APTW suite
+# helping to run and close app
+# verification
+
+# verify if building and running of project was successful
+def verifyBuildAndRun():
+ # check compile output if build successful
+ checkCompile()
+ # check application output log
+ appOutput = logApplicationOutput()
+ if appOutput:
+ test.verify(re.search(".*([Pp]rogram).*(unexpectedly).*([Ff]inished).*", str(appOutput)) and
+ re.search('[Ss]tarting.*', str(appOutput)),
+ "Verifying if built app started and closed successfully.")
+
+# pick version 4.7.4 and then run project for debug and release
+def pickVersion474runVerify():
+ availableConfigs = iterateBuildConfigs(1, 0, ".*4.7.4.*")
+ if not availableConfigs:
+ test.fatal("Haven't found needed Qt version (Qt 4.7.4), quitting")
+ invokeMenuItem("File", "Save All")
+ invokeMenuItem("File", "Exit")
+ # select debug configuration
+ for config in availableConfigs:
+ selectBuildConfig(1, 0, config)
+ test.log("Using build config '%s'" % config)
+ runAndCloseApp()
+ verifyBuildAndRun()
+ mouseClick(waitForObject(":*Qt Creator.Clear_QToolButton"))
diff --git a/tests/system/suite_APTW/suite.conf b/tests/system/suite_APTW/suite.conf
new file mode 100644
index 0000000000..961a3700f6
--- /dev/null
+++ b/tests/system/suite_APTW/suite.conf
@@ -0,0 +1,10 @@
+AUT=qtcreator
+CLASS=
+CLASSPATH=
+ENVVARS=envvars
+HOOK_SUB_PROCESSES=false
+IMPLICITAUTSTART=0
+LANGUAGE=Python
+TEST_CASES=tst_APTW01 tst_APTW02
+VERSION=2
+WRAPPERS=Qt
diff --git a/tests/system/suite_APTW/tst_APTW01/test.py b/tests/system/suite_APTW/tst_APTW01/test.py
new file mode 100644
index 0000000000..f569699e31
--- /dev/null
+++ b/tests/system/suite_APTW/tst_APTW01/test.py
@@ -0,0 +1,13 @@
+source("../../shared/qtcreator.py")
+source("../../shared/suites_qtta.py")
+source("../shared/aptw.py")
+
+# test New Qt Gui Application build and run for release and debug option
+def main():
+ startApplication("qtcreator" + SettingsPath)
+ createProject_Qt_GUI(tempDir(), "SampleApp")
+ # pick version 4.7.4 and then run project for debug and release and verify results
+ pickVersion474runVerify()
+ #close Qt creator
+ invokeMenuItem("File", "Exit")
+#no cleanup needed
diff --git a/tests/system/suite_APTW/tst_APTW02/test.py b/tests/system/suite_APTW/tst_APTW02/test.py
new file mode 100644
index 0000000000..d9711ba590
--- /dev/null
+++ b/tests/system/suite_APTW/tst_APTW02/test.py
@@ -0,0 +1,14 @@
+source("../../shared/qtcreator.py")
+source("../../shared/suites_qtta.py")
+source("../shared/aptw.py")
+
+# test New Qt Quick Application build and run for release and debug option
+def main():
+ startApplication("qtcreator" + SettingsPath)
+ createNewQtQuickApplication(tempDir(), "SampleApp")
+ waitForSignal("{type='CppTools::Internal::CppModelManager' unnamed='1'}", "sourceFilesRefreshed(QStringList)")
+ # pick version 4.7.4 and then run project for debug and release and verify results
+ pickVersion474runVerify()
+ #close Qt creator
+ invokeMenuItem("File", "Exit")
+#no cleanup needed