From 7483ad1f1d760d024919ad2001170a46bed6ef7d Mon Sep 17 00:00:00 2001 From: Christian Stenger Date: Wed, 20 Mar 2019 09:48:43 +0100 Subject: [PATCH] Squish: Fix helper function for small resolutions Depending on the screen size the context menu may be oriented differently depending on the point where the context menu had been triggered. Change-Id: Iae3834283e8e34ed44e57237561f1367cdaae108 Reviewed-by: Robert Loehning --- tests/system/shared/editor_utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/system/shared/editor_utils.py b/tests/system/shared/editor_utils.py index d59280f161b..b1ea1bb1bd9 100644 --- a/tests/system/shared/editor_utils.py +++ b/tests/system/shared/editor_utils.py @@ -78,7 +78,10 @@ def menuVisibleAtEditor(editor, menuInList): return True return False menu = waitForObject("{type='QMenu' unnamed='1' visible='1'}", 500) - success = menu.visible and widgetContainsPoint(editor, menu.mapToGlobal(QPoint(0, 0))) + topLeft = menu.mapToGlobal(QPoint(0, 0)) + bottomLeft = menu.mapToGlobal(QPoint(0, menu.height)) + success = menu.visible and (widgetContainsPoint(editor, topLeft) + or widgetContainsPoint(editor, bottomLeft)) if success: menuInList[0] = menu return success