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
......@@ -181,9 +181,10 @@ def cleanUpUserFiles(pathsToProFiles=None):
def invokeMenuItem(menu, item, subItem = None):
menuObject = waitForObjectItem(":Qt Creator.QtCreator.MenuBar_QMenuBar", menu)
waitFor("menuObject.visible", 1000)
activateItem(menuObject)
itemObject = waitForObjectItem(objectMap.realName(menuObject), item)
waitFor("menuObject.visible", 1000)
waitFor("itemObject.enabled", 2000)
activateItem(itemObject)
if subItem != None:
sub = itemObject.menu()
......@@ -194,8 +195,11 @@ def logApplicationOutput():
# make sure application output is shown
ensureChecked("{type='Core::Internal::OutputPaneToggleButton' unnamed='1' visible='1' "
"window=':Qt Creator_Core::Internal::MainWindow' occurrence='3'}")
try:
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
def getOutputFromCmdline(cmdline):
......
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