diff options
author | Robert Loehning <robert.loehning@qt.io> | 2018-04-18 19:09:20 +0200 |
---|---|---|
committer | Robert Loehning <robert.loehning@qt.io> | 2018-04-19 14:06:03 +0000 |
commit | 0e216fda3e05b5ca16f6c231291cbda6b7140563 (patch) | |
tree | a878cf4ff666349a450fd146661b6b1fa515e32b | |
parent | d57ab7f6b9d00cf280cb4c44a12283a06051981c (diff) |
Squish: Don't expect WebEngine or WebKit
Change-Id: Ib44d0c7671b016c27e33ffd66e4797be37523ca3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
-rw-r--r-- | tests/system/README | 5 | ||||
-rw-r--r-- | tests/system/objects.map | 1 | ||||
-rw-r--r-- | tests/system/shared/utils.py | 19 | ||||
-rwxr-xr-x | tests/system/suite_HELP/tst_HELP04/test.py | 24 |
4 files changed, 12 insertions, 37 deletions
diff --git a/tests/system/README b/tests/system/README index b309c60753..5389e5232d 100644 --- a/tests/system/README +++ b/tests/system/README @@ -59,8 +59,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 fce477feb6..7805817f51 100644 --- a/tests/system/objects.map +++ b/tests/system/objects.map @@ -155,7 +155,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 05d62cab84..8985de2d27 100755 --- a/tests/system/suite_HELP/tst_HELP04/test.py +++ b/tests/system/suite_HELP/tst_HELP04/test.py @@ -33,20 +33,11 @@ urlDictionary = { "deployment":"qthelp://com.trolltech.qt.487/qdoc/gettingstarte def __getSelectedText__(): - hv = getHelpViewer() - isWebEngineView = className(hv) == "QWebEngineView" try: - selText = hv.selectedText - if className(selText) != 'instancemethod': - return str(selText), isWebEngineView - except: - pass - try: - selText = getHighlightsInHtml(str(hv.toHtml())) + return getHighlightsInHtml(str(getHelpViewer().toHtml())) except: test.warning("Could not get highlighted text.") - selText = '' - return str(selText), isWebEngineView + return str("") def __getUrl__(): helpViewer = getHelpViewer() @@ -69,12 +60,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(), @@ -118,13 +104,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) - 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) + waitFor("__getUrl__() != url or selText != __getSelectedText__()", 20000) verifySelection(searchKeyword) verifyUrl(urlDictionary[searchKeyword]) else: |