diff options
author | Eike Ziller <eike.ziller@qt.io> | 2018-04-26 12:28:00 +0000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2018-04-26 12:28:00 +0000 |
commit | c1bfc9d0a45c8e1c891cc20d251da5e3dfd6a10d (patch) | |
tree | adfd42b81dc02b12d91fd45f3cbe5c6347b16bcc /tests | |
parent | e0c4da30a62630d39b8b04ee58da1c18b5eeb598 (diff) | |
parent | 62050437c3fc088d6bafc2fdce8bb6a7a3ae9394 (diff) |
Merge "Merge remote-tracking branch 'origin/4.6'"
Diffstat (limited to 'tests')
-rw-r--r-- | tests/system/README | 11 | ||||
-rw-r--r-- | tests/system/objects.map | 2 | ||||
-rw-r--r-- | tests/system/shared/utils.py | 19 | ||||
-rw-r--r--[-rwxr-xr-x] | tests/system/suite_HELP/tst_HELP04/test.py | 131 | ||||
-rw-r--r-- | tests/system/suite_SCOM/tst_SCOM04/test.py | 4 | ||||
-rw-r--r-- | tests/system/suite_general/tst_openqt_creator/testdata/projecttree_creator.tsv | 2 |
6 files changed, 82 insertions, 87 deletions
diff --git a/tests/system/README b/tests/system/README index b309c60753..703f11ea05 100644 --- a/tests/system/README +++ b/tests/system/README @@ -28,7 +28,11 @@ Second - some of the test suites/test cases expect a build of Qt 4.8.7 to be ava Third - some of the test suites/test cases expect Qt versions to be installed in their default locations. On Linux/macOS this is ~/Qt5.x.1 and on Windows this is C:\Qt\Qt5.x.1. It's easiest to use installations of the official opensource Qt packages. Just install the Qt version for the -respective toolchain and if possible the additional module Qt Script. Do not install Qt WebEngine. +respective toolchain with the components (if available): +- (Desktop) <toolchain> <bitness>, e.g. Desktop gcc 64-bit +- Qt Quick Controls +- Qt Script + The exact versions and toolchains are: Linux: @@ -59,8 +63,9 @@ Fifth - you'll have to make sure that some needed tools are available (no matter * wget or curl, capable of HTTPS Normally it should be okay to just install them as usual and add their executables' path(s) to the PATH variable. -Sixth - Qt Creator should be built with ClangCodeModel plugin. How to do so, see QTCREATOR_REPO/src/plugins/clangcodemodel/README. Without the -plugin, the tests for ClangCodeModel will be skipped but will not cause failures. +Sixth - Qt Creator must be built on a Qt without Qt WebEngine or Qt WebKit. Its ClangCodeModel +plugin should be built. How to do so, see QTCREATOR_REPO/README.md. Without the plugin, the tests +for ClangCodeModel will be skipped but will not cause failures. On macOS make sure you are using the correct keyboard layout to avoid problems when using keyboard interaction. Tested and known to be working would be 'U.S. International - PC', while pure 'U.S.' had problems. diff --git a/tests/system/objects.map b/tests/system/objects.map index 80f8e7ccac..2a0dcca039 100644 --- a/tests/system/objects.map +++ b/tests/system/objects.map @@ -88,6 +88,7 @@ :Help Widget_Help::Internal::HelpWidget {type='Help::Internal::HelpWidget' unnamed='1' visible='1' windowTitle?='Help -*'} :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'} +:Hits_QResultWidget {aboveWidget=':Hits_QLabel' type='QResultWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Kits_QtVersion_QComboBox {container=':qt_tabwidget_stackedwidget_QWidget' leftWidget=':QtVersionLabel_KitPage' type='QComboBox' unnamed='1' visible='1'} :Locals and Expressions_Debugger::Internal::WatchTreeView {container=':Debugger.Docks.LocalsAndWatchersDockWidget.Inspector_QFrame' name='WatchWindow' type='Debugger::Internal::WatchTreeView' visible='1'} :Minimal required Qt version:_QLabel {text='Minimal required Qt version:' type='QLabel' unnamed='1' visible='1' window=':New Text File_ProjectExplorer::JsonWizard'} @@ -155,7 +156,6 @@ :Qt Creator_FilenameQComboBox {type='QComboBox' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_Find::Internal::SearchResultTreeView {type='Core::Internal::SearchResultTreeView' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_Git::Internal::GitEditor {type='Git::Internal::GitEditorWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} -:Qt Creator_Help::Internal::HelpViewer {type='Help::Internal::QtWebKitHelpWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_HelpSelector_QComboBox {occurrence='3' type='QComboBox' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_Issues_Core::Internal::OutputPaneToggleButton {occurrence='1' type='Core::Internal::OutputPaneToggleButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} :Qt Creator_QHelpContentWidget {type='Utils::NavigationTreeView' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'} diff --git a/tests/system/shared/utils.py b/tests/system/shared/utils.py index e9209177eb..c8bd71da6f 100644 --- a/tests/system/shared/utils.py +++ b/tests/system/shared/utils.py @@ -683,20 +683,9 @@ def getChildByClass(parent, classToSearchFor, occurrence=1): return children[occurrence - 1] def getHelpViewer(): - try: - return waitForObject(":Qt Creator_Help::Internal::HelpViewer", 3000) - except: - pass - try: - return waitForObject("{type='QWebEngineView' unnamed='1' " - "visible='1' window=':Qt Creator_Core::Internal::MainWindow'}", 1000) - except: - return waitForObject("{type='Help::Internal::TextBrowserHelpWidget' unnamed='1' " - "visible='1' window=':Qt Creator_Core::Internal::MainWindow'}", 1000) + return waitForObject("{type='Help::Internal::TextBrowserHelpWidget' unnamed='1' " + "visible='1' window=':Qt Creator_Core::Internal::MainWindow'}", + 1000) def getHelpTitle(): - hv = getHelpViewer() - try: - return str(hv.title) - except: - return str(hv.documentTitle) + return str(getHelpViewer().documentTitle) diff --git a/tests/system/suite_HELP/tst_HELP04/test.py b/tests/system/suite_HELP/tst_HELP04/test.py index 344d3e20e4..29fa60c52d 100755..100644 --- a/tests/system/suite_HELP/tst_HELP04/test.py +++ b/tests/system/suite_HELP/tst_HELP04/test.py @@ -27,26 +27,23 @@ source("../../shared/qtcreator.py") import re # test search in help mode and advanced search -searchKeywordDictionary={ "deployment":True, "deplmint":False, "build":True, "bld":False } -urlDictionary = { "deployment":"qthelp://com.trolltech.qt.487/qdoc/gettingstarted-develop.html", - "build":"qthelp://com.trolltech.qt.487/qdoc/sql-driver.html" } +searchKeywordDictionary={ "abundance":True, "deplmint":False, "QODBC":True, "bld":False } +urlDictionary = { "abundance":"qthelp://com.trolltech.qt.487/qdoc/gettingstarted-develop.html", + "QODBC":"qthelp://com.trolltech.qt.487/qdoc/sql-driver.html" } def __getSelectedText__(): hv = getHelpViewer() - isWebEngineView = className(hv) == "QWebEngineView" try: - selText = hv.selectedText - if className(selText) != 'instancemethod': - return str(selText), isWebEngineView + return hv.textCursor().selectedText() except: pass try: - selText = getHighlightsInHtml(str(hv.toHtml())) + test.log("Falling back to searching for selection in HTML.") + return getHighlightsInHtml(str(hv.toHtml())) except: test.warning("Could not get highlighted text.") - selText = '' - return str(selText), isWebEngineView + return str("") def __getUrl__(): helpViewer = getHelpViewer() @@ -69,12 +66,7 @@ def getHighlightsInHtml(htmlCode): return res def verifySelection(expected): - selText, isWebEngineView = __getSelectedText__() - if isWebEngineView: - test.log("The search results are not a selection in a QWebEngineView", - "Searched strings should still be highlighted") - return - selText = str(selText) + selText = str(__getSelectedText__()) if test.verify(selText, "Verify that there is a selection"): # verify if search keyword is found in results test.verify(expected.lower() in selText.lower(), @@ -93,16 +85,26 @@ def main(): switchViewTo(ViewConstants.HELP) # verify that search widget is accessible mouseClick(waitForObjectItem(":Qt Creator_Core::Internal::CommandComboBox", "Search")) + snooze(1) # Looks like searching is still available for an instant test.verify(checkIfObjectExists("{type='QHelpSearchQueryWidget' unnamed='1' visible='1' " - "window=':Qt Creator_Core::Internal::MainWindow'}"), + "window=':Qt Creator_Core::Internal::MainWindow'}", + timeout=600000), "Verifying search widget visibility.") # try to search empty string clickButton(waitForObject("{text='Search' type='QPushButton' unnamed='1' visible='1' " "window=':Qt Creator_Core::Internal::MainWindow'}")) - progressBarWait(600000) - test.verify(waitFor("noMatch in " - "str(waitForObject(':Hits_QCLuceneResultWidget').plainText)", 2000), - "Verifying if search did not match anything.") + try: + # Creator built with Qt <= 5.8.0 + resultWidget = waitForObject(':Hits_QCLuceneResultWidget', 5000) + olderThan59 = True + except: + # Creator built with Qt >= 5.9.0 + resultWidget = waitForObject(':Hits_QResultWidget', 5000) + olderThan59 = False + if olderThan59 or not JIRA.isBugStillOpen(67737, JIRA.Bug.QT): + test.verify(waitFor("noMatch in " + "str(resultWidget.plainText)", 2000), + "Verifying if search did not match anything.") # workaround for "endless waiting cursor" mouseClick(waitForObject("{column='0' container=':Qt Creator_QHelpContentWidget' " "text='Qt Reference Documentation' type='QModelIndex'}")) @@ -119,54 +121,55 @@ 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) - selText = __getSelectedText__()[0] + 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("__getUrl__() != url or selText != __getSelectedText__()[0]", 20000) + mouseClick(resultWidget) + type(resultWidget, "<Tab>") + type(resultWidget, "<Return>") + waitFor("__getUrl__() != url or selText != __getSelectedText__()", 20000) verifySelection(searchKeyword) verifyUrl(urlDictionary[searchKeyword]) else: - test.verify(waitFor("noMatch in " - "str(waitForObject(':Hits_QCLuceneResultWidget').plainText)", 1000), - "Verifying if search did not match anything for: " + searchKeyword) - # advanced search - setup - clickButton(waitForObject("{text='+' type='QToolButton' unnamed='1' visible='1' " - "window=':Qt Creator_Core::Internal::MainWindow'}")) - label = ("{text='%s' type='QLabel' unnamed='1' visible='1' " - "window=':Qt Creator_Core::Internal::MainWindow'}") - lineEdit = ("{leftWidget=%s type='QLineEdit' unnamed='1' visible='1' " - "window=':Qt Creator_Core::Internal::MainWindow'}") - labelTextsToSearchStr = {"words <B>similar</B> to:":"deploy", - "<B>without</B> the words:":"bookmark", - "with <B>exact phrase</B>:":"sql in qt", - "with <B>all</B> of the words:":"designer sql", - "with <B>at least one</B> of the words:":"printing"} - for labelText,searchStr in labelTextsToSearchStr.items(): - type(waitForObject(lineEdit % (label % labelText)), searchStr) - # advanced search - do search - clickButton(waitForObject("{text='Search' type='QPushButton' unnamed='1' visible='1' " - "window=':Qt Creator_Core::Internal::MainWindow'}")) - progressBarWait(warn=False) - # verify that advanced search results found - test.verify(waitFor("re.search('1 - 2 of 2 Hits'," - "str(findObject(':Hits_QLabel').text))", 3000), - "Verifying if 2 search results found") - resultsView = waitForObject(":Hits_QCLuceneResultWidget") - mouseClick(resultsView, 1, 1, 0, Qt.LeftButton) - type(resultsView, "<Tab>") - type(resultsView, "<Return>") - verifySelection("printing") - verifyUrl("qthelp://com.trolltech.qt.487/qdoc/overviews.html") - for i in range(2): + if olderThan59 or not JIRA.isBugStillOpen(67737, JIRA.Bug.QT): + test.verify(waitFor("noMatch in " + "str(resultWidget.plainText)", 1000), + "Verifying if search did not match anything for: " + searchKeyword) + if olderThan59: + # advanced search - setup + clickButton(waitForObject("{text='+' type='QToolButton' unnamed='1' visible='1' " + "window=':Qt Creator_Core::Internal::MainWindow'}")) + label = ("{text='%s' type='QLabel' unnamed='1' visible='1' " + "window=':Qt Creator_Core::Internal::MainWindow'}") + lineEdit = ("{leftWidget=%s type='QLineEdit' unnamed='1' visible='1' " + "window=':Qt Creator_Core::Internal::MainWindow'}") + labelTextsToSearchStr = {"words <B>similar</B> to:":"deploy", + "<B>without</B> the words:":"bookmark", + "with <B>exact phrase</B>:":"sql in qt", + "with <B>all</B> of the words:":"designer sql", + "with <B>at least one</B> of the words:":"printing"} + for labelText,searchStr in labelTextsToSearchStr.items(): + type(waitForObject(lineEdit % (label % labelText)), searchStr) + # advanced search - do search + clickButton(waitForObject("{text='Search' type='QPushButton' unnamed='1' visible='1' " + "window=':Qt Creator_Core::Internal::MainWindow'}")) + progressBarWait(warn=False) + # verify that advanced search results found + test.verify(waitFor("re.search('1 - 2 of 2 Hits'," + "str(findObject(':Hits_QLabel').text))", 3000), + "Verifying if 2 search results found") + resultsView = waitForObject(":Hits_QCLuceneResultWidget") + mouseClick(resultsView, 1, 1, 0, Qt.LeftButton) type(resultsView, "<Tab>") - type(resultsView, "<Return>") - verifySelection("sql") - verifyUrl("qthelp://com.trolltech.qt.487/qdoc/best-practices.html") - # verify if simple search is properly disabled - test.verify(not searchLineEdit.enabled, - "Verifying if simple search is not active in advanced mode.") + type(resultsView, "<Return>") + verifySelection("printing") + verifyUrl("qthelp://com.trolltech.qt.487/qdoc/overviews.html") + for i in range(2): + type(resultsView, "<Tab>") + type(resultsView, "<Return>") + verifyUrl("qthelp://com.trolltech.qt.487/qdoc/best-practices.html") + # verify if simple search is properly disabled + test.verify(not searchLineEdit.enabled, + "Verifying if simple search is not active in advanced mode.") # exit invokeMenuItem("File", "Exit") diff --git a/tests/system/suite_SCOM/tst_SCOM04/test.py b/tests/system/suite_SCOM/tst_SCOM04/test.py index e7136cb0d4..a2590b6740 100644 --- a/tests/system/suite_SCOM/tst_SCOM04/test.py +++ b/tests/system/suite_SCOM/tst_SCOM04/test.py @@ -31,8 +31,8 @@ def main(): # expected error texts - for different compilers expectedErrorAlternatives = ["'SyntaxError' was not declared in this scope", "\xe2\x80\x98SyntaxError\xe2\x80\x99 was not declared in this scope", - "'SyntaxError' : undeclared identifier", - '"SyntaxError" : undeclared identifier', + "'SyntaxError' : undeclared identifier", # MSVC2013 + "'SyntaxError': undeclared identifier", # MSVC2015 "use of undeclared identifier 'SyntaxError'", "unknown type name 'SyntaxError'"] startApplication("qtcreator" + SettingsPath) diff --git a/tests/system/suite_general/tst_openqt_creator/testdata/projecttree_creator.tsv b/tests/system/suite_general/tst_openqt_creator/testdata/projecttree_creator.tsv index 5636987652..9ca1262ddb 100644 --- a/tests/system/suite_general/tst_openqt_creator/testdata/projecttree_creator.tsv +++ b/tests/system/suite_general/tst_openqt_creator/testdata/projecttree_creator.tsv @@ -7306,7 +7306,6 @@ "searchtaskhandler.h" "4" "searchwidget.h" "4" "textbrowserhelpviewer.h" "4" -"webenginehelpviewer.h" "4" "xbelsupport.h" "4" "Sources" "3" "centralwidget.cpp" "4" @@ -7328,7 +7327,6 @@ "searchtaskhandler.cpp" "4" "searchwidget.cpp" "4" "textbrowserhelpviewer.cpp" "4" -"webenginehelpviewer.cpp" "4" "xbelsupport.cpp" "4" "Forms" "3" "docsettingspage.ui" "4" |