diff options
Diffstat (limited to 'tests/system')
-rw-r--r-- | tests/system/objects.map | 12 | ||||
-rw-r--r-- | tests/system/shared/build_utils.py | 4 | ||||
-rw-r--r-- | tests/system/shared/project.py | 32 | ||||
-rw-r--r-- | tests/system/shared/utils.py | 15 | ||||
-rw-r--r-- | tests/system/suite_CSUP/tst_CSUP04/test.py | 2 | ||||
-rwxr-xr-x | tests/system/suite_HELP/tst_HELP04/test.py | 32 | ||||
-rwxr-xr-x | tests/system/suite_HELP/tst_HELP06/test.py | 4 | ||||
-rw-r--r-- | tests/system/suite_debugger/tst_simple_analyze/test.py | 4 | ||||
-rw-r--r-- | tests/system/suite_editors/tst_basic_cpp_support/test.py | 7 | ||||
-rw-r--r-- | tests/system/suite_general/tst_create_proj_wizard/test.py | 103 | ||||
-rw-r--r-- | tests/system/suite_tools/tst_git_clone/test.py | 22 |
11 files changed, 136 insertions, 101 deletions
diff --git a/tests/system/objects.map b/tests/system/objects.map index 5eff1a358e..85b9dbb58d 100644 --- a/tests/system/objects.map +++ b/tests/system/objects.map @@ -34,8 +34,8 @@ :Behavior.Autocomplete common prefix_QCheckBox {container=':CppTools__Internal__CompletionSettingsPage.Behavior_QGroupBox' name='partiallyComplete' text='Autocomplete common prefix' type='QCheckBox' visible='1'} :Behavior.completionTrigger_QComboBox {container=':CppTools__Internal__CompletionSettingsPage.Behavior_QGroupBox' name='completionTrigger' type='QComboBox' visible='1'} :Breakpoints_Debugger::Internal::BreakTreeView {container=':DebugModeWidget.Breakpoints_QDockWidget' type='Debugger::Internal::BreakTreeView' unnamed='1' visible='1'} -:CMake Wizard.Cancel_QPushButton {text='Cancel' type='QPushButton' unnamed='1' visible='1' window=':CMake Wizard_CMakeProjectManager::Internal::CMakeOpenProjectWizard'} -:CMake Wizard.Finish_QPushButton {text~='(Finish|Done)' type='QPushButton' unnamed='1' visible='1' window=':CMake Wizard_CMakeProjectManager::Internal::CMakeOpenProjectWizard'} +:CMake Wizard.Cancel_QPushButton {text='Cancel' type='QPushButton' visible='1' window=':CMake Wizard_CMakeProjectManager::Internal::CMakeOpenProjectWizard'} +:CMake Wizard.Finish_QPushButton {text~='(Finish|Done)' type='QPushButton' visible='1' window=':CMake Wizard_CMakeProjectManager::Internal::CMakeOpenProjectWizard'} :CMake Wizard.Generator:_QLabel {text='Generator:' type='QLabel' unnamed='1' visible='1' window=':CMake Wizard_CMakeProjectManager::Internal::CMakeOpenProjectWizard'} :CMake Wizard.Next_QPushButton {name='__qt__passive_wizardbutton1' text~='(Next.*|Continue)' type='QPushButton' visible='1' window=':CMake Wizard_CMakeProjectManager::Internal::CMakeOpenProjectWizard'} :CMake Wizard.Run CMake_QPushButton {text='Run CMake' type='QPushButton' unnamed='1' visible='1' window=':CMake Wizard_CMakeProjectManager::Internal::CMakeOpenProjectWizard'} @@ -82,8 +82,8 @@ :FormEditorStack_qdesigner_internal::FormWindow {container=':*Qt Creator.FormEditorStack_Designer::Internal::FormEditorStack' type='qdesigner_internal::FormWindow' unnamed='1' visible='1'} :FormEditorStack_qdesigner_internal::PropertyLineEdit {container=':*Qt Creator.FormEditorStack_Designer::Internal::FormEditorStack' type='qdesigner_internal::PropertyLineEdit' unnamed='1' visible='1'} :Generator:_QComboBox {buddy=':CMake Wizard.Generator:_QLabel' type='QComboBox' unnamed='1' visible='1'} -:Git Repository Clone.Cancel_QPushButton {text='Cancel' type='QPushButton' unnamed='1' visible='1' window=':Git Repository Clone_VcsBase::Internal::CheckoutWizardDialog'} -:Git Repository Clone.Finish_QPushButton {text~='(Finish|Done)' type='QPushButton' unnamed='1' visible='1' window=':Git Repository Clone_VcsBase::Internal::CheckoutWizardDialog'} +:Git Repository Clone.Cancel_QPushButton {text='Cancel' type='QPushButton' visible='1' window=':Git Repository Clone_VcsBase::Internal::CheckoutWizardDialog'} +:Git Repository Clone.Finish_QPushButton {text~='(Finish|Done)' type='QPushButton' visible='1' window=':Git Repository Clone_VcsBase::Internal::CheckoutWizardDialog'} :Git Repository Clone.Repository_QGroupBox {name='repositoryGroupBox' title='Repository' type='QGroupBox' visible='1' window=':Git Repository Clone_VcsBase::Internal::CheckoutWizardDialog'} :Git Repository Clone.Result._QLabel {name='statusLabel' type='QLabel' visible='1' window=':Git Repository Clone_VcsBase::Internal::CheckoutWizardDialog'} :Git Repository Clone.Working Copy_QGroupBox {name='localGroupBox' title='Working Copy' type='QGroupBox' visible='1' window=':Git Repository Clone_VcsBase::Internal::CheckoutWizardDialog'} @@ -94,9 +94,6 @@ :Go to slot_QDialog {name='SelectSignalDialog' type='QDialog' visible='1' windowTitle='Go to slot'} :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'} :JavaScript.QmlProfilerEventsTable_QmlProfiler::Internal::QV8ProfilerEventsMainView {container=':*Qt Creator.JavaScript_QDockWidget' name='QmlProfilerEventsTable' type='QmlProfiler::Internal::QV8ProfilerEventsMainView' visible='1'} :Kits_Or_Compilers_QTreeView {container=':qt_tabwidget_stackedwidget_QWidget' type='QTreeView' unnamed='1' visible='1'} :Kits_QtVersion_QComboBox {container=':qt_tabwidget_stackedwidget_QWidget' occurrence='5' type='QComboBox' unnamed='1' visible='1'} @@ -128,7 +125,6 @@ :Qt Creator.Help_Search for:_QLineEdit {leftWidget=':Qt Creator.Search for:_QLabel' type='QLineEdit' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator.Issues_QListView {type='QListView' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow' windowTitle='Issues'} :Qt Creator.Project.Menu.File_QMenu {name='Project.Menu.File' type='QMenu' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} -:Qt Creator.Project.Menu.Project_QMenu {name='Project.Menu.Project' type='QMenu' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator.QtCreator.MenuBar_QMenuBar {name='QtCreator.MenuBar' type='QMenuBar' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator.ReRun_QToolButton {toolTip='Re-run this run-configuration' type='QToolButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator.Replace All_QToolButton {name='replaceAllButton' text='Replace All' type='QToolButton' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} diff --git a/tests/system/shared/build_utils.py b/tests/system/shared/build_utils.py index 6048482eaf..5a34aac4a3 100644 --- a/tests/system/shared/build_utils.py +++ b/tests/system/shared/build_utils.py @@ -65,10 +65,6 @@ def __addSignalHandlerDict__(lazySignalHandlerFunction): installedSignalHandlers.setdefault("%s____%s" % (name,signalSignature), handlers) return wrappedFunction -# returns the currently assigned handler functions for a given object and signal -def getInstalledSignalHandlers(name, signalSignature): - return installedSignalHandlers.get("%s____%s" % (name,signalSignature)) - # this method checks the last build (if there's one) and logs the number of errors, warnings and # lines within the Issues output # optional parameter can be used to tell this function if the build was expected to fail or not diff --git a/tests/system/shared/project.py b/tests/system/shared/project.py index 3646ea647d..add51cdff4 100644 --- a/tests/system/shared/project.py +++ b/tests/system/shared/project.py @@ -154,7 +154,12 @@ def __createProjectHandleQtQuickSelection__(qtQuickVersion, withControls): selectFromCombo(comboBox, "Qt Quick 2.0") else: test.fatal("Got unknown Qt Quick version: %s - trying to continue." % str(qtQuickVersion)) + label = waitForObject("{type='QLabel' unnamed='1' visible='1' text?='Creates a *' }") + requires = re.match(".*Requires Qt (\d\.\d).*", str(label.text)) + if requires: + requires = requires.group(1) clickButton(waitForObject(":Next_QPushButton")) + return requires # Selects the Qt versions for a project # param checks turns tests in the function on if set to True @@ -187,6 +192,30 @@ def __verifyFileCreation__(path, expectedFiles): filename = os.path.join(path, filename) test.verify(os.path.exists(filename), "Checking if '" + filename + "' was created") +def __modifyAvailableTargets__(available, requiredQt, asStrings=False): + threeDigits = re.compile("\d{3}") + requiredQtVersion = requiredQt.replace(".", "") + "0" + tmp = list(available) # we need a deep copy + for currentItem in tmp: + if asStrings: + item = currentItem + else: + item = Targets.getStringForTarget(currentItem) + found = threeDigits.search(item) + if found: + if found.group(0) < requiredQtVersion: + # Quick 1.1 supports 4.7.4 only for running, debugging is unsupported + # so the least required version is 4.8, but 4.7.4 will be still listed + if not (requiredQtVersion == "480" and found.group(0) == "474"): + available.remove(currentItem) + if requiredQtVersion > "480": + toBeRemoved = [Targets.EMBEDDED_LINUX, Targets.SIMULATOR] + if asStrings: + toBeRemoved = Targets.getTargetsAsStrings(toBeRemoved) + for t in toBeRemoved: + if t in available: + available.remove(t) + # Creates a Qt GUI project # param path specifies where to create the project # param projectName is the name for the new project @@ -256,7 +285,8 @@ def createNewQtQuickApplication(workingDir, projectName = None, fromWelcome=False, withControls=False): available = __createProjectOrFileSelectType__(" Applications", "Qt Quick Application", fromWelcome) projectName = __createProjectSetNameAndPath__(workingDir, projectName) - __createProjectHandleQtQuickSelection__(qtQuickVersion, withControls) + requiredQt = __createProjectHandleQtQuickSelection__(qtQuickVersion, withControls) + __modifyAvailableTargets__(available, requiredQt) checkedTargets = __chooseTargets__(targets, available) snooze(1) clickButton(waitForObject(":Next_QPushButton")) diff --git a/tests/system/shared/utils.py b/tests/system/shared/utils.py index 3279980aab..b46499d8b2 100644 --- a/tests/system/shared/utils.py +++ b/tests/system/shared/utils.py @@ -112,19 +112,16 @@ def selectFromLocator(filter, itemName = None): doubleClick(wantedItem, 5, 5, 0, Qt.LeftButton) def wordUnderCursor(window): - cursor = window.textCursor() - oldposition = cursor.position() - cursor.movePosition(QTextCursor.StartOfWord) - cursor.movePosition(QTextCursor.EndOfWord, QTextCursor.KeepAnchor) - returnValue = cursor.selectedText() - cursor.setPosition(oldposition) - return returnValue + return textUnderCursor(window, QTextCursor.StartOfWord, QTextCursor.EndOfWord) def lineUnderCursor(window): + return textUnderCursor(window, QTextCursor.StartOfLine, QTextCursor.EndOfLine) + +def textUnderCursor(window, fromPos, toPos): cursor = window.textCursor() oldposition = cursor.position() - cursor.movePosition(QTextCursor.StartOfLine) - cursor.movePosition(QTextCursor.EndOfLine, QTextCursor.KeepAnchor) + cursor.movePosition(fromPos) + cursor.movePosition(toPos, QTextCursor.KeepAnchor) returnValue = cursor.selectedText() cursor.setPosition(oldposition) return returnValue diff --git a/tests/system/suite_CSUP/tst_CSUP04/test.py b/tests/system/suite_CSUP/tst_CSUP04/test.py index d1d4180bef..6507db3289 100644 --- a/tests/system/suite_CSUP/tst_CSUP04/test.py +++ b/tests/system/suite_CSUP/tst_CSUP04/test.py @@ -65,7 +65,7 @@ def main(): return # wait until search finished and verify search results waitFor("searchFinished", 20000) - validateSearchResult(18) + validateSearchResult(14) result = re.search("QmlApplicationViewer", str(editorWidget.plainText)) test.verify(result, "Verifying if: The list of all usages of the selected text is displayed in Search Results. " "File with used text is opened.") diff --git a/tests/system/suite_HELP/tst_HELP04/test.py b/tests/system/suite_HELP/tst_HELP04/test.py index 42837a730a..e45c41e5c3 100755 --- a/tests/system/suite_HELP/tst_HELP04/test.py +++ b/tests/system/suite_HELP/tst_HELP04/test.py @@ -34,24 +34,34 @@ import re # test search in help mode and advanced search searchKeywordDictionary={ "deployment":True, "deplmint":False, "build":True, "bld":False } + def __getSelectedText__(): + hv = findObject(":Qt Creator_Help::Internal::HelpViewer") try: - selText = findObject(":Qt Creator_Help::Internal::HelpViewer").selectedText + selText = hv.selectedText if className(selText) != 'instancemethod': return str(selText) except: pass try: - hv = findObject(":Qt Creator_Help::Internal::HelpViewer") selText = getHighlightsInHtml(str(hv.toHtml())) except: test.warning("Could not get highlighted text.") selText = '' return str(selText) -def __handleTextChanged__(obj): - global textHasChanged - textHasChanged = True +def __getUrl__(): + helpViewer = findObject(":Qt Creator_Help::Internal::HelpViewer") + try: + url = helpViewer.url + except: + try: + url = helpViewer.source + except: + return "" + if isQt4Build: + return str(url.toString()) + return str(url.scheme) + "://" + str(url.host) + str(url.path) def getHighlightsInHtml(htmlCode): pattern = re.compile('color:#ff0000;">(.*?)</span>') @@ -60,16 +70,14 @@ def getHighlightsInHtml(htmlCode): if curr.group(1) in res: continue res += "%s " % curr.group(1) - test.log(res) return res def main(): - global sdkPath, textHasChanged + global sdkPath noMatch = "Your search did not match any documents." startApplication("qtcreator" + SettingsPath) if not startedWithoutPluginError(): return - installLazySignalHandler(":Qt Creator_Help::Internal::HelpViewer", "textChanged()", "__handleTextChanged__") addHelpDocumentation([os.path.join(sdkPath, "Documentation", "qt.qch")]) # switch to help mode switchViewTo(ViewConstants.HELP) @@ -98,13 +106,13 @@ def main(): test.verify(waitFor("re.match('[1-9]\d* - [1-9]\d* of [1-9]\d* Hits'," "str(findObject(':Hits_QLabel').text))", 2000), "Verifying if search results found with 1+ hits for: " + searchKeyword) - textHasChanged = False selText = __getSelectedText__() + url = __getUrl__() # click in the widget, tab to first item and press enter mouseClick(waitForObject(":Hits_QCLuceneResultWidget"), 1, 1, 0, Qt.LeftButton) type(waitForObject(":Hits_QCLuceneResultWidget"), "<Tab>") type(waitForObject(":Hits_QCLuceneResultWidget"), "<Return>") - waitFor("textHasChanged or selText != __getSelectedText__()") + waitFor("__getUrl__() != url or selText != __getSelectedText__()") # verify if search keyword is found in results test.verify(searchKeyword.lower() in __getSelectedText__().lower(), searchKeyword + " search result can be found") @@ -138,12 +146,12 @@ def main(): mouseClick(resultsView, 1, 1, 0, Qt.LeftButton) type(resultsView, "<Tab>") type(resultsView, "<Return>") - test.verify("printing" in str(findObject(":Qt Creator_Help::Internal::HelpViewer").selectedText).lower(), + test.verify("printing" in str(__getSelectedText__()).lower(), "printing advanced search result can be found") for i in range(2): type(resultsView, "<Tab>") type(resultsView, "<Return>") - test.verify("sql" in str(findObject(":Qt Creator_Help::Internal::HelpViewer").selectedText).lower(), + test.verify("sql" in str(__getSelectedText__()).lower(), "sql advanced search result can be found") # verify if simple search is properly disabled test.verify(findObject(":Qt Creator.Help_Search for:_QLineEdit").enabled == False, diff --git a/tests/system/suite_HELP/tst_HELP06/test.py b/tests/system/suite_HELP/tst_HELP06/test.py index 9e7c45e3c8..18ab04a353 100755 --- a/tests/system/suite_HELP/tst_HELP06/test.py +++ b/tests/system/suite_HELP/tst_HELP06/test.py @@ -59,10 +59,8 @@ def main(): manualQModelIndex = getQModelIndexStr("text?='Qt Creator Manual *'", ":Qt Creator_QHelpContentWidget") doubleClick(manualQModelIndex, 5, 5, 0, Qt.LeftButton) - gettingStartedQModelIndex = getQModelIndexStr("text='Getting Started'", manualQModelIndex) - doubleClick(gettingStartedQModelIndex, 5, 5, 0, Qt.LeftButton) mouseClick(waitForObject(getQModelIndexStr("text='Building and Running an Example'", - gettingStartedQModelIndex)), 5, 5, 0, Qt.LeftButton) + manualQModelIndex)), 5, 5, 0, Qt.LeftButton) # open bookmarks window clickButton(waitForObject(":Qt Creator.Add Bookmark_QToolButton")) clickButton(waitForObject(":Add Bookmark.ExpandBookmarksList_QToolButton")) diff --git a/tests/system/suite_debugger/tst_simple_analyze/test.py b/tests/system/suite_debugger/tst_simple_analyze/test.py index 06f6808532..e2865380cf 100644 --- a/tests/system/suite_debugger/tst_simple_analyze/test.py +++ b/tests/system/suite_debugger/tst_simple_analyze/test.py @@ -88,8 +88,8 @@ def main(): waitFor('"Elapsed: 5" in str(elapsedLabel.text)', 20000) clickButton(stopButton) if safeClickTab("JavaScript"): - model = waitForObject(":JavaScript.QmlProfilerEventsTable_QmlProfiler::" - "Internal::QV8ProfilerEventsMainView").model() + model = findObject(":JavaScript.QmlProfilerEventsTable_QmlProfiler::" + "Internal::QV8ProfilerEventsMainView").model() test.compare(model.rowCount(), 0) if safeClickTab("Events"): colPercent, colTotal, colCalls, colMean, colMedian, colLongest, colShortest = range(2, 9) diff --git a/tests/system/suite_editors/tst_basic_cpp_support/test.py b/tests/system/suite_editors/tst_basic_cpp_support/test.py index 91e6618243..106c45c5b6 100644 --- a/tests/system/suite_editors/tst_basic_cpp_support/test.py +++ b/tests/system/suite_editors/tst_basic_cpp_support/test.py @@ -92,9 +92,10 @@ def main(): if not waitFor("'dummy.cpp ' in str(mainWin.windowTitle) and ' - cplusplus-tools - ' in str(mainWin.windowTitle)", 5000): test.warning("Opening dummy.cpp seems to have failed") # Reset cursor to the start of the document - cursor = findObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget").textCursor() - cursor.movePosition(QTextCursor.Start) - cppwindow.setTextCursor(cursor) + if platform.system() == 'Darwin': + type(cppwindow, "<Home>") + else: + type(cppwindow, "<Ctrl+Home>") type(cppwindow, "<Ctrl+F>") clickButton(waitForObject(":*Qt Creator_Utils::IconButton")) diff --git a/tests/system/suite_general/tst_create_proj_wizard/test.py b/tests/system/suite_general/tst_create_proj_wizard/test.py index 77fee043a2..deab7eb5be 100644 --- a/tests/system/suite_general/tst_create_proj_wizard/test.py +++ b/tests/system/suite_general/tst_create_proj_wizard/test.py @@ -33,7 +33,7 @@ import re def main(): global tmpSettingsDir - global textChanged + quickCombinations = [[1,False], [2,False], [2,True]] 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)): @@ -42,9 +42,6 @@ def main(): startApplication("qtcreator" + SettingsPath) if not startedWithoutPluginError(): return - overrideInstallLazySignalHandler() - installLazySignalHandler(":frame.templateDescription_QTextBrowser", - "textChanged()","__handleTextChanged__") kits = getConfiguredKits() test.log("Collecting potential project types...") availableProjectTypes = [] @@ -71,59 +68,67 @@ def main(): for template in dumpItems(templatesView.model(), templatesView.rootIndex()): template = template.replace(".", "\\.") # skip non-configurable - if not (template in ("Qt Quick 1 UI", "Qt Quick 2 UI", "Qt Quick 2 UI with Controls") - or "(CMake Build)" in template or "(Qbs Build)" in template): + if (template != "Qt Quick UI" and "(CMake Build)" not in template + and "(Qbs Build)" not in template): availableProjectTypes.append({category:template}) clickButton(waitForObject("{text='Cancel' type='QPushButton' unnamed='1' visible='1'}")) for current in availableProjectTypes: category = current.keys()[0] template = current.values()[0] - invokeMenuItem("File", "New File or Project...") - selectFromCombo(waitForObject(":New.comboBox_QComboBox"), "All Templates") - categoriesView = waitForObject(":New.templateCategoryView_QTreeView") - clickItem(categoriesView, "Projects." + category, 5, 5, 0, Qt.LeftButton) - templatesView = waitForObject("{name='templatesView' type='QListView' visible='1'}") - test.log("Verifying '%s' -> '%s'" % (category.replace("\\.", "."), template.replace("\\.", "."))) - textChanged = False - clickItem(templatesView, template, 5, 5, 0, Qt.LeftButton) - waitFor("textChanged", 2000) - text = waitForObject(":frame.templateDescription_QTextBrowser").plainText - displayedPlatforms = __getSupportedPlatforms__(str(text), template, True)[0] - clickButton(waitForObject("{text='Choose...' type='QPushButton' unnamed='1' visible='1'}")) - # don't check because project could exist - __createProjectSetNameAndPath__(os.path.expanduser("~"), 'untitled', False) + displayedPlatforms = __createProject__(category, template) + if template == "Qt Quick Application": + for counter, qComb in enumerate(quickCombinations): + requiredQtVersion = __createProjectHandleQtQuickSelection__(qComb[0], qComb[1]) + __modifyAvailableTargets__(displayedPlatforms, requiredQtVersion, True) + verifyKitCheckboxes(kits, displayedPlatforms) + # FIXME: if QTBUG-35203 is fixed replace by triggering the shortcut for Back + clickButton(waitForObject("{type='QPushButton' text='Cancel'}")) + # are there more Quick combinations - then recreate this project + if counter < len(quickCombinations) - 1: + displayedPlatforms = __createProject__(category, template) + continue try: waitForObject("{name='mainQmlFileGroupBox' title='Main HTML File' type='QGroupBox' visible='1'}", 1000) clickButton(waitForObject(":Next_QPushButton")) except LookupError: - try: - waitForObject("{text='Select Existing QML file' type='QLabel' visible='1'}", 1000) - baseLineEd = waitForObject("{type='Utils::BaseValidatingLineEdit' unnamed='1' visible='1'}") - type(baseLineEd, os.path.join(templateDir, qmlFile)) - clickButton(waitForObject(":Next_QPushButton")) - except LookupError: - pass - waitForObject("{type='QLabel' unnamed='1' visible='1' text='Kit Selection'}") - availableCheckboxes = filter(visibleCheckBoxExists, kits.keys()) - # verification whether expected, found and configured match - for t in kits: - if t in displayedPlatforms: - if t in availableCheckboxes: - test.passes("Found expected kit '%s' on 'Kit Selection' page." % t) - availableCheckboxes.remove(t) - else: - test.fail("Expected kit '%s' missing on 'Kit Selection' page." % t) - else: - if t in availableCheckboxes: - test.fail("Kit '%s' found on 'Kit Selection' page - but was not expected!" % t) - else: - test.passes("Irrelevant kit '%s' not found on 'Kit Selection' page." % t) - if len(availableCheckboxes) != 0: - test.fail("Found unexpected additional kit(s) %s on 'Kit Selection' page." - % str(availableCheckboxes)) - clickButton(waitForObject("{text='Cancel' type='QPushButton' unnamed='1' visible='1'}")) + pass + verifyKitCheckboxes(kits, displayedPlatforms) + clickButton(waitForObject("{type='QPushButton' text='Cancel'}")) invokeMenuItem("File", "Exit") -def __handleTextChanged__(*args): - global textChanged - textChanged = True +def verifyKitCheckboxes(kits, displayedPlatforms): + waitForObject("{type='QLabel' unnamed='1' visible='1' text='Kit Selection'}") + availableCheckboxes = filter(visibleCheckBoxExists, kits.keys()) + # verification whether expected, found and configured match + for t in kits: + if t in displayedPlatforms: + if t in availableCheckboxes: + test.passes("Found expected kit '%s' on 'Kit Selection' page." % t) + availableCheckboxes.remove(t) + else: + test.fail("Expected kit '%s' missing on 'Kit Selection' page." % t) + else: + if t in availableCheckboxes: + test.fail("Kit '%s' found on 'Kit Selection' page - but was not expected!" % t) + else: + test.passes("Irrelevant kit '%s' not found on 'Kit Selection' page." % t) + if len(availableCheckboxes) != 0: + test.fail("Found unexpected additional kit(s) %s on 'Kit Selection' page." + % str(availableCheckboxes)) + +def __createProject__(category, template): + invokeMenuItem("File", "New File or Project...") + selectFromCombo(waitForObject(":New.comboBox_QComboBox"), "All Templates") + categoriesView = waitForObject(":New.templateCategoryView_QTreeView") + clickItem(categoriesView, "Projects." + category, 5, 5, 0, Qt.LeftButton) + templatesView = waitForObject("{name='templatesView' type='QListView' visible='1'}") + test.log("Verifying '%s' -> '%s'" % (category.replace("\\.", "."), template.replace("\\.", "."))) + textBrowser = findObject(":frame.templateDescription_QTextBrowser") + origTxt = str(textBrowser.plainText) + clickItem(templatesView, template, 5, 5, 0, Qt.LeftButton) + waitFor("origTxt != str(textBrowser.plainText)", 2000) + displayedPlatforms = __getSupportedPlatforms__(str(textBrowser.plainText), template, True)[0] + clickButton(waitForObject("{text='Choose...' type='QPushButton' unnamed='1' visible='1'}")) + # don't check because project could exist + __createProjectSetNameAndPath__(os.path.expanduser("~"), 'untitled', False) + return displayedPlatforms diff --git a/tests/system/suite_tools/tst_git_clone/test.py b/tests/system/suite_tools/tst_git_clone/test.py index 6ccbfb760b..576cc6d094 100644 --- a/tests/system/suite_tools/tst_git_clone/test.py +++ b/tests/system/suite_tools/tst_git_clone/test.py @@ -33,24 +33,28 @@ cloneUrl = "https://codereview.qt-project.org/p/qt-labs/jom" cloneDir = "myCloneOfJom" def verifyCloneLog(targetDir, canceled): + # Expect fails because of QTCREATORBUG-10531 cloneLog = waitForObject(":Git Repository Clone.logPlainTextEdit_QPlainTextEdit") - waitFor('"The process terminated " in str(cloneLog.plainText)', 30000) - test.verify(("Executing in " + targetDir + ":" in str(cloneLog.plainText)), - "Searching for target directory in clone log") - test.verify((" ".join(["clone", cloneUrl, cloneDir]) in str(cloneLog.plainText)), - "Searching for git parameters in clone log") - test.verify(("Stopping..." in str(cloneLog.plainText)) ^ (not canceled), - "Searching for 'Stopping...' in clone log") + finish = findObject(":Git Repository Clone.Finish_QPushButton") + waitFor("finish.enabled", 30000) + test.xverify(("Executing in " + targetDir + ":" in str(cloneLog.plainText)), + "Searching for target directory in clone log") + test.xverify((" ".join(["clone", cloneUrl, cloneDir]) in str(cloneLog.plainText)), + "Searching for git parameters in clone log") if canceled: + test.xverify("Stopping..." in str(cloneLog.plainText), + "Searching for 'Stopping...' in clone log") result = "The process terminated in an abnormal way." summary = "Failed." else: + test.verify(not "Stopping..." in str(cloneLog.plainText), + "Searching for 'Stopping...' in clone log") test.verify(("'" + cloneDir + "'..." in str(cloneLog.plainText)), "Searching for clone directory in clone log") result = "The process terminated with exit code 0." summary = "Succeeded." - test.verify((result in str(cloneLog.plainText)), - "Searching for result (%s) in clone log:\n%s" + test.xverify((result in str(cloneLog.plainText)), + "Searching for result (%s) in clone log:\n%s" % (result, str(cloneLog.plainText))) test.compare(waitForObject(":Git Repository Clone.Result._QLabel").text, summary) |