diff --git a/tests/system/shared/classes.py b/tests/system/shared/classes.py index e892d4698118318d1dbeedbfa9c7a238d1174513..35061df5c06d998c9a4058cd2bef54c8bed22a08 100644 --- a/tests/system/shared/classes.py +++ b/tests/system/shared/classes.py @@ -144,7 +144,10 @@ class SubprocessType: if subprocessType == SubprocessType.QT_WIDGET: return "QMainWindow" if subprocessType == SubprocessType.QT_QUICK_APPLICATION: - return "QtQuick%sApplicationViewer" % qtQuickVersion[0] + qqv = "2" + if qtQuickVersion[0] == "1": + qqv = "1" + return "QtQuick%sApplicationViewer" % qqv if subprocessType == SubprocessType.QT_QUICK_UI: if qtQuickVersion == "1.1": return "QDeclarativeViewer" diff --git a/tests/system/shared/project.py b/tests/system/shared/project.py index 8c11cd00241417eec9f6756a55ad9521ff68600d..835cc2ddbfbc8d45b744cb809b2a5c895bfe9cf3 100644 --- a/tests/system/shared/project.py +++ b/tests/system/shared/project.py @@ -133,25 +133,15 @@ def __createProjectSetNameAndPath__(path, projectName = None, checks = True, lib clickButton(waitForObject(":Next_QPushButton")) return str(projectName) -def __createProjectHandleQtQuickSelection__(qtQuickVersion, controlsVersion): +def __createProjectHandleQtQuickSelection__(qtQuickOrControlsVersion): comboBox = waitForObject("{type='QComboBox' unnamed='1' visible='1' " "leftWidget={text='Qt Quick component set:' type='QLabel' unnamed='1' " "visible='1'}}") - if qtQuickVersion == "1.1": - selectFromCombo(comboBox, "Qt Quick 1.1") - if controlsVersion: - test.warning("Controls are not available for Quick 1.") - 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 %s" % qtQuickVersion) - else: - test.fatal("Got unknown Qt Quick version: %s - trying to continue." % str(qtQuickVersion)) + try: + selectFromCombo(comboBox, "Qt Quick %s" % qtQuickOrControlsVersion) + except: + t,v = sys.exc_info()[:2] + test.fatal("Exception while trying to select Qt Quick version", "%s (%s)" % (str(t), str(v))) label = waitForObject("{type='QLabel' unnamed='1' visible='1' text?='Creates a *' }") requires = re.match(".*Requires Qt (\d\.\d).*", str(label.text)) if requires: @@ -285,10 +275,10 @@ def createProject_Qt_Console(path, projectName, checks = True): def createNewQtQuickApplication(workingDir, projectName = None, targets=Targets.desktopTargetClasses(), qtQuickVersion="1.1", - fromWelcome=False, controlsVersion=None): + fromWelcome=False): available = __createProjectOrFileSelectType__(" Applications", "Qt Quick Application", fromWelcome) projectName = __createProjectSetNameAndPath__(workingDir, projectName) - requiredQt = __createProjectHandleQtQuickSelection__(qtQuickVersion, controlsVersion) + requiredQt = __createProjectHandleQtQuickSelection__(qtQuickVersion) __modifyAvailableTargets__(available, requiredQt) checkedTargets = __chooseTargets__(targets, available) snooze(1) @@ -298,12 +288,12 @@ def createNewQtQuickApplication(workingDir, projectName = None, progressBarWait(10000) return checkedTargets, projectName -def createNewQtQuickUI(workingDir, qtQuickVersion="1.1", controlsVersion=None): +def createNewQtQuickUI(workingDir, qtQuickVersion="1.1"): __createProjectOrFileSelectType__(" Applications", "Qt Quick UI") if workingDir == None: workingDir = tempDir() projectName = __createProjectSetNameAndPath__(workingDir) - __createProjectHandleQtQuickSelection__(qtQuickVersion, controlsVersion) + __createProjectHandleQtQuickSelection__(qtQuickVersion) __createProjectHandleLastPage__() return projectName 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 d3782bcd8b048ac8056124ee49f63041c757f562..73e70c5a4d1611fb527e6855bb996e7af3e00a44 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.1",None], ["2.1",None], ["2.2",None], ["2.1","1.0"], ["2.2","1.1"]] + quickCombinations = ["1.1", "2.1", "2.2", "Controls 1.0", "Controls 1.1"] startApplication("qtcreator" + SettingsPath) if not startedWithoutPluginError(): return @@ -73,7 +73,7 @@ def main(): displayedPlatforms = __createProject__(category, template) if template == "Qt Quick Application": for counter, qComb in enumerate(quickCombinations): - requiredQtVersion = __createProjectHandleQtQuickSelection__(qComb[0], qComb[1]) + requiredQtVersion = __createProjectHandleQtQuickSelection__(qComb) __modifyAvailableTargets__(displayedPlatforms, requiredQtVersion, True) verifyKitCheckboxes(kits, displayedPlatforms) # FIXME: if QTBUG-35203 is fixed replace by triggering the shortcut for Back