From 856188e890cf281a42424df13f7ac79b0b31cf77 Mon Sep 17 00:00:00 2001 From: Stalgia Grigg Date: Wed, 4 Dec 2024 11:46:25 -0800 Subject: [PATCH] Add small delay to handle scroll event, disclosure_navigation_hybrid test --- test/tests/disclosure_navigation_hybrid.js | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/test/tests/disclosure_navigation_hybrid.js b/test/tests/disclosure_navigation_hybrid.js index cc5565163..24bebd57f 100644 --- a/test/tests/disclosure_navigation_hybrid.js +++ b/test/tests/disclosure_navigation_hybrid.js @@ -83,24 +83,10 @@ ariaTest( if (links.length > 0) { await buttons[b].click(); - let retries = 1; - let menuVisible = false; - - while (retries >= 0 && !menuVisible) { - await buttons[b].click(); - - menuVisible = await menus[b].isDisplayed(); - - if (!menuVisible && retries === 0) { - throw new Error( - `Failed to make menu ${b} visible after multiple attempts` - ); - } - retries--; - } - - t.true(menuVisible, `Menu ${b} should be visible before clicking link`); await links[0].click(); + // Add a small delay here to ensure that the scroll to focus event + // has time to complete and doesn't interfere with the next assertion + await t.context.session.sleep(300); t.is( await links[0].getAttribute('aria-current'),