diff --git a/tests/system/objects.map b/tests/system/objects.map index f6ef8dbb4f8c1611791936a3581bafa4ddcc7ebe..e96b9ea1c1bd99fae66886d0749910f83abb0b18 100644 --- a/tests/system/objects.map +++ b/tests/system/objects.map @@ -105,7 +105,7 @@ :Hits_QCLuceneResultWidget {aboveWidget=':Hits_QLabel' type='QCLuceneResultWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Hits_QLabel {text~='\\\\d+ - \\\\d+ of \\\\d+ Hits' type='QLabel' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :JavaScript.QmlProfilerEventsTable_QmlProfiler::Internal::QV8ProfilerEventsMainView {container=':*Qt Creator.JavaScript_QDockWidget' name='QmlProfilerEventsTable' type='QmlProfiler::Internal::QV8ProfilerEventsMainView' visible='1'} -:Kits_QtVersion_QComboBox {container=':qt_tabwidget_stackedwidget_QWidget' occurrence='5' type='QComboBox' unnamed='1' visible='1'} +:Kits_QtVersion_QComboBox {container=':qt_tabwidget_stackedwidget_QWidget' leftWidget=':QtVersionLabel_KitPage' type='QComboBox' unnamed='1' visible='1'} :Locals and Expressions_Debugger::Internal::WatchTreeView {container=':DebugModeWidget.Locals and Expressions_QDockWidget' name='WatchWindow' type='Debugger::Internal::WatchTreeView' visible='1' windowTitle='Locals and Expressions'} :Minimal required Qt version:_QLabel {text='Minimal required Qt version:' type='QLabel' unnamed='1' visible='1' window=':New Text File_ProjectExplorer::JsonWizard'} :New Text File.Add to project:_QLabel {name='projectLabel' text='Add to project:' type='QLabel' visible='1' window=':New Text File_ProjectExplorer::JsonWizard'} @@ -182,6 +182,7 @@ :QtSupport__Internal__QtVersionManager.errorLabel.QLabel {container=':qt_tabwidget_stackedwidget.QtSupport__Internal__QtVersionManager_QtSupport::Internal::QtOptionsPageWidget' name='errorLabel' type='QLabel' visible='1'} :QtSupport__Internal__QtVersionManager.qmake_QLabel {container=':qt_tabwidget_stackedwidget.QtSupport__Internal__QtVersionManager_QtSupport::Internal::QtOptionsPageWidget' name='qmakePath' type='QLabel' visible='1'} :QtSupport__Internal__QtVersionManager.qtdirList_QTreeWidget {container=':qt_tabwidget_stackedwidget.QtSupport__Internal__QtVersionManager_QtSupport::Internal::QtOptionsPageWidget' name='qtdirList' type='QTreeWidget' visible='1'} +:QtVersionLabel_KitPage {container=':qt_tabwidget_stackedwidget_QWidget' text='Qt version:' type='QLabel' unnamed='1' visible='1'} :Restart required.OK_QPushButton {text='OK' type='QPushButton' unnamed='1' visible='1' window=':Restart required_QMessageBox'} :Restart required_QMessageBox {text='The language change will take effect after a restart of Qt Creator.' type='QMessageBox' unnamed='1' visible='1'} :Revert to Saved.Proceed_QPushButton {text='Proceed' type='QPushButton' unnamed='1' visible='1' window=':Revert to Saved_QMessageBox'} diff --git a/tests/system/shared/project.py b/tests/system/shared/project.py index ebd403254e2f00f1ef764c533c31f0dfe7dce344..3d87d00c22c20aa6ee4bc89089ddf238d458cd3a 100644 --- a/tests/system/shared/project.py +++ b/tests/system/shared/project.py @@ -270,26 +270,39 @@ def createProject_Qt_Console(path, projectName, checks = True): def createNewQtQuickApplication(workingDir, projectName = None, targets=Targets.desktopTargetClasses(), minimumQtVersion="5.3", - fromWelcome=False): - available = __createProjectOrFileSelectType__(" Application", "Qt Quick Application", fromWelcome) + withControls = False, fromWelcome=False): + if withControls: + template = "Qt Quick Controls Application" + else: + template = "Qt Quick Application" + available = __createProjectOrFileSelectType__(" Application", template, fromWelcome) projectName = __createProjectSetNameAndPath__(workingDir, projectName) requiredQt = __createProjectHandleQtQuickSelection__(minimumQtVersion) __modifyAvailableTargets__(available, requiredQt) checkedTargets = __chooseTargets__(targets, available) snooze(1) - clickButton(waitForObject(":Next_QPushButton")) - __createProjectHandleLastPage__() + if len(checkedTargets): + clickButton(waitForObject(":Next_QPushButton")) + __createProjectHandleLastPage__() + progressBarWait(10000) + else: + clickButton(waitForObject("{type='QPushButton' text='Cancel' visible='1'}")) - progressBarWait(10000) return checkedTargets, projectName -def createNewQtQuickUI(workingDir, qtQuickVersion="1.1"): - __createProjectOrFileSelectType__(" Application", "Qt Quick UI") +def createNewQtQuickUI(workingDir, qtVersion = "5.3", withControls = False): + if withControls: + template = 'Qt Quick Controls UI' + else: + template = 'Qt Quick UI' + __createProjectOrFileSelectType__(" Application", template) if workingDir == None: workingDir = tempDir() projectName = __createProjectSetNameAndPath__(workingDir) - __createProjectHandleQtQuickSelection__(qtQuickVersion) + __createProjectHandleQtQuickSelection__(qtVersion) __createProjectHandleLastPage__() + progressBarWait(10000) + return projectName def createNewQmlExtension(workingDir, targets=Targets.DESKTOP_474_GCC, qtQuickVersion=1): diff --git a/tests/system/suite_qtquick/tst_qtquick_creation/test.py b/tests/system/suite_qtquick/tst_qtquick_creation/test.py index 3a3562c22f27a175716e2c4ed44e19c505794396..fa314825a4f11c7a346b90528cfd865589bdb581 100644 --- a/tests/system/suite_qtquick/tst_qtquick_creation/test.py +++ b/tests/system/suite_qtquick/tst_qtquick_creation/test.py @@ -34,16 +34,31 @@ def main(): startApplication("qtcreator" + SettingsPath) if not startedWithoutPluginError(): return - for targ, qVer in [[Targets.DESKTOP_480_DEFAULT, "1.1"], [Targets.DESKTOP_521_DEFAULT, "2.1"], - [Targets.DESKTOP_521_DEFAULT, "2.2"], [Targets.DESKTOP_531_DEFAULT, "2.3"], - [Targets.DESKTOP_521_DEFAULT, "Controls 1.0"], [Targets.DESKTOP_521_DEFAULT, "Controls 1.1"], - [Targets.DESKTOP_531_DEFAULT, "Controls 1.2"]]: + + available = [("5.3", False), ("5.3", True)] + if platform.system() != 'Darwin': + available.extend([("5.4", False), ("5.4", True)]) + + for qtVersion, controls in available: + if qtVersion == "5.3": + targ = Targets.DESKTOP_531_DEFAULT + quick = "2.3" + else: + targ = Targets.DESKTOP_541_GCC + quick = "2.4" # 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 %s Application (%s)" - % (qVer, Targets.getStringForTarget(targ))) + minimumQtVersion=qtVersion, + withControls = controls) + if len(checkedTargets) == 0: + test.fatal("Could not check wanted target") + continue + additionalText = '' + if controls: + additionalText = ' Controls ' + test.log("Building project Qt Quick%sApplication (%s)" + % (additionalText, Targets.getStringForTarget(targ))) result = modifyRunSettingsForHookInto(projectName, len(checkedTargets), 11223) invokeMenuItem("Build", "Build All") waitForCompile() @@ -57,10 +72,8 @@ def main(): allowAppThroughWinFW(workingDir, projectName) if result: function = "subprocessFunctionQuick2" - if qVer[0] == "1": - function = "subprocessFunctionQuick1" result = runAndCloseApp(True, projectName, 11223, function, - SubprocessType.QT_QUICK_APPLICATION, quickVersion=qVer) + SubprocessType.QT_QUICK_APPLICATION, quickVersion=quick) else: result = runAndCloseApp(sType=SubprocessType.QT_QUICK_APPLICATION) removeExecutableAsAttachableAUT(projectName, 11223) @@ -82,8 +95,5 @@ def subprocessFunctionGenericQuick(quickVersion): test.log("Clicking 'Hello World' Text to close QtQuick%dApplicationViewer" % quickVersion) mouseClick(helloWorldText, 5, 5, 0, Qt.LeftButton) -def subprocessFunctionQuick1(): - subprocessFunctionGenericQuick(1) - def subprocessFunctionQuick2(): subprocessFunctionGenericQuick(2) diff --git a/tests/system/suite_qtquick/tst_qtquick_creation3/test.py b/tests/system/suite_qtquick/tst_qtquick_creation3/test.py index aa3347118d67b5f0ea216414f00047eed04138e2..14017bc7a3eceaa45ccc442349a4f0fc10acfa51 100644 --- a/tests/system/suite_qtquick/tst_qtquick_creation3/test.py +++ b/tests/system/suite_qtquick/tst_qtquick_creation3/test.py @@ -34,27 +34,39 @@ def main(): startApplication("qtcreator -load QmlProjectManager" + SettingsPath) if not startedWithoutPluginError(): return - for quickVersion in ["1.1", "2.1", "2.2", "2.3", "Controls 1.0", "Controls 1.1", "Controls 1.2"]: + available = [("5.3", False), ("5.3", True)] + if platform.system() != 'Darwin': + available.extend([("5.4", False), ("5.4", True)]) + + for qtVersion, controls in available: # using a temporary directory won't mess up a potentially existing workingDir = tempDir() - projectName = createNewQtQuickUI(workingDir, quickVersion) + projectName = createNewQtQuickUI(workingDir, qtVersion, controls) switchViewTo(ViewConstants.PROJECTS) clickButton(waitForObject(":*Qt Creator.Add Kit_QPushButton")) - menuItem = Targets.getStringForTarget(Targets.DESKTOP_531_DEFAULT) + if qtVersion == "5.3": + menuItem = Targets.getStringForTarget(Targets.DESKTOP_531_DEFAULT) + quick = "2.3" + else: + menuItem = Targets.getStringForTarget(Targets.DESKTOP_541_GCC) + quick = "2.4" if platform.system() == 'Darwin': waitFor("macHackActivateContextMenuItem(menuItem)", 5000) else: activateItem(waitForObjectItem("{type='QMenu' unnamed='1' visible='1' " "window=':Qt Creator_Core::Internal::MainWindow'}", menuItem)) - test.log("Running project Qt Quick %s UI" % quickVersion) - qmlViewer = modifyRunSettingsForHookIntoQtQuickUI(2, 1, workingDir, projectName, 11223, quickVersion) + additionalText = '' + if controls: + additionalText = ' Controls ' + test.log("Running project Qt Quick%sUI (%s)" % (additionalText, menuItem)) + qmlViewer = modifyRunSettingsForHookIntoQtQuickUI(2, 1, workingDir, projectName, 11223, quick) if qmlViewer!=None: qmlViewerPath = os.path.dirname(qmlViewer) qmlViewer = os.path.basename(qmlViewer) result = addExecutableAsAttachableAUT(qmlViewer, 11223) allowAppThroughWinFW(qmlViewerPath, qmlViewer, None) if result: - result = runAndCloseApp(True, qmlViewer, 11223, sType=SubprocessType.QT_QUICK_UI, quickVersion=quickVersion) + result = runAndCloseApp(True, qmlViewer, 11223, sType=SubprocessType.QT_QUICK_UI, quickVersion=quick) else: result = runAndCloseApp(sType=SubprocessType.QT_QUICK_UI) removeExecutableAsAttachableAUT(qmlViewer, 11223)