diff --git a/tests/system/objects.map b/tests/system/objects.map
index 7288a0e400e..3282b16d2da 100644
--- a/tests/system/objects.map
+++ b/tests/system/objects.map
@@ -1,4 +1,3 @@
-:*Qt Creator.Add Kit_QPushButton {text='Add Kit' type='QPushButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:*Qt Creator.Build Project_Core::Internal::FancyToolButton {text?='Build Project*' type='Core::Internal::FancyToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:*Qt Creator.Cancel Build_QToolButton {text='Cancel Build' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:*Qt Creator.Clear_QToolButton {text='Clear' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
diff --git a/tests/system/shared/project_explorer.py b/tests/system/shared/project_explorer.py
index 8ab8f012313..2396bbc80f1 100644
--- a/tests/system/shared/project_explorer.py
+++ b/tests/system/shared/project_explorer.py
@@ -293,3 +293,34 @@ def invokeContextMenuOnProject(projectName, menuItem):
else:
activateItem(waitForObjectItem("{name='Project.Menu.Project' type='QMenu' visible='1'}", menuItem))
return projItem
+
+def addAndActivateKit(kit):
+ clickToActivate = "
Click to activate:
"
+ bAndRIndex = getQModelIndexStr("text='Build & Run'", ":Projects.ProjectNavigationTreeView")
+ kitString = Targets.getStringForTarget(kit)
+ switchViewTo(ViewConstants.PROJECTS)
+ try:
+ treeView = waitForObject(":Projects.ProjectNavigationTreeView")
+ wanted = getQModelIndexStr("text='%s'" % kitString, bAndRIndex)
+ index = findObject(wanted)
+ if str(index.toolTip).startswith(clickToActivate):
+ mouseClick(index)
+ test.verify(waitFor("not str(index.toolTip).startswith(clickToActivate)", 1500),
+ "Kit added for this project")
+ try:
+ findObject(":Projects.ProjectNavigationTreeView")
+ except:
+ test.warning("Squish issue - QC switches automatically to Edit view after enabling "
+ "a new kit when running tst_opencreator_qbs - works as expected when "
+ "running without Squish")
+ switchViewTo(ViewConstants.PROJECTS)
+ else:
+ test.warning("Kit is already added for this project.")
+ mouseClick(index)
+ test.verify(waitFor("index.font.bold == True", 1500),
+ "Verifying whether kit is current active")
+ except:
+ return False
+ finally:
+ switchViewTo(ViewConstants.EDIT)
+ return True
diff --git a/tests/system/suite_general/tst_opencreator_qbs/test.py b/tests/system/suite_general/tst_opencreator_qbs/test.py
index eeec6ff45ad..51b6b36185e 100644
--- a/tests/system/suite_general/tst_opencreator_qbs/test.py
+++ b/tests/system/suite_general/tst_opencreator_qbs/test.py
@@ -37,13 +37,10 @@ def main():
if not startedWithoutPluginError():
return
openQbsProject(pathCreator)
- switchViewTo(ViewConstants.PROJECTS)
- clickButton(waitForObject(":*Qt Creator.Add Kit_QPushButton"))
- menuItem = Targets.getStringForTarget(Targets.DESKTOP_541_GCC)
- activateItem(waitForObjectItem("{type='QMenu' unnamed='1' visible='1' "
- "window=':Qt Creator_Core::Internal::MainWindow'}", menuItem))
- switchToBuildOrRunSettingsFor(2, 1, ProjectSettings.BUILD)
- switchViewTo(ViewConstants.EDIT)
+ if not addAndActivateKit(Targets.DESKTOP_541_GCC):
+ test.fatal("Failed to activate '%s'" % Targets.getStringForTarget(Targets.DESKTOP_541_GCC))
+ invokeMenuItem("File", "Exit")
+ return
test.log("Start parsing project")
rootNodeTemplate = "{column='0' container=':Qt Creator_Utils::NavigationTreeView' text~='%s( \[\S+\])?' type='QModelIndex'}"
ntwObject = waitForObject(rootNodeTemplate % "qtcreator.qbs")
diff --git a/tests/system/suite_qtquick/tst_qtquick_creation3/test.py b/tests/system/suite_qtquick/tst_qtquick_creation3/test.py
index 44846f4fdf2..a19be52c588 100644
--- a/tests/system/suite_qtquick/tst_qtquick_creation3/test.py
+++ b/tests/system/suite_qtquick/tst_qtquick_creation3/test.py
@@ -37,23 +37,26 @@ def main():
# using a temporary directory won't mess up a potentially existing
workingDir = tempDir()
projectName = createNewQtQuickUI(workingDir, qtVersion, controls)
- switchViewTo(ViewConstants.PROJECTS)
- clickButton(waitForObject(":*Qt Creator.Add Kit_QPushButton"))
if qtVersion == "5.6":
- menuItem = Targets.getStringForTarget(Targets.DESKTOP_561_DEFAULT)
- quick = "2.6"
- 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))
+ kit = Targets.getStringForTarget(Targets.DESKTOP_561_DEFAULT)
+ if addAndActivateKit(Targets.DESKTOP_561_DEFAULT):
+ quick = "2.6"
+ else:
+ test.fatal("Failed to activate kit %s" % kit)
+ continue
+ else: # qtVersion == '5.4'
+ if platform.system() == 'Darwin':
+ continue
+ kit = Targets.getStringForTarget(Targets.DESKTOP_541_GCC)
+ if addAndActivateKit(Targets.DESKTOP_541_GCC):
+ quick = "2.4"
+ else:
+ test.fatal("Failed to activate kit %s" % kit)
+ continue
additionalText = ''
if controls:
additionalText = ' Controls '
- test.log("Running project Qt Quick%sUI (%s)" % (additionalText, menuItem))
+ test.log("Running project Qt Quick%sUI (%s)" % (additionalText, kit))
qmlViewer = modifyRunSettingsForHookIntoQtQuickUI(2, 1, workingDir, projectName, 11223, quick)
if qmlViewer!=None:
qmlViewerPath = os.path.dirname(qmlViewer)