summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRobert Löhning <robert.loehning@qt.io>2022-12-15 10:54:08 +0100
committerRobert Löhning <robert.loehning@qt.io>2022-12-15 14:45:42 +0000
commit698a49597214005a25db3244b28bfef5bfecf3fb (patch)
tree50766c7423a951f7f329fe9adbf949d61b2424ed /tests
parent01dc87b10001141b1516fe24316a02254b6e6f40 (diff)
downloadqt-creator-698a49597214005a25db3244b28bfef5bfecf3fb.tar.gz
SquishTests: Use existing function saveAndExit()
Change-Id: I2e10de8b454a69b3e4ade7520b4fa00415bcde42 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/system/shared/build_utils.py3
-rw-r--r--tests/system/shared/editor_utils.py3
-rw-r--r--tests/system/suite_QMLS/tst_QMLS02/test.py4
-rw-r--r--tests/system/suite_QMLS/tst_QMLS04/test.py7
-rw-r--r--tests/system/suite_QMLS/tst_QMLS08/test.py7
-rw-r--r--tests/system/suite_editors/tst_generic_highlighter/test.py3
-rw-r--r--tests/system/suite_editors/tst_rename_macros/test.py4
-rw-r--r--tests/system/suite_qtquick/tst_qml_outline/test.py3
-rw-r--r--tests/system/suite_tools/tst_designer_autocomplete/test.py3
-rw-r--r--tests/system/suite_tools/tst_designer_goto_slot/test.py3
10 files changed, 12 insertions, 28 deletions
diff --git a/tests/system/shared/build_utils.py b/tests/system/shared/build_utils.py
index 5d422f8ef0..05afc9c493 100644
--- a/tests/system/shared/build_utils.py
+++ b/tests/system/shared/build_utils.py
@@ -209,8 +209,7 @@ def runVerify():
availableConfigs = iterateBuildConfigs()
if not availableConfigs:
test.fatal("Haven't found build configurations, quitting")
- invokeMenuItem("File", "Save All")
- invokeMenuItem("File", "Exit")
+ saveAndExit()
for kit, config in availableConfigs:
selectBuildConfig(kit, config)
test.log("Using build config '%s'" % config)
diff --git a/tests/system/shared/editor_utils.py b/tests/system/shared/editor_utils.py
index 60ed802745..57a60fd6a9 100644
--- a/tests/system/shared/editor_utils.py
+++ b/tests/system/shared/editor_utils.py
@@ -400,8 +400,7 @@ def openDocument(treeElement):
def earlyExit(details="No additional information"):
test.fail("Something went wrong running this test", details)
- invokeMenuItem("File", "Save All")
- invokeMenuItem("File", "Exit")
+ saveAndExit()
def openDocumentPlaceCursor(doc, line, additionalFunction=None):
cppEditorStr = ":Qt Creator_CppEditor::Internal::CPPEditorWidget"
diff --git a/tests/system/suite_QMLS/tst_QMLS02/test.py b/tests/system/suite_QMLS/tst_QMLS02/test.py
index cc931ae323..c4bfdfd9ef 100644
--- a/tests/system/suite_QMLS/tst_QMLS02/test.py
+++ b/tests/system/suite_QMLS/tst_QMLS02/test.py
@@ -42,7 +42,5 @@ def main():
# wait for issues
test.verify(waitFor("issuesModel.rowCount() == 0", 3000),
"Verifying if error was properly cleared after code fix")
- #save and exit
- invokeMenuItem("File", "Save All")
- invokeMenuItem("File", "Exit")
+ saveAndExit()
diff --git a/tests/system/suite_QMLS/tst_QMLS04/test.py b/tests/system/suite_QMLS/tst_QMLS04/test.py
index 63db543bcb..2c42c178cc 100644
--- a/tests/system/suite_QMLS/tst_QMLS04/test.py
+++ b/tests/system/suite_QMLS/tst_QMLS04/test.py
@@ -46,16 +46,13 @@ def main():
waitForObjectItem(":Qt Creator_Utils::NavigationTreeView", addBranchWildcardToRoot(myCompTE), 1000)
except:
test.fail("Refactoring failed - file MyComponent.qml was not generated properly in project explorer")
- #save and exit
- invokeMenuItem("File", "Save All")
- invokeMenuItem("File", "Exit")
+ saveAndExit()
return
test.passes("Refactoring - file MyComponent.qml was generated properly in project explorer")
# open MyComponent.qml file for verification
if not openDocument(myCompTE):
test.fatal("Could not open MyComponent.qml.")
- invokeMenuItem("File", "Save All")
- invokeMenuItem("File", "Exit")
+ saveAndExit()
return
editorArea = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget")
codeText = str(editorArea.plainText)
diff --git a/tests/system/suite_QMLS/tst_QMLS08/test.py b/tests/system/suite_QMLS/tst_QMLS08/test.py
index 21def06251..7b7cca9979 100644
--- a/tests/system/suite_QMLS/tst_QMLS08/test.py
+++ b/tests/system/suite_QMLS/tst_QMLS08/test.py
@@ -19,8 +19,7 @@ def verifyNextLineIndented(editorArea, expectedIndentation):
def verifyIndentation(editorArea):
#verify indentation
if not placeCursorToLine(editorArea, "id: wdw"):
- invokeMenuItem("File", "Save All")
- invokeMenuItem("File", "Exit")
+ saveAndExit()
return False
type(editorArea, "<Up>")
expectedIndentations = [1,1,1,2,2,2,2,3,3,3,4,3,3,2,1]
@@ -58,6 +57,4 @@ def main():
# verify invoked indentation
if not verifyIndentation(editorArea):
return
- # save and exit
- invokeMenuItem("File", "Save All")
- invokeMenuItem("File", "Exit")
+ saveAndExit()
diff --git a/tests/system/suite_editors/tst_generic_highlighter/test.py b/tests/system/suite_editors/tst_generic_highlighter/test.py
index f1f154376e..490c602168 100644
--- a/tests/system/suite_editors/tst_generic_highlighter/test.py
+++ b/tests/system/suite_editors/tst_generic_highlighter/test.py
@@ -196,9 +196,8 @@ def main():
if current.endswith(".lhs"):
type(editor, ">")
type(editor, "<Tab>")
+ saveAndExit()
- invokeMenuItem("File", "Save All")
- invokeMenuItem("File", "Exit")
def init():
syntaxDirectory = __highlighterDefinitionsDirectory__()
diff --git a/tests/system/suite_editors/tst_rename_macros/test.py b/tests/system/suite_editors/tst_rename_macros/test.py
index cfa29e4986..6d329e4466 100644
--- a/tests/system/suite_editors/tst_rename_macros/test.py
+++ b/tests/system/suite_editors/tst_rename_macros/test.py
@@ -24,9 +24,7 @@ def main():
expectedHeaderName=headerName)
if not testRenameMacroAfterSourceMoving():
return
- # save and exit
- invokeMenuItem("File", "Save All")
- invokeMenuItem("File", "Exit")
+ saveAndExit()
def testRenameMacroAfterSourceModification():
def __deleteAnyClass__():
diff --git a/tests/system/suite_qtquick/tst_qml_outline/test.py b/tests/system/suite_qtquick/tst_qml_outline/test.py
index ddf4d368af..63de1001e1 100644
--- a/tests/system/suite_qtquick/tst_qml_outline/test.py
+++ b/tests/system/suite_qtquick/tst_qml_outline/test.py
@@ -21,8 +21,7 @@ def main():
qmlFiles = [treebase + "focus\\.qml", treebase + "Core.ListMenu\\.qml"]
checkOutlineFor(qmlFiles)
testModify()
- invokeMenuItem("File", "Save All")
- invokeMenuItem("File", "Exit")
+ saveAndExit()
def checkOutlineFor(qmlFiles):
for qmlFile in qmlFiles:
diff --git a/tests/system/suite_tools/tst_designer_autocomplete/test.py b/tests/system/suite_tools/tst_designer_autocomplete/test.py
index 229420a8b8..903ca01156 100644
--- a/tests/system/suite_tools/tst_designer_autocomplete/test.py
+++ b/tests/system/suite_tools/tst_designer_autocomplete/test.py
@@ -46,5 +46,4 @@ def main():
'Comparing line "%s" to expected "%s"' % (lineUnderCursor(editor), "ui->%s" % buttonName))
type(editor, "<Shift+Delete>") # Delete line
selectFromLocator("mainwindow.ui")
- invokeMenuItem("File", "Save All")
- invokeMenuItem("File", "Exit")
+ saveAndExit()
diff --git a/tests/system/suite_tools/tst_designer_goto_slot/test.py b/tests/system/suite_tools/tst_designer_goto_slot/test.py
index cb3c9eb743..c43846d7f8 100644
--- a/tests/system/suite_tools/tst_designer_goto_slot/test.py
+++ b/tests/system/suite_tools/tst_designer_goto_slot/test.py
@@ -33,5 +33,4 @@ def main():
type(editor, "<Up>")
test.verify(waitFor('str(lineUnderCursor(editor)).strip() == con[3]', 1000),
'Comparing line "%s" to expected "%s"' % (lineUnderCursor(editor), con[3]))
- invokeMenuItem("File", "Save All")
- invokeMenuItem("File", "Exit")
+ saveAndExit()