diff --git a/tests/system/shared/classes.py b/tests/system/shared/classes.py index b1f86d9f881a5d4e2a7dc764cdd749cfec1afa8d..a4dc009fa4aa3200f9ae3f3a16280da198b03796 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 19cfe956fb074e68a6345c3a424b6b1a35918ff5..ee2f05cdb8701db59a64c793cd0c5df04509d192 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 2a33ad9c6c47fed906d2317474d003220bde8517..17c0e30ad61ecba9c68bfc4eee32ebfc6d0e6254 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 535468ac80262b1dcef61b410c839efcc1cb99f9..d3782bcd8b048ac8056124ee49f63041c757f562 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 ba66e594d01e88dab81551a7b8d3f144f152833c..f64e978bc4f267f81be7b8270b38f4b7f2def0f9 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 645a1b48defee00bc066c05c3e3b88fbec3ba16d..ce4397192afc24488f1e6720273216ea4aa0bf97 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)