Skip to content
Snippets Groups Projects
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 <christian.stenger@nokia.com>
parent 08f8b78f
No related branches found
No related tags found
No related merge requests found
...@@ -62,3 +62,13 @@ def replaceEditorContent(editor, newcontent): ...@@ -62,3 +62,13 @@ def replaceEditorContent(editor, newcontent):
type(editor, "<Ctrl+A>") type(editor, "<Ctrl+A>")
type(editor, "<Delete>") type(editor, "<Delete>")
type(editor, newcontent) 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>")
else:
test.warning("Illegal parameter passed to typeLines()")
...@@ -93,3 +93,13 @@ def switchToBuildOrRunSettingsFor(targetCount, currentTarget, projectSettings, i ...@@ -93,3 +93,13 @@ def switchToBuildOrRunSettingsFor(targetCount, currentTarget, projectSettings, i
mouseClick(targetSel, xToClick, yToClick, 0, Qt.LeftButton) mouseClick(targetSel, xToClick, yToClick, 0, Qt.LeftButton)
return True 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):
switchViewTo(ViewConstants.PROJECTS)
switchToBuildOrRunSettingsFor(targetCount, currentTarget, ProjectSettings.RUN)
ensureChecked("{container=':Qt Creator.scrollArea_QScrollArea' text='Run in terminal'\
type='QCheckBox' unnamed='1' visible='1'}", runInTerminal)
switchViewTo(ViewConstants.EDIT)
...@@ -46,8 +46,7 @@ def subprocessFunction(): ...@@ -46,8 +46,7 @@ def subprocessFunction():
dragItemBy(textEdit, 30, 30, 50, 50, 0, Qt.LeftButton) dragItemBy(textEdit, 30, 30, 50, 50, 0, Qt.LeftButton)
test.log("Test editing") test.log("Test editing")
textEdit.cursorPosition = 0 textEdit.cursorPosition = 0
type(textEdit, "This text is entered by Squish...") typeLines(textEdit, "This text is entered by Squish...")
type(textEdit, "<Return>")
test.log("Closing QmlApplicationViewer") test.log("Closing QmlApplicationViewer")
sendEvent("QCloseEvent", "{type='QmlApplicationViewer' unnamed='1' visible='1'}") sendEvent("QCloseEvent", "{type='QmlApplicationViewer' unnamed='1' visible='1'}")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment