summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Loehning <robert.loehning@qt.io>2019-12-03 09:36:32 +0100
committerRobert Loehning <robert.loehning@qt.io>2020-01-21 10:20:07 +0000
commit68fbd15299847858c95c7991b812f80ae475ad28 (patch)
tree1ecc8072e3e6ee11b93cb5ce2df5aa08edca65db
parent4979b5286e1bcc85c18b2ce22d98d2858ebafebb (diff)
downloadqt-creator-68fbd15299847858c95c7991b812f80ae475ad28.tar.gz
Squish: Remove old hack for the Mac
Change-Id: I8655b8fe5a1a448995a3798fd587a01919129434 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
-rw-r--r--tests/system/shared/editor_utils.py7
-rw-r--r--tests/system/shared/project_explorer.py6
-rw-r--r--tests/system/shared/workarounds.py27
-rw-r--r--tests/system/suite_general/tst_rename_file/test.py12
-rw-r--r--tests/system/suite_general/tst_tasks_handling/test.py9
-rw-r--r--tests/system/suite_tools/tst_designer_autocomplete/test.py6
-rw-r--r--tests/system/suite_tools/tst_designer_goto_slot/test.py6
7 files changed, 10 insertions, 63 deletions
diff --git a/tests/system/shared/editor_utils.py b/tests/system/shared/editor_utils.py
index b1ea1bb1bd..8410e986ef 100644
--- a/tests/system/shared/editor_utils.py
+++ b/tests/system/shared/editor_utils.py
@@ -70,13 +70,6 @@ def placeCursorToLine(editor, line, isRegex=False):
def menuVisibleAtEditor(editor, menuInList):
menuInList[0] = None
try:
- # 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 widgetContainsPoint(editor, obj.mapToGlobal(QPoint(0, 0))):
- menuInList[0] = obj
- return True
- return False
menu = waitForObject("{type='QMenu' unnamed='1' visible='1'}", 500)
topLeft = menu.mapToGlobal(QPoint(0, 0))
bottomLeft = menu.mapToGlobal(QPoint(0, menu.height))
diff --git a/tests/system/shared/project_explorer.py b/tests/system/shared/project_explorer.py
index 60b3af9f20..01a2e81c99 100644
--- a/tests/system/shared/project_explorer.py
+++ b/tests/system/shared/project_explorer.py
@@ -143,11 +143,7 @@ def invokeContextMenuOnProject(projectName, menuItem):
return
openItemContextMenu(waitForObject(":Qt Creator_Utils::NavigationTreeView"),
str(projItem.text).replace("_", "\\_").replace(".", "\\."), 5, 5, 0)
- # Hack for Squish 5.0.1 handling menus of Qt5.2 on Mac (avoids crash) - remove asap
- if platform.system() == 'Darwin':
- waitFor("macHackActivateContextMenuItem(menuItem)", 6000)
- else:
- activateItem(waitForObjectItem("{name='Project.Menu.Project' type='QMenu' visible='1'}", menuItem))
+ activateItem(waitForObjectItem("{name='Project.Menu.Project' type='QMenu' visible='1'}", menuItem))
return projItem
def addAndActivateKit(kit):
diff --git a/tests/system/shared/workarounds.py b/tests/system/shared/workarounds.py
index 697625945f..ab8e338ad7 100644
--- a/tests/system/shared/workarounds.py
+++ b/tests/system/shared/workarounds.py
@@ -25,33 +25,6 @@
import urllib2
-############ functions not related to issues tracked inside jira ############
-
-def __checkWithoutWidget__(*args):
- return className(args[0]) == 'QMenu' and args[0].visible
-
-def __checkWithWidget__(*args):
- return (__checkWithoutWidget__(args[0])
- and widgetContainsPoint(waitForObject(args[1]), args[0].mapToGlobal(QPoint(0 ,0))))
-
-# hack for activating context menus on Mac because of Squish5/Qt5.2 problems
-# param item a string holding the menu item to invoke (just the label)
-# param widget an object; if provided there will be an additional check if the menu's top left
-# corner is placed on this widget
-def macHackActivateContextMenuItem(item, widget=None):
- if widget:
- func = __checkWithWidget__
- else:
- func = __checkWithoutWidget__
- for obj in object.topLevelObjects():
- try:
- if func(obj, widget):
- activateItem(waitForObjectItem(obj, item))
- return True
- except:
- pass
- return False
-
################ workarounds for issues tracked inside jira #################
JIRA_URL='https://bugreports.qt.io/browse'
diff --git a/tests/system/suite_general/tst_rename_file/test.py b/tests/system/suite_general/tst_rename_file/test.py
index a5568f85b5..5c296973b0 100644
--- a/tests/system/suite_general/tst_rename_file/test.py
+++ b/tests/system/suite_general/tst_rename_file/test.py
@@ -96,15 +96,11 @@ def renameFile(projectDir, proFile, branch, oldname, newname):
itemWithWildcard = addBranchWildcardToRoot(itemText)
waitForObjectItem(treeview, itemWithWildcard, 10000)
openItemContextMenu(treeview, itemWithWildcard, 5, 5, 0)
- # hack for Squish5/Qt5.2 problems of handling menus on Mac - remove asap
- if platform.system() == 'Darwin':
- waitFor("macHackActivateContextMenuItem('Rename...')", 5000)
+ if oldname.lower().endswith(".qrc"):
+ menu = ":Qt Creator.Project.Menu.Folder_QMenu"
else:
- if oldname.lower().endswith(".qrc"):
- menu = ":Qt Creator.Project.Menu.Folder_QMenu"
- else:
- menu = ":Qt Creator.Project.Menu.File_QMenu"
- activateItem(waitForObjectItem(menu, "Rename..."))
+ menu = ":Qt Creator.Project.Menu.File_QMenu"
+ activateItem(waitForObjectItem(menu, "Rename..."))
replaceEdit = waitForObject(":Qt Creator_Utils::NavigationTreeView::QExpandingLineEdit")
test.compare(replaceEdit.selectedText, oldname.rsplit(".", 1)[0],
"Only the filename without the extension is selected?")
diff --git a/tests/system/suite_general/tst_tasks_handling/test.py b/tests/system/suite_general/tst_tasks_handling/test.py
index d7acc4c940..429e711f5c 100644
--- a/tests/system/suite_general/tst_tasks_handling/test.py
+++ b/tests/system/suite_general/tst_tasks_handling/test.py
@@ -75,12 +75,9 @@ def generateMockTasksFile():
def checkOrUncheckMyTasks():
filterButton = waitForObject(toolButton % 'Filter by categories')
clickButton(filterButton)
- if platform.system() == 'Darwin':
- waitFor("macHackActivateContextMenuItem('My Tasks')", 5000)
- else:
- activateItem(waitForObjectItem("{type='QMenu' unnamed='1' visible='1' "
- "window=':Qt Creator_Core::Internal::MainWindow'}",
- "My Tasks"))
+ activateItem(waitForObjectItem("{type='QMenu' unnamed='1' visible='1' "
+ "window=':Qt Creator_Core::Internal::MainWindow'}",
+ "My Tasks"))
def getBuildIssuesTypeCounts(model):
issueTypes = map(lambda x: x.data(Qt.UserRole + 5).toInt(), dumpIndices(model))
diff --git a/tests/system/suite_tools/tst_designer_autocomplete/test.py b/tests/system/suite_tools/tst_designer_autocomplete/test.py
index 0b97efec6a..6e49d7ba48 100644
--- a/tests/system/suite_tools/tst_designer_autocomplete/test.py
+++ b/tests/system/suite_tools/tst_designer_autocomplete/test.py
@@ -38,11 +38,7 @@ def main():
if buttonName:
openContextMenu(waitForObject("{container=':*Qt Creator.FormEditorStack_Designer::Internal::FormEditorStack'"
"text='PushButton' type='QPushButton' visible='1'}"), 5, 5, 1)
- # hack for Squish5/Qt5.2 problems of handling menus on Mac - remove asap
- if platform.system() == 'Darwin':
- waitFor("macHackActivateContextMenuItem('Change objectName...')", 6000)
- else:
- activateItem(waitForObjectItem("{type='QMenu' unnamed='1' visible='1'}", "Change objectName..."))
+ activateItem(waitForObjectItem("{type='QMenu' unnamed='1' visible='1'}", "Change objectName..."))
typeLines(waitForObject(":FormEditorStack_qdesigner_internal::PropertyLineEdit"), buttonName)
else:
# Verify that everything works without ever changing the name
diff --git a/tests/system/suite_tools/tst_designer_goto_slot/test.py b/tests/system/suite_tools/tst_designer_goto_slot/test.py
index 11a1b4d671..5e6352454a 100644
--- a/tests/system/suite_tools/tst_designer_goto_slot/test.py
+++ b/tests/system/suite_tools/tst_designer_goto_slot/test.py
@@ -45,11 +45,7 @@ def main():
selectFromLocator("mainwindow.ui")
openContextMenu(waitForObject(con[0]), 5, 5, 0)
snooze(1)
- # hack for Squish 5/Qt5.2 problems of handling menus on Mac - remove asap
- if platform.system() == 'Darwin':
- waitFor("macHackActivateContextMenuItem('Go to slot...', con[0])", 6000)
- else:
- activateItem(waitForObjectItem("{type='QMenu' unnamed='1' visible='1'}", "Go to slot..."))
+ activateItem(waitForObjectItem("{type='QMenu' unnamed='1' visible='1'}", "Go to slot..."))
signalWidgetObject = waitForObject(":Select signal.signalList_QTreeView")
signalName = con[1] + "." + con[2]
mouseClick(waitForObjectItem(signalWidgetObject, signalName), 5, 5, 0, Qt.LeftButton)