From f710048c92c94698c7b6cac4be171020b94ee6ed Mon Sep 17 00:00:00 2001
From: Christian Stenger <christian.stenger@digia.com>
Date: Thu, 16 Jan 2014 17:37:08 +0100
Subject: [PATCH] Squish: Add workaround to avoid AUT crash on Mac

The crash was actually only in tst_SCOM05 as WELP suite is
completely disabled.

Change-Id: I32d9bef43dc50eb8d3c71a5b1d6e7894c7d74276
Reviewed-by: Robert Loehning <robert.loehning@digia.com>
---
 tests/system/shared/project_explorer.py | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/tests/system/shared/project_explorer.py b/tests/system/shared/project_explorer.py
index 528167c045..07f0fe6af8 100644
--- a/tests/system/shared/project_explorer.py
+++ b/tests/system/shared/project_explorer.py
@@ -299,6 +299,13 @@ def invokeContextMenuOnProject(projectName, menuItem):
             return
     openItemContextMenu(waitForObject(":Qt Creator_Utils::NavigationTreeView"),
                         str(projItem.text).replace("_", "\\_").replace(".", "\\."), 5, 5, 0)
-    activateItem(waitForObjectItem("{name='Project.Menu.Project' type='QMenu' visible='1' "
-                                   "window=':Qt Creator_Core::Internal::MainWindow'}", menuItem))
+    # 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):
+                activateItem(waitForObjectItem(obj, menuItem))
+                break
+    else:
+        activateItem(waitForObjectItem("{name='Project.Menu.Project' type='QMenu' visible='1' "
+                                       "window=':Qt Creator_Core::Internal::MainWindow'}", menuItem))
     return projItem
-- 
GitLab