summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Stenger <christian.stenger@digia.com>2014-02-14 13:04:07 +0100
committerChristian Stenger <christian.stenger@digia.com>2014-02-19 14:38:55 +0100
commitae781b191975c7653cc1886087ceb3ee52db1a1c (patch)
treed4e5988cdacff10534201865ae7be1fca66ca393
parentfb0bc00670a7fd33ec4ed1cf905a59430b153b22 (diff)
downloadqt-creator-ae781b191975c7653cc1886087ceb3ee52db1a1c.tar.gz
Squish: Update Qt Quick tests to reflect new available versions
Change-Id: I60d4b2ca64825101358774a4e04cceb3040fc630 Reviewed-by: Robert Loehning <robert.loehning@digia.com>
-rw-r--r--tests/system/shared/classes.py6
-rw-r--r--tests/system/shared/hook_utils.py4
-rw-r--r--tests/system/shared/project.py30
-rw-r--r--tests/system/suite_general/tst_create_proj_wizard/test.py2
-rw-r--r--tests/system/suite_qtquick/tst_qtquick_creation/test.py7
-rw-r--r--tests/system/suite_qtquick/tst_qtquick_creation3/test.py4
6 files changed, 29 insertions, 24 deletions
diff --git a/tests/system/shared/classes.py b/tests/system/shared/classes.py
index b1f86d9f88..a4dc009fa4 100644
--- a/tests/system/shared/classes.py
+++ b/tests/system/shared/classes.py
@@ -136,13 +136,13 @@ class SubprocessType:
USER_DEFINED=3
@staticmethod
- def getWindowType(subprocessType, qtQuickVersion=1):
+ def getWindowType(subprocessType, qtQuickVersion="1.1"):
if subprocessType == SubprocessType.QT_WIDGET:
return "QMainWindow"
if subprocessType == SubprocessType.QT_QUICK_APPLICATION:
- return "QtQuick%dApplicationViewer" % qtQuickVersion
+ return "QtQuick%sApplicationViewer" % qtQuickVersion[0]
if subprocessType == SubprocessType.QT_QUICK_UI:
- if qtQuickVersion == 1:
+ if qtQuickVersion == "1.1":
return "QDeclarativeViewer"
else:
return "QQuickView"
diff --git a/tests/system/shared/hook_utils.py b/tests/system/shared/hook_utils.py
index 19cfe956fb..ee2f05cdb8 100644
--- a/tests/system/shared/hook_utils.py
+++ b/tests/system/shared/hook_utils.py
@@ -90,7 +90,7 @@ def batchEditRunEnvironment(kitCount, currentTarget, modifications, alreadyOnRun
clickButton(waitForObject("{text='OK' type='QPushButton' unnamed='1' visible='1' "
"window=':Edit Environment_ProjectExplorer::EnvironmentItemsDialog'}"))
-def modifyRunSettingsForHookIntoQtQuickUI(kitCount, workingDir, projectName, port, quickVersion=1):
+def modifyRunSettingsForHookIntoQtQuickUI(kitCount, workingDir, projectName, port, quickVersion="1.1"):
switchViewTo(ViewConstants.PROJECTS)
switchToBuildOrRunSettingsFor(kitCount, 0, ProjectSettings.RUN, True)
@@ -107,7 +107,7 @@ def modifyRunSettingsForHookIntoQtQuickUI(kitCount, workingDir, projectName, por
"Using fallback of pushing STOP inside Creator.")
return None
test.log("Using (QtVersion/mkspec) %s/%s with SquishPath %s" % (qtVersion, mkspec, squishPath))
- if quickVersion == 1:
+ if quickVersion == "1.1":
if platform.system() == "Darwin":
executable = os.path.abspath(os.path.dirname(qmake) + "/QMLViewer.app")
else:
diff --git a/tests/system/shared/project.py b/tests/system/shared/project.py
index 2a33ad9c6c..17c0e30ad6 100644
--- a/tests/system/shared/project.py
+++ b/tests/system/shared/project.py
@@ -129,19 +129,23 @@ def __createProjectSetNameAndPath__(path, projectName = None, checks = True):
clickButton(waitForObject(":Next_QPushButton"))
return str(projectName)
-def __createProjectHandleQtQuickSelection__(qtQuickVersion, withControls):
+def __createProjectHandleQtQuickSelection__(qtQuickVersion, controlsVersion):
comboBox = waitForObject("{type='QComboBox' unnamed='1' visible='1' "
"leftWidget={text='Qt Quick component set:' type='QLabel' unnamed='1' "
"visible='1'}}")
- if qtQuickVersion == 1:
+ if qtQuickVersion == "1.1":
selectFromCombo(comboBox, "Qt Quick 1.1")
- if withControls:
+ if controlsVersion:
test.warning("Controls are not available for Quick 1.")
- elif qtQuickVersion == 2:
- if withControls:
- selectFromCombo(comboBox, "Qt Quick Controls 1.0")
+ elif qtQuickVersion[:2] == "2.":
+ if controlsVersion:
+ if controlsVersion in ("1.0", "1.1"):
+ selectFromCombo(comboBox, "Qt Quick Controls %s" % controlsVersion)
+ else:
+ test.fatal("Got unknown Qt Quick Controls version: %s - trying to continue."
+ % str(controlsVersion))
else:
- selectFromCombo(comboBox, "Qt Quick 2.0")
+ selectFromCombo(comboBox, "Qt Quick %s" % qtQuickVersion)
else:
test.fatal("Got unknown Qt Quick version: %s - trying to continue." % str(qtQuickVersion))
label = waitForObject("{type='QLabel' unnamed='1' visible='1' text?='Creates a *' }")
@@ -269,11 +273,11 @@ def createProject_Qt_Console(path, projectName, checks = True):
return checkedTargets
def createNewQtQuickApplication(workingDir, projectName = None,
- targets=Targets.desktopTargetClasses(), qtQuickVersion=1,
- fromWelcome=False, withControls=False):
+ targets=Targets.desktopTargetClasses(), qtQuickVersion="1.1",
+ fromWelcome=False, controlsVersion=None):
available = __createProjectOrFileSelectType__(" Applications", "Qt Quick Application", fromWelcome)
projectName = __createProjectSetNameAndPath__(workingDir, projectName)
- requiredQt = __createProjectHandleQtQuickSelection__(qtQuickVersion, withControls)
+ requiredQt = __createProjectHandleQtQuickSelection__(qtQuickVersion, controlsVersion)
__modifyAvailableTargets__(available, requiredQt)
checkedTargets = __chooseTargets__(targets, available)
snooze(1)
@@ -283,12 +287,12 @@ def createNewQtQuickApplication(workingDir, projectName = None,
progressBarWait(10000)
return checkedTargets, projectName
-def createNewQtQuickUI(workingDir, qtQuickVersion=1, withControls=False):
+def createNewQtQuickUI(workingDir, qtQuickVersion="1.1", controlsVersion=None):
__createProjectOrFileSelectType__(" Applications", "Qt Quick UI")
if workingDir == None:
workingDir = tempDir()
projectName = __createProjectSetNameAndPath__(workingDir)
- __createProjectHandleQtQuickSelection__(qtQuickVersion, withControls)
+ __createProjectHandleQtQuickSelection__(qtQuickVersion, controlsVersion)
__createProjectHandleLastPage__()
return projectName
@@ -399,7 +403,7 @@ def waitForProcessRunning(running=True):
# by yourself (or use the function parameter)
# ATTENTION! Make sure this function won't fail and the sub-process will end when the function returns
# returns None if the build failed, False if the subprocess did not start, and True otherwise
-def runAndCloseApp(withHookInto=False, executable=None, port=None, function=None, sType=None, userDefinedType=None, quickVersion=1):
+def runAndCloseApp(withHookInto=False, executable=None, port=None, function=None, sType=None, userDefinedType=None, quickVersion="1.1"):
runButton = waitForObject(":*Qt Creator.Run_Core::Internal::FancyToolButton")
clickButton(runButton)
if sType != SubprocessType.QT_QUICK_UI:
diff --git a/tests/system/suite_general/tst_create_proj_wizard/test.py b/tests/system/suite_general/tst_create_proj_wizard/test.py
index 535468ac80..d3782bcd8b 100644
--- a/tests/system/suite_general/tst_create_proj_wizard/test.py
+++ b/tests/system/suite_general/tst_create_proj_wizard/test.py
@@ -33,7 +33,7 @@ import re
def main():
global tmpSettingsDir
- quickCombinations = [[1,False], [2,False], [2,True]]
+ quickCombinations = [["1.1",None], ["2.1",None], ["2.2",None], ["2.1","1.0"], ["2.2","1.1"]]
startApplication("qtcreator" + SettingsPath)
if not startedWithoutPluginError():
return
diff --git a/tests/system/suite_qtquick/tst_qtquick_creation/test.py b/tests/system/suite_qtquick/tst_qtquick_creation/test.py
index ba66e594d0..f64e978bc4 100644
--- a/tests/system/suite_qtquick/tst_qtquick_creation/test.py
+++ b/tests/system/suite_qtquick/tst_qtquick_creation/test.py
@@ -33,12 +33,13 @@ def main():
startApplication("qtcreator" + SettingsPath)
if not startedWithoutPluginError():
return
- for targ, qVer in {Targets.DESKTOP_480_GCC:1, Targets.DESKTOP_501_DEFAULT:2}.items():
+ # TODO provide Qt5.2/Qt5.1 to enable QtQuick2 testing
+ for targ, qVer in {Targets.DESKTOP_480_GCC:"1.1"}.items(): # Targets.DESKTOP_501_DEFAULT:2}.items():
# using a temporary directory won't mess up a potentially existing
workingDir = tempDir()
checkedTargets, projectName = createNewQtQuickApplication(workingDir, targets=targ,
qtQuickVersion=qVer)
- test.log("Building project Qt Quick %d Application (%s)"
+ test.log("Building project Qt Quick %s Application (%s)"
% (qVer, Targets.getStringForTarget(targ)))
result = modifyRunSettingsForHookInto(projectName, len(checkedTargets), 11223)
invokeMenuItem("Build", "Build All")
@@ -53,7 +54,7 @@ def main():
allowAppThroughWinFW(workingDir, projectName)
if result:
result = runAndCloseApp(True, projectName, 11223,
- "subprocessFunctionQuick%d" % qVer,
+ "subprocessFunctionQuick%s" % qVer[0],
SubprocessType.QT_QUICK_APPLICATION, quickVersion=qVer)
else:
result = runAndCloseApp(sType=SubprocessType.QT_QUICK_APPLICATION)
diff --git a/tests/system/suite_qtquick/tst_qtquick_creation3/test.py b/tests/system/suite_qtquick/tst_qtquick_creation3/test.py
index 645a1b48de..ce4397192a 100644
--- a/tests/system/suite_qtquick/tst_qtquick_creation3/test.py
+++ b/tests/system/suite_qtquick/tst_qtquick_creation3/test.py
@@ -33,11 +33,11 @@ def main():
startApplication("qtcreator" + SettingsPath)
if not startedWithoutPluginError():
return
- for quickVersion in [1, 2]:
+ for quickVersion in ["1.1"]:#, "2.1", "2.2"]: # TODO add Qt5.2 and/or Qt5.1 kit to enable these
# using a temporary directory won't mess up a potentially existing
workingDir = tempDir()
projectName = createNewQtQuickUI(workingDir, quickVersion)
- test.log("Running project Qt Quick %d UI" % quickVersion)
+ test.log("Running project Qt Quick %s UI" % quickVersion)
qmlViewer = modifyRunSettingsForHookIntoQtQuickUI(1, workingDir, projectName, 11223, quickVersion)
if qmlViewer!=None:
qmlViewerPath = os.path.dirname(qmlViewer)