summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Stenger <christian.stenger@qt.io>2016-05-25 09:19:42 +0200
committerChristian Stenger <christian.stenger@qt.io>2016-05-26 13:31:25 +0000
commit2b57a1afa64004d11f0c54c9ac49a0f0de9d58cc (patch)
tree2b02d57d0e306a996be9fde58378b5b1eb57cc21
parent1f1a9e5870d20064fe240ba5bb47a46e4c5d776f (diff)
downloadqt-creator-2b57a1afa64004d11f0c54c9ac49a0f0de9d58cc.tar.gz
Squish: Fix handling of context menu on OSX
Change-Id: I6f5d50eca0199826e8af0f11016a1dfeb924f046 Reviewed-by: Robert Loehning <robert.loehning@qt.io>
-rw-r--r--tests/system/shared/editor_utils.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/system/shared/editor_utils.py b/tests/system/shared/editor_utils.py
index d9d2ac4fb3..3934cd3e78 100644
--- a/tests/system/shared/editor_utils.py
+++ b/tests/system/shared/editor_utils.py
@@ -345,17 +345,17 @@ def invokeContextMenuItem(editorArea, command1, command2 = None):
ctxtMenu = openContextMenuOnTextCursorPosition(editorArea)
snooze(1)
if platform.system() == 'Darwin':
- activateItem(ctxtMenu, command1)
+ item1 = waitForObjectItem(ctxtMenu, command1)
+ subMenu = item1.menu()
+ activateItem(item1)
+ # subMenu could have been triggered by hovering, but closed again by clicking
+ if subMenu and not subMenu.visible:
+ activateItem(item1)
+ if command2:
+ activateItem(subMenu, command2)
else:
activateItem(waitForObjectItem(objectMap.realName(ctxtMenu), command1, 2000))
- if command2:
- # Hack for Squish 5.0.1 handling menus of Qt5.2 on Mac (avoids crash) - remove asap
- if platform.system() == 'Darwin':
- for obj in object.topLevelObjects():
- if className(obj) == 'QMenu' and obj.visible and not obj == ctxtMenu:
- activateItem(obj, command2)
- break
- else:
+ if command2:
activateItem(waitForObjectItem("{title='%s' type='QMenu' visible='1' window=%s}"
% (command1, objectMap.realName(ctxtMenu)), command2, 2000))