Commit 67710829 authored by Christian Stenger's avatar Christian Stenger
Browse files

Squish: Let tst_create_proj_wizard test for Madde too



The test will now execute as before, afterwards enable the Madde plugin
restart Qt Creator and perform the text again.

Change-Id: I08b6f3702af6541e0044f8ae047e42cc4f017a36
Reviewed-by: default avatarRobert Loehning <robert.loehning@digia.com>
parent d9c8913b
......@@ -52,6 +52,9 @@
:Generator:_QComboBox {buddy=':CMake Wizard.Generator:_QLabel' type='QComboBox' unnamed='1' visible='1'}
: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'}
:Installed Plugins.Close_QPushButton {text='Close' type='QPushButton' unnamed='1' visible='1' window=':Installed Plugins_Core::Internal::PluginDialog'}
:Installed Plugins.categoryWidget_QTreeWidget {name='categoryWidget' type='QTreeWidget' visible='1' window=':Installed Plugins_Core::Internal::PluginDialog'}
:Installed Plugins_Core::Internal::PluginDialog {type='Core::Internal::PluginDialog' unnamed='1' visible='1' windowTitle='Installed Plugins'}
:Kits_Or_Compilers_QTreeView {container=':qt_tabwidget_stackedwidget_QWidget' type='QTreeView' unnamed='1' visible='1'}
:Kits_QtVersion_QComboBox {container=':qt_tabwidget_stackedwidget_QWidget' occurrence='4' type='QComboBox' unnamed='1' visible='1'}
:New.frame_QFrame {name='frame' type='QFrame' visible='1' window=':New_Core::Internal::NewDialog'}
......
......@@ -3,7 +3,6 @@ source("../../shared/qtcreator.py")
import re
def main():
global textChanged
sourceExample = os.path.abspath(sdkPath + "/Examples/4.7/declarative/text/textselection")
qmlFile = os.path.join("qml", "textselection.qml")
if not neededFilePresent(os.path.join(sourceExample, qmlFile)):
......@@ -15,7 +14,18 @@ def main():
overrideInstallLazySignalHandler()
installLazySignalHandler(":frame.templateDescription_QTextBrowser",
"textChanged()","__handleTextChanged__")
kits = getConfiguredKits()
performTest(templateDir, qmlFile, True)
enableMaddePlugin()
invokeMenuItem("File", "Exit")
waitForCleanShutdown()
__copyOriginalSettings__()
startApplication("qtcreator" + SettingsPath)
performTest(templateDir, qmlFile, False)
invokeMenuItem("File", "Exit")
def performTest(templateDir, qmlFile, isMaddeDisabled):
global textChanged
kits = getConfiguredKits(isMaddeDisabled)
test.log("Collecting potential project types...")
availableProjectTypes = []
invokeMenuItem("File", "New File or Project...")
......@@ -26,13 +36,15 @@ def main():
comboBox = findObject("{name='comboBox' type='QComboBox' visible='1' "
"window=':New_Core::Internal::NewDialog'}")
targets = zip(*kits.values())[0]
if (QtQuickConstants.getStringForTarget(QtQuickConstants.Targets.MAEMO5) not in targets
and QtQuickConstants.getStringForTarget(QtQuickConstants.Targets.HARMATTAN) not in targets):
test.compare(comboBox.currentText, "Desktop Templates")
test.verify(not comboBox.enabled, "Verifying whether combobox is disabled.")
else:
maddeTargets = QtQuickConstants.getTargetsAsStrings([QtQuickConstants.Targets.MAEMO5,
QtQuickConstants.Targets.HARMATTAN])
maddeInTargets = len(set(targets) & set(maddeTargets)) > 0
test.compare(comboBox.enabled, maddeInTargets, "Verifying whether combox is enabled.")
test.compare(maddeInTargets, not isMaddeDisabled, "Verifying if kits are configured.")
if maddeInTargets:
test.compare(comboBox.currentText, "All Templates")
test.verify(comboBox.enabled, "Verifying whether combobox is enabled.")
else:
test.compare(comboBox.currentText, "Desktop Templates")
for category in [item.replace(".", "\\.") for item in dumpItems(catModel, projects)]:
# skip non-configurable
if "Import" in category:
......@@ -106,7 +118,31 @@ def main():
test.fail("Found unexpected additional kit(s) %s on 'Kit Selection' page."
% str(availableCheckboxes))
clickButton(waitForObject("{text='Cancel' type='QPushButton' unnamed='1' visible='1'}"))
invokeMenuItem("File", "Exit")
def enableMaddePlugin():
invokeMenuItem("Help", "About Plugins...")
pluginsTW = waitForObject(":Installed Plugins.categoryWidget_QTreeWidget")
devSupport = ("{container=':Installed Plugins.categoryWidget_QTreeWidget' "
"column='0' text='Device Support' type='QModelIndex'}")
# children position + 1 because children will be counted beginning with 0
maddePos = dumpItems(pluginsTW.model(), waitForObject(devSupport)).index('Madde') + 1
mouseClick(waitForObject("{column='1' container=%s text='' type='QModelIndex' "
"occurrence='%d'}" % (devSupport, maddePos)), 5, 5, 0, Qt.LeftButton)
clickButton(":Installed Plugins.Close_QPushButton")
# copy original settings (except ini file)
def __copyOriginalSettings__():
global tmpSettingsDir
origSettingsDir = os.path.abspath(os.path.join(os.getcwd(), "..", "..", "settings"))
if platform.system() in ('Microsoft', 'Windows'):
origSettingsDir = os.path.join(origSettingsDir, "windows", "QtProject", "qtcreator")
else:
origSettingsDir = os.path.join(origSettingsDir, "unix", "QtProject", "qtcreator")
for fileName in glob.glob(os.path.join(origSettingsDir, "*.xml")):
shutil.copy(fileName, os.path.join(tmpSettingsDir, "QtProject", "qtcreator"))
if platform.system() in ('Linux', 'Darwin'):
substituteTildeWithinToolchains(tmpSettingsDir)
substituteUnchosenTargetABIs(tmpSettingsDir)
def __handleTextChanged__(object):
global textChanged
......
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