diff options
author | Christian Stenger <christian.stenger@qt.io> | 2023-07-18 15:14:40 +0200 |
---|---|---|
committer | Christian Stenger <christian.stenger@qt.io> | 2023-07-18 13:23:15 +0000 |
commit | a86356ce8a38d24e1fee73225cbaf36c2ef83b39 (patch) | |
tree | 4f574cec6c9a9a04317f047b97ae2ab12673f8d4 | |
parent | c0b29f28c05f78d48f3356db0265aa5d47ca7577 (diff) |
Squish: Fix menu handling on macOSv11.0.0
Some menus inside QC have special numbering - but this only
applies to Linux and Windows. On macOS we do not add this
special numbering.
Additionally this patch stabilizes the triggering of
submenus. When they get triggered it takes a split of a
second until the items inside the menu are usable.
Let squish wait until the sub menu is fully present before
trying to activate some of its items.
Change-Id: I32c688a937ada1da07506d4ebd22730e4f2bcaef
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
-rw-r--r-- | tests/system/shared/utils.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/system/shared/utils.py b/tests/system/shared/utils.py index 6b99c8959d..2a17e0333c 100644 --- a/tests/system/shared/utils.py +++ b/tests/system/shared/utils.py @@ -171,6 +171,10 @@ def invokeMenuItem(menu, item, *subItems): numberedPrefix = "%d | " for subItem in subItems: # we might have numbered sub items (e.g. "Recent Files") - these have this special prefix + # but on macOS we don't add these prefixes + if platform.system() == 'Darwin' and subItem.startswith(numberedPrefix): + subItem = subItem[5:] + if subItem.startswith(numberedPrefix): triggered = False for i in range(1, 10): @@ -186,7 +190,10 @@ def invokeMenuItem(menu, item, *subItems): "Function arguments: '%s', '%s', %s" % (menu, item, str(subItems))) break # we failed to trigger - no need to process subItems further else: + noAmpersandItem = item.replace('&', '') + waitForObject("{type='QMenu' title='%s'}" % noAmpersandItem, 2000) itemObject = waitForObjectItem(itemObject, subItem) + waitFor("itemObject.enabled", 2000) activateItem(itemObject) |