diff options
author | Robert Loehning <robert.loehning@qt.io> | 2017-09-01 15:23:34 +0200 |
---|---|---|
committer | Robert Loehning <robert.loehning@qt.io> | 2017-09-19 09:44:08 +0000 |
commit | b58dadfecc36255c0e64e0cc02e162e1595953b5 (patch) | |
tree | cb3dadea36499b1b0d7543f6fd41ef3f9426c68a /tests/system/suite_CSUP/tst_CSUP04 | |
parent | 2760b9fc67792d84a5abbbba0e1d774fb1883344 (diff) | |
download | qt-creator-b58dadfecc36255c0e64e0cc02e162e1595953b5.tar.gz |
Squish: Enclose code model tests in sections
Change-Id: I4478acfc5ea7b3fa22d1cd17576e04fdda81dbb9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'tests/system/suite_CSUP/tst_CSUP04')
-rw-r--r-- | tests/system/suite_CSUP/tst_CSUP04/test.py | 75 |
1 files changed, 38 insertions, 37 deletions
diff --git a/tests/system/suite_CSUP/tst_CSUP04/test.py b/tests/system/suite_CSUP/tst_CSUP04/test.py index 482a616f6d..a933ea5921 100644 --- a/tests/system/suite_CSUP/tst_CSUP04/test.py +++ b/tests/system/suite_CSUP/tst_CSUP04/test.py @@ -36,41 +36,42 @@ def main(): templateDir = prepareTemplate(sourceExample) examplePath = os.path.join(templateDir, proFile) for useClang in [False, True]: - if not startCreator(useClang): - continue - # open example project - openQmakeProject(examplePath) - # wait for parsing to complete - progressBarWait(30000) - checkCodeModelSettings(useClang) - # open .cpp file in editor - if not openDocument("property-animation.Sources.main\\.cpp"): - test.fatal("Could not open main.cpp") + with TestSection(getCodeModelString(useClang)): + if not startCreator(useClang): + continue + # open example project + openQmakeProject(examplePath) + # wait for parsing to complete + progressBarWait(30000) + checkCodeModelSettings(useClang) + # open .cpp file in editor + if not openDocument("property-animation.Sources.main\\.cpp"): + test.fatal("Could not open main.cpp") + invokeMenuItem("File", "Exit") + return + test.verify(checkIfObjectExists(":Qt Creator_CppEditor::Internal::CPPEditorWidget"), + "Verifying if: .cpp file is opened in Edit mode.") + # place cursor on line "QmlApplicationViewer viewer;" + editorWidget = findObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget") + # invoke find usages from context menu on word "viewer" + if not invokeFindUsage(editorWidget, "QmlApplicationViewer viewer;", "<Left>", 10): + invokeMenuItem("File", "Exit") + return + # wait until search finished and verify search results + waitForSearchResults() + validateSearchResult(21) + 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.") + # move cursor to the other word and test Find Usages function by pressing Ctrl+Shift+U. + openDocument("property-animation.Sources.main\\.cpp") + if not placeCursorToLine(editorWidget, "viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);"): + return + for i in range(4): + type(editorWidget, "<Left>") + type(editorWidget, "<Ctrl+Shift+u>") + # wait until search finished and verify search results + waitForSearchResults() + validateSearchResult(3) + invokeMenuItem("File", "Close All") invokeMenuItem("File", "Exit") - return - test.verify(checkIfObjectExists(":Qt Creator_CppEditor::Internal::CPPEditorWidget"), - "Verifying if: .cpp file is opened in Edit mode.") - # place cursor on line "QmlApplicationViewer viewer;" - editorWidget = findObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget") - # invoke find usages from context menu on word "viewer" - if not invokeFindUsage(editorWidget, "QmlApplicationViewer viewer;", "<Left>", 10): - invokeMenuItem("File", "Exit") - return - # wait until search finished and verify search results - waitForSearchResults() - validateSearchResult(21) - 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.") - # move cursor to the other word and test Find Usages function by pressing Ctrl+Shift+U. - openDocument("property-animation.Sources.main\\.cpp") - if not placeCursorToLine(editorWidget, "viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);"): - return - for i in range(4): - type(editorWidget, "<Left>") - type(editorWidget, "<Ctrl+Shift+u>") - # wait until search finished and verify search results - waitForSearchResults() - validateSearchResult(3) - invokeMenuItem("File", "Close All") - invokeMenuItem("File", "Exit") |