SquishTests: Use existing function saveAndExit()

Change-Id: I2e10de8b454a69b3e4ade7520b4fa00415bcde42
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Robert Löhning
2022-12-15 10:54:08 +01:00
parent 01dc87b100
commit 698a495972
10 changed files with 12 additions and 28 deletions

View File

@@ -209,8 +209,7 @@ def runVerify():
availableConfigs = iterateBuildConfigs() availableConfigs = iterateBuildConfigs()
if not availableConfigs: if not availableConfigs:
test.fatal("Haven't found build configurations, quitting") test.fatal("Haven't found build configurations, quitting")
invokeMenuItem("File", "Save All") saveAndExit()
invokeMenuItem("File", "Exit")
for kit, config in availableConfigs: for kit, config in availableConfigs:
selectBuildConfig(kit, config) selectBuildConfig(kit, config)
test.log("Using build config '%s'" % config) test.log("Using build config '%s'" % config)

View File

@@ -400,8 +400,7 @@ def openDocument(treeElement):
def earlyExit(details="No additional information"): def earlyExit(details="No additional information"):
test.fail("Something went wrong running this test", details) test.fail("Something went wrong running this test", details)
invokeMenuItem("File", "Save All") saveAndExit()
invokeMenuItem("File", "Exit")
def openDocumentPlaceCursor(doc, line, additionalFunction=None): def openDocumentPlaceCursor(doc, line, additionalFunction=None):
cppEditorStr = ":Qt Creator_CppEditor::Internal::CPPEditorWidget" cppEditorStr = ":Qt Creator_CppEditor::Internal::CPPEditorWidget"

View File

@@ -42,7 +42,5 @@ def main():
# wait for issues # wait for issues
test.verify(waitFor("issuesModel.rowCount() == 0", 3000), test.verify(waitFor("issuesModel.rowCount() == 0", 3000),
"Verifying if error was properly cleared after code fix") "Verifying if error was properly cleared after code fix")
#save and exit saveAndExit()
invokeMenuItem("File", "Save All")
invokeMenuItem("File", "Exit")

View File

@@ -46,16 +46,13 @@ def main():
waitForObjectItem(":Qt Creator_Utils::NavigationTreeView", addBranchWildcardToRoot(myCompTE), 1000) waitForObjectItem(":Qt Creator_Utils::NavigationTreeView", addBranchWildcardToRoot(myCompTE), 1000)
except: except:
test.fail("Refactoring failed - file MyComponent.qml was not generated properly in project explorer") test.fail("Refactoring failed - file MyComponent.qml was not generated properly in project explorer")
#save and exit saveAndExit()
invokeMenuItem("File", "Save All")
invokeMenuItem("File", "Exit")
return return
test.passes("Refactoring - file MyComponent.qml was generated properly in project explorer") test.passes("Refactoring - file MyComponent.qml was generated properly in project explorer")
# open MyComponent.qml file for verification # open MyComponent.qml file for verification
if not openDocument(myCompTE): if not openDocument(myCompTE):
test.fatal("Could not open MyComponent.qml.") test.fatal("Could not open MyComponent.qml.")
invokeMenuItem("File", "Save All") saveAndExit()
invokeMenuItem("File", "Exit")
return return
editorArea = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget") editorArea = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget")
codeText = str(editorArea.plainText) codeText = str(editorArea.plainText)

View File

@@ -19,8 +19,7 @@ def verifyNextLineIndented(editorArea, expectedIndentation):
def verifyIndentation(editorArea): def verifyIndentation(editorArea):
#verify indentation #verify indentation
if not placeCursorToLine(editorArea, "id: wdw"): if not placeCursorToLine(editorArea, "id: wdw"):
invokeMenuItem("File", "Save All") saveAndExit()
invokeMenuItem("File", "Exit")
return False return False
type(editorArea, "<Up>") type(editorArea, "<Up>")
expectedIndentations = [1,1,1,2,2,2,2,3,3,3,4,3,3,2,1] 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 # verify invoked indentation
if not verifyIndentation(editorArea): if not verifyIndentation(editorArea):
return return
# save and exit saveAndExit()
invokeMenuItem("File", "Save All")
invokeMenuItem("File", "Exit")

View File

@@ -196,9 +196,8 @@ def main():
if current.endswith(".lhs"): if current.endswith(".lhs"):
type(editor, ">") type(editor, ">")
type(editor, "<Tab>") type(editor, "<Tab>")
saveAndExit()
invokeMenuItem("File", "Save All")
invokeMenuItem("File", "Exit")
def init(): def init():
syntaxDirectory = __highlighterDefinitionsDirectory__() syntaxDirectory = __highlighterDefinitionsDirectory__()

View File

@@ -24,9 +24,7 @@ def main():
expectedHeaderName=headerName) expectedHeaderName=headerName)
if not testRenameMacroAfterSourceMoving(): if not testRenameMacroAfterSourceMoving():
return return
# save and exit saveAndExit()
invokeMenuItem("File", "Save All")
invokeMenuItem("File", "Exit")
def testRenameMacroAfterSourceModification(): def testRenameMacroAfterSourceModification():
def __deleteAnyClass__(): def __deleteAnyClass__():

View File

@@ -21,8 +21,7 @@ def main():
qmlFiles = [treebase + "focus\\.qml", treebase + "Core.ListMenu\\.qml"] qmlFiles = [treebase + "focus\\.qml", treebase + "Core.ListMenu\\.qml"]
checkOutlineFor(qmlFiles) checkOutlineFor(qmlFiles)
testModify() testModify()
invokeMenuItem("File", "Save All") saveAndExit()
invokeMenuItem("File", "Exit")
def checkOutlineFor(qmlFiles): def checkOutlineFor(qmlFiles):
for qmlFile in qmlFiles: for qmlFile in qmlFiles:

View File

@@ -46,5 +46,4 @@ def main():
'Comparing line "%s" to expected "%s"' % (lineUnderCursor(editor), "ui->%s" % buttonName)) 'Comparing line "%s" to expected "%s"' % (lineUnderCursor(editor), "ui->%s" % buttonName))
type(editor, "<Shift+Delete>") # Delete line type(editor, "<Shift+Delete>") # Delete line
selectFromLocator("mainwindow.ui") selectFromLocator("mainwindow.ui")
invokeMenuItem("File", "Save All") saveAndExit()
invokeMenuItem("File", "Exit")

View File

@@ -33,5 +33,4 @@ def main():
type(editor, "<Up>") type(editor, "<Up>")
test.verify(waitFor('str(lineUnderCursor(editor)).strip() == con[3]', 1000), test.verify(waitFor('str(lineUnderCursor(editor)).strip() == con[3]', 1000),
'Comparing line "%s" to expected "%s"' % (lineUnderCursor(editor), con[3])) 'Comparing line "%s" to expected "%s"' % (lineUnderCursor(editor), con[3]))
invokeMenuItem("File", "Save All") saveAndExit()
invokeMenuItem("File", "Exit")