summaryrefslogtreecommitdiff
path: root/tests/system/suite_CSUP/tst_CSUP04/test.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/system/suite_CSUP/tst_CSUP04/test.py')
-rw-r--r--tests/system/suite_CSUP/tst_CSUP04/test.py75
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")