Skip to content
Snippets Groups Projects
Commit a96cbcf3 authored by Christian Stenger's avatar Christian Stenger Committed by Robert Löhning
Browse files

Squish: Small fixes for utils.py


* invokeMenuItem(): changed order and additional
  waitFor to be more error-proof on Mac
* logApplicationOutput(): added try/except block
  for cases where no former run/debug could be found

Change-Id: I0d434fbb964e3d85e5ccb2a4c336e14e956f44ce
Reviewed-by: default avatarRobert Löhning <robert.loehning@nokia.com>
parent 5254e3e5
No related branches found
No related tags found
No related merge requests found
...@@ -181,9 +181,10 @@ def cleanUpUserFiles(pathsToProFiles=None): ...@@ -181,9 +181,10 @@ def cleanUpUserFiles(pathsToProFiles=None):
def invokeMenuItem(menu, item, subItem = None): def invokeMenuItem(menu, item, subItem = None):
menuObject = waitForObjectItem(":Qt Creator.QtCreator.MenuBar_QMenuBar", menu) menuObject = waitForObjectItem(":Qt Creator.QtCreator.MenuBar_QMenuBar", menu)
waitFor("menuObject.visible", 1000)
activateItem(menuObject) activateItem(menuObject)
itemObject = waitForObjectItem(objectMap.realName(menuObject), item) itemObject = waitForObjectItem(objectMap.realName(menuObject), item)
waitFor("menuObject.visible", 1000) waitFor("itemObject.enabled", 2000)
activateItem(itemObject) activateItem(itemObject)
if subItem != None: if subItem != None:
sub = itemObject.menu() sub = itemObject.menu()
...@@ -194,8 +195,11 @@ def logApplicationOutput(): ...@@ -194,8 +195,11 @@ def logApplicationOutput():
# make sure application output is shown # make sure application output is shown
ensureChecked("{type='Core::Internal::OutputPaneToggleButton' unnamed='1' visible='1' " ensureChecked("{type='Core::Internal::OutputPaneToggleButton' unnamed='1' visible='1' "
"window=':Qt Creator_Core::Internal::MainWindow' occurrence='3'}") "window=':Qt Creator_Core::Internal::MainWindow' occurrence='3'}")
output = waitForObject("{type='Core::OutputWindow' visible='1' windowTitle='Application Output Window'}", 20000) try:
test.log("Application Output:\n%s" % output.plainText) output = waitForObject("{type='Core::OutputWindow' visible='1' windowTitle='Application Output Window'}", 20000)
test.log("Application Output:\n%s" % output.plainText)
except:
test.fail("Could not find any Application Output - did the project run?")
# get the output from a given cmdline call # get the output from a given cmdline call
def getOutputFromCmdline(cmdline): def getOutputFromCmdline(cmdline):
......
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