~bzoltan/kubuntu-packaging/decouple_cmake_plugin

« back to all changes in this revision

Viewing changes to tests/system/suite_general/tst_create_proj_wizard/test.py

  • Committer: Timo Jyrinki
  • Date: 2013-12-02 09:16:15 UTC
  • mfrom: (1.1.29)
  • Revision ID: timo.jyrinki@canonical.com-20131202091615-xbj1os1f604ber1m
New upstream release candidate.

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
 
34
34
def main():
35
35
    global tmpSettingsDir
 
36
    global textChanged
36
37
    sourceExample = os.path.abspath(sdkPath + "/Examples/4.7/declarative/text/textselection")
37
38
    qmlFile = os.path.join("qml", "textselection.qml")
38
39
    if not neededFilePresent(os.path.join(sourceExample, qmlFile)):
44
45
    overrideInstallLazySignalHandler()
45
46
    installLazySignalHandler(":frame.templateDescription_QTextBrowser",
46
47
                             "textChanged()","__handleTextChanged__")
47
 
    performTest(templateDir, qmlFile, True)
48
 
    enableMaddePlugin()
49
 
    invokeMenuItem("File", "Exit")
50
 
    waitForCleanShutdown()
51
 
    copySettingsToTmpDir(tmpSettingsDir, ['QtCreator.ini'])
52
 
    overrideStartApplication()
53
 
    startApplication("qtcreator" + SettingsPath)
54
 
    performTest(templateDir, qmlFile, False)
55
 
    invokeMenuItem("File", "Exit")
56
 
 
57
 
def performTest(templateDir, qmlFile, isMaddeDisabled):
58
 
    global textChanged
59
 
    kits = getConfiguredKits(isMaddeDisabled)
 
48
    kits = getConfiguredKits()
60
49
    test.log("Collecting potential project types...")
61
50
    availableProjectTypes = []
62
51
    invokeMenuItem("File", "New File or Project...")
69
58
    maddeTargets = Targets.getTargetsAsStrings([Targets.MAEMO5, Targets.HARMATTAN])
70
59
    maddeInTargets = len(set(targets) & set(maddeTargets)) > 0
71
60
    test.verify(comboBox.enabled, "Verifying whether combobox is enabled.")
72
 
    test.compare(maddeInTargets, not isMaddeDisabled, "Verifying if kits are configured.")
 
61
    test.verify(not maddeInTargets, "Verify there are no leftovers of Madde")
73
62
    test.compare(comboBox.currentText, "Desktop Templates")
74
63
    selectFromCombo(comboBox, "All Templates")
75
64
    for category in [item.replace(".", "\\.") for item in dumpItems(catModel, projects)]:
133
122
            test.fail("Found unexpected additional kit(s) %s on 'Kit Selection' page."
134
123
                      % str(availableCheckboxes))
135
124
        clickButton(waitForObject("{text='Cancel' type='QPushButton' unnamed='1' visible='1'}"))
136
 
 
137
 
def enableMaddePlugin():
138
 
    invokeMenuItem("Help", "About Plugins...")
139
 
    pluginsTW = waitForObject(":Installed Plugins.categoryWidget_QTreeWidget")
140
 
    devSupport = ("{container=':Installed Plugins.categoryWidget_QTreeWidget' "
141
 
                  "column='0' text='Device Support' type='QModelIndex'}")
142
 
    # children position + 1 because children will be counted beginning with 0
143
 
    maddePos = dumpItems(pluginsTW.model(), waitForObject(devSupport)).index('Madde') + 1
144
 
    mouseClick(waitForObject("{column='1' container=%s text='' type='QModelIndex' "
145
 
                             "occurrence='%d'}" % (devSupport, maddePos)), 5, 5, 0, Qt.LeftButton)
146
 
    clickButton(":Installed Plugins.Close_QPushButton")
 
125
    invokeMenuItem("File", "Exit")
147
126
 
148
127
def __handleTextChanged__(*args):
149
128
    global textChanged