Commit 77cf864e authored by Robert Loehning's avatar Robert Loehning

Squish: Test removing of kits

Task-number: QTCREATORBUG-17702
Change-Id: I545e9f30dd61eae5a49ff0c56a63dc89f92ce6de
Reviewed-by: Christian Stenger's avatarChristian Stenger <christian.stenger@qt.io>
parent 9c118fb8
......@@ -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'}
......
......@@ -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
############################################################################
#
# 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")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment