Commit 8480c383 authored by Robert Loehning's avatar Robert Loehning Committed by Robert Löhning
Browse files

Squish: Added utility functions

Change-Id: I5ac2aabde688e86557ee364bb190e0230ba75822
Reviewed-by: default avatarChristian Stenger <>
parent 08f8b78f
......@@ -62,3 +62,13 @@ def replaceEditorContent(editor, newcontent):
type(editor, "<Ctrl+A>")
type(editor, "<Delete>")
type(editor, newcontent)
def typeLines(editor, lines):
if isinstance(lines, (str, unicode)):
lines = [lines]
if isinstance(lines, (list, tuple)):
for line in lines:
type(editor, line)
type(editor, "<Enter>")
test.warning("Illegal parameter passed to typeLines()")
......@@ -93,3 +93,13 @@ def switchToBuildOrRunSettingsFor(targetCount, currentTarget, projectSettings, i
mouseClick(targetSel, xToClick, yToClick, 0, Qt.LeftButton)
return True
# this function switches "Run in terminal" on or off in a project's run settings
# param targetCount specifies the number of targets currently defined (must be correct!)
# param currentTarget specifies the target for which to switch into the specified settings (zero based index)
# param runInTerminal specifies if "Run in terminal should be turned on (True) or off (False)
def setRunInTerminal(targetCount, currentTarget, runInTerminal=True):
switchToBuildOrRunSettingsFor(targetCount, currentTarget, ProjectSettings.RUN)
ensureChecked("{container=':Qt Creator.scrollArea_QScrollArea' text='Run in terminal'\
type='QCheckBox' unnamed='1' visible='1'}", runInTerminal)
......@@ -46,8 +46,7 @@ def subprocessFunction():
dragItemBy(textEdit, 30, 30, 50, 50, 0, Qt.LeftButton)
test.log("Test editing")
textEdit.cursorPosition = 0
type(textEdit, "This text is entered by Squish...")
type(textEdit, "<Return>")
typeLines(textEdit, "This text is entered by Squish...")
test.log("Closing QmlApplicationViewer")
sendEvent("QCloseEvent", "{type='QmlApplicationViewer' unnamed='1' visible='1'}")
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment