Skip to content

Commit

Permalink
Example click retry logic for flakey macOS disclosure_navigation_hybr…
Browse files Browse the repository at this point in the history
…id test
  • Loading branch information
stalgiag committed Dec 4, 2024
1 parent 75bf788 commit 900f783
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/tests/disclosure_navigation_hybrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,24 @@ 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();

t.is(
Expand Down

0 comments on commit 900f783

Please sign in to comment.