summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Loehning <robert.loehning@qt.io>2017-03-01 20:04:20 +0100
committerRobert Loehning <robert.loehning@qt.io>2017-03-03 12:33:11 +0000
commit77cf864e89abb8253a6ab240dbb0d1df180519ba (patch)
tree29fa49f5176c4f2f04cef26ebff6700b92251de5
parent9c118fb8f27b66f61f99d3fad0e57caac831934f (diff)
downloadqt-creator-77cf864e89abb8253a6ab240dbb0d1df180519ba.tar.gz
Squish: Test removing of kits
Task-number: QTCREATORBUG-17702 Change-Id: I545e9f30dd61eae5a49ff0c56a63dc89f92ce6de Reviewed-by: Christian Stenger <christian.stenger@qt.io>
-rw-r--r--tests/system/objects.map2
-rw-r--r--tests/system/suite_general/suite.conf2
-rw-r--r--tests/system/suite_general/tst_remove_kits/test.py64
3 files changed, 67 insertions, 1 deletions
diff --git a/tests/system/objects.map b/tests/system/objects.map
index 354fff8d3b..baf4e82e8a 100644
--- a/tests/system/objects.map
+++ b/tests/system/objects.map
@@ -110,6 +110,7 @@
:New.templateCategoryView_QTreeView {name='templateCategoryView' type='QTreeView' visible='1' window=':New_Core::Internal::NewDialog'}
:New_Core::Internal::NewDialog {name='Core__Internal__NewDialog' type='Core::Internal::NewDialog' visible='1' windowTitle?='New*'}
:Next_QPushButton {text~='(Next.*|Continue)' type='QPushButton' visible='1'}
+:No valid kits found._QLabel {text?='*No valid kits found.*' type='QLabel' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:OpenDocuments_Widget {type='Core::Internal::OpenEditorsWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow' windowTitle='Open Documents'}
:Options.Cancel_QPushButton {text='Cancel' type='QPushButton' unnamed='1' visible='1' window=':Options_Core::Internal::SettingsDialog'}
:Options.OK_QPushButton {text='OK' type='QPushButton' unnamed='1' visible='1' window=':Options_Core::Internal::SettingsDialog'}
@@ -177,6 +178,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'}
:QtVersionLabel_KitPage {container=':qt_tabwidget_stackedwidget_QWidget' text='Qt version:' type='QLabel' unnamed='1' visible='1'}
+:Remove_QPushButton {container=':qt_tabwidget_stackedwidget_QScrollArea' text='Remove' type='QPushButton' 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/suite_general/suite.conf b/tests/system/suite_general/suite.conf
index d69fdc431e..286bc162ef 100644
--- a/tests/system/suite_general/suite.conf
+++ b/tests/system/suite_general/suite.conf
@@ -7,6 +7,6 @@ HOOK_SUB_PROCESSES=false
IMPLICITAUTSTART=0
LANGUAGE=Python
OBJECTMAP=../objects.map
-TEST_CASES=tst_build_speedcrunch tst_cmake_speedcrunch tst_create_proj_wizard tst_default_settings tst_installed_languages tst_new_class tst_opencreator_qbs tst_openqt_creator tst_rename_file tst_save_before_build tst_session_handling tst_tasks_handling
+TEST_CASES=tst_build_speedcrunch tst_cmake_speedcrunch tst_create_proj_wizard tst_default_settings tst_installed_languages tst_new_class tst_opencreator_qbs tst_openqt_creator tst_remove_kits tst_rename_file tst_save_before_build tst_session_handling tst_tasks_handling
VERSION=2
WRAPPERS=Qt
diff --git a/tests/system/suite_general/tst_remove_kits/test.py b/tests/system/suite_general/tst_remove_kits/test.py
new file mode 100644
index 0000000000..98590d674a
--- /dev/null
+++ b/tests/system/suite_general/tst_remove_kits/test.py
@@ -0,0 +1,64 @@
+############################################################################
+#
+# Copyright (C) 2017 The Qt Company Ltd.
+# Contact: https://www.qt.io/licensing/
+#
+# This file is part of Qt Creator.
+#
+# Commercial License Usage
+# Licensees holding valid commercial Qt licenses may use this file in
+# accordance with the commercial license agreement provided with the
+# Software or, alternatively, in accordance with the terms contained in
+# a written agreement between you and The Qt Company. For licensing terms
+# and conditions see https://www.qt.io/terms-conditions. For further
+# information use the contact form at https://www.qt.io/contact-us.
+#
+# GNU General Public License Usage
+# Alternatively, this file may be used under the terms of the GNU
+# General Public License version 3 as published by the Free Software
+# Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+# included in the packaging of this file. Please review the following
+# information to ensure the GNU General Public License requirements will
+# be met: https://www.gnu.org/licenses/gpl-3.0.html.
+#
+############################################################################
+
+source("../../shared/qtcreator.py")
+
+def verifyProjectsMode(expectedKits):
+ treeView = waitForObject(":Projects.ProjectNavigationTreeView")
+ bAndRIndex = getQModelIndexStr("text='Build & Run'",
+ ":Projects.ProjectNavigationTreeView")
+ test.compare(len(dumpItems(treeView.model(), waitForObject(bAndRIndex))),
+ len(expectedKits), "Verify number of listed kits.")
+ test.compare(set(dumpItems(treeView.model(), waitForObject(bAndRIndex))),
+ set(expectedKits), "Verify if expected kits are listed.")
+ hasKits = len(expectedKits) > 0
+ test.verify(checkIfObjectExists(":scrollArea.Edit build configuration:_QLabel", hasKits),
+ "Verify if build settings are being displayed.")
+ test.verify(checkIfObjectExists(":No valid kits found._QLabel", not hasKits),
+ "Verify if Creator reports missing kits.")
+
+kitNameTemplate = "Manual.%s"
+
+def __removeKit__(kit, kitName):
+ global kitNameTemplate
+ if kitName == Targets.getStringForTarget(Targets.getDefaultKit()):
+ # The following kits will be the default kit at that time
+ kitNameTemplate += " (default)"
+ item = kitNameTemplate % kitName
+ waitForObjectItem(":BuildAndRun_QTreeView", item)
+ clickItem(":BuildAndRun_QTreeView", item, 5, 5, 0, Qt.LeftButton)
+ clickButton(waitForObject(":Remove_QPushButton"))
+
+def main():
+ startApplication("qtcreator" + SettingsPath)
+ if not startedWithoutPluginError():
+ return
+ createProject_Qt_Console(tempDir(), "SquishProject")
+ switchViewTo(ViewConstants.PROJECTS)
+ verifyProjectsMode(Targets.getTargetsAsStrings(Targets.availableTargetClasses()))
+ iterateKits(True, False, __removeKit__)
+ clickButton(waitForObject(":Options.OK_QPushButton"))
+ verifyProjectsMode([])
+ invokeMenuItem("File", "Exit")