path: root/tests
diff options
authorRichard Moe Gustavsen <richard.gustavsen@qt.io>2020-09-03 22:54:36 +0200
committerRichard Moe Gustavsen <richard.gustavsen@qt.io>2020-09-04 10:36:19 +0200
commitb28e87700a9eb0b5971a13278c57efbb344826fc (patch)
treef0fe84a66c7ebe06b47d4931a29692c9983ed72f /tests
parentf872cdde2185390a07a5cb603f0a98c2304ac6cd (diff)
tst_qquickmenu: fix flaky test
The included test fails every now and then for Imagine, Fusion and Mac style. By using QTRY_VERIFY to wait a bit before we check if the menu is highlighted, it seems to pass each time. Change-Id: Ib8b207e1b5f81b3086595bb8ad7dc6881272def1 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'tests')
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/auto/qquickmenu/tst_qquickmenu.cpp b/tests/auto/qquickmenu/tst_qquickmenu.cpp
index d1b50357..b974a8e2 100644
--- a/tests/auto/qquickmenu/tst_qquickmenu.cpp
+++ b/tests/auto/qquickmenu/tst_qquickmenu.cpp
@@ -1194,7 +1194,7 @@ void tst_QQuickMenu::subMenuDisabledMouse()
// as e.g. Material style menus have transitions and don't close immediately.
QTRY_COMPARE(mainMenu->isVisible(), cascade);
- QVERIFY(menuItem1->isHighlighted());
+ QTRY_VERIFY(menuItem1->isHighlighted());
// Now the sub-menu is open. The current behavior is that the first menu item
// in the new menu is highlighted; make sure that we choose the next item if
// the first is disabled.