aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorEike Ziller <eike.ziller@qt.io>2022-11-10 13:01:31 +0100
committerEike Ziller <eike.ziller@qt.io>2022-11-10 13:22:43 +0100
commit10dca6b37f9479396e9907ce53f7affadfbeeb5f (patch)
treebdc57f5ee38d261b6abcc5bd1c9c0dd40ddff305 /tests
parentc8fbc0b13c74b446312111a62a8c27a59318507f (diff)
parenta71c0368225c6ef3f0141fdb0f5893da946c0514 (diff)
Merge remote-tracking branch 'origin/9.0'
Diffstat (limited to 'tests')
-rw-r--r--tests/system/objects.map1
-rw-r--r--tests/system/suite_editors/tst_basic_cpp_support/test.py35
2 files changed, 18 insertions, 18 deletions
diff --git a/tests/system/objects.map b/tests/system/objects.map
index e8b28bea061..a6f3b23cdef 100644
--- a/tests/system/objects.map
+++ b/tests/system/objects.map
@@ -95,7 +95,6 @@
:New Text File.Add to project:_QLabel {name='projectLabel' text='Add to project:' type='QLabel' visible='1' window=':New_ProjectExplorer::JsonWizard'}
:New Text File.nameLineEdit_Utils::FileNameValidatingLineEdit {name='nameLineEdit' type='Utils::FileNameValidatingLineEdit' visible='1' window=':New_ProjectExplorer::JsonWizard'}
:New.comboBox_QComboBox {type='QComboBox' unnamed='1' visible='1' window=':New_Core::Internal::NewDialog'}
-:New.frame_QFrame {name='frame' type='QFrame' visible='1' window=':New_Core::Internal::NewDialog'}
:New.templateCategoryView_QTreeView {name='templateCategoryView' type='QTreeView' visible='1' window=':New_Core::Internal::NewDialog'}
:New_Core::Internal::NewDialog {name='Core.NewDialog' type='QDialog' visible='1' windowTitle?='New*'}
:New_ProjectExplorer::JsonWizard {type='ProjectExplorer::JsonWizard' unnamed='1' visible='1'}
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 c6da9872b4a..f68fc9d4fbe 100644
--- a/tests/system/suite_editors/tst_basic_cpp_support/test.py
+++ b/tests/system/suite_editors/tst_basic_cpp_support/test.py
@@ -3,6 +3,11 @@
source("../../shared/qtcreator.py")
+
+def waitForCppEditor():
+ return waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")
+
+
def main():
projectDir = os.path.join(srcPath, "creator", "tests", "manual", "cplusplus-tools")
proFileName = "cplusplus-tools.pro"
@@ -31,27 +36,26 @@ def main():
# t3 = t2.file()
# t4 = t3.fileName
# test.compare(editorManager.currentEditor().file().fileName, "base.cpp")
- cppwindow = waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")
# - Move the cursor to the usage of a variable.
# - Press F2 or select from the menu: Tools / C++ / Follow Symbol under Cursor
# Creator will show you the declaration of the variable.
- type(cppwindow, "<Ctrl+f>")
+ type(waitForCppEditor(), "<Ctrl+f>")
type(waitForObject(":*Qt Creator.findEdit_Utils::FilterLineEdit"), " xi")
type(waitForObject(":*Qt Creator.findEdit_Utils::FilterLineEdit"), "<Return>")
- __typeAndWaitForAction__(cppwindow, "<F2>")
- test.compare(lineUnderCursor(waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")), "extern int xi;")
+ __typeAndWaitForAction__(waitForCppEditor(), "<F2>")
+ test.compare(lineUnderCursor(waitForCppEditor()), "int xi = 10;")
# - Move the cursor to a function call.
# - Press F2 or select from the menu: Tools / C++ / Follow Symbol under Cursor
# Creator will show you the definition of the function.
- type(cppwindow, "<Ctrl+f>")
+ type(waitForCppEditor(), "<Ctrl+f>")
clickButton(waitForObject(":*Qt Creator_Utils::IconButton"))
type(waitForObject(":*Qt Creator.findEdit_Utils::FilterLineEdit"), "freefunc2")
type(waitForObject(":*Qt Creator.findEdit_Utils::FilterLineEdit"), "<Return>")
- __typeAndWaitForAction__(cppwindow, "<F2>")
- test.compare(lineUnderCursor(waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")), "int freefunc2(double)")
+ __typeAndWaitForAction__(waitForCppEditor(), "<F2>")
+ test.compare(lineUnderCursor(waitForCppEditor()), "int freefunc2(double)")
# - Move the cursor to a function declaration
# - Press Shift+F2 or select from menu: Tools / C++ / Switch Between Method Declaration/Definition
@@ -63,20 +67,18 @@ def main():
if not waitFor("str(mainWin.windowTitle).startswith('dummy.cpp ') 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
- jumpToFirstLine(cppwindow)
+ jumpToFirstLine(waitForCppEditor())
- type(cppwindow, "<Ctrl+f>")
+ type(waitForCppEditor(), "<Ctrl+f>")
clickButton(waitForObject(":*Qt Creator_Utils::IconButton"))
type(waitForObject(":*Qt Creator.findEdit_Utils::FilterLineEdit"), "Dummy::Dummy")
# Take us to the second instance
type(waitForObject(":*Qt Creator.findEdit_Utils::FilterLineEdit"), "<Return>")
- cppwindow = waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")
- __typeAndWaitForAction__(cppwindow, "<Shift+F2>")
- test.compare(lineUnderCursor(findObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")), " Dummy(int a);")
- cppwindow = waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")
+ __typeAndWaitForAction__(waitForCppEditor(), "<Shift+F2>")
+ test.compare(lineUnderCursor(waitForCppEditor()), " Dummy(int a);")
snooze(2)
- __typeAndWaitForAction__(cppwindow, "<Shift+F2>")
- test.compare(lineUnderCursor(findObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")), "Dummy::Dummy(int)")
+ __typeAndWaitForAction__(waitForCppEditor(), "<Shift+F2>")
+ test.compare(lineUnderCursor(waitForCppEditor()), "Dummy::Dummy(int)")
invokeMenuItem("File", "Exit")
def __typeAndWaitForAction__(editor, keyCombination):
@@ -88,7 +90,6 @@ def __typeAndWaitForAction__(editor, keyCombination):
def cppEditorPositionChanged(origPos):
try:
- editor = waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget", 500)
- return editor.textCursor().position() != origPos
+ return waitForCppEditor().textCursor().position() != origPos
except:
return False