Skip to content

Commit

Permalink
Infrastructure: Fix regression test menu-button_links.js to wait for …
Browse files Browse the repository at this point in the history
…url change (pull #1921)
  • Loading branch information
zcorpan authored Jun 1, 2021
1 parent 092e3e1 commit 888ec1b
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions test/tests/menu-button_links.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,18 +262,27 @@ ariaTest('"enter" on role="menuitem"', exampleFile, 'menu-enter', async (t) => {
const item = (await t.context.queryElements(t, ex.menuitemSelector))[index];

// Update url to remove external reference for dependable testing
const newUrl = t.context.url + '#test-url-change';
const oldUrl = t.context.url;
const newUrl = oldUrl + '#test-url-change';
await replaceExternalLink(t, newUrl, ex.menuitemSelector, index);

await openMenu(t);
await item.sendKeys(Key.ENTER);

await t.context.session.wait(
async function () {
return t.context.session.getCurrentUrl() !== oldUrl;
},
t.context.waitTime,
'The URL did not change'
);

t.is(
await t.context.session.getCurrentUrl(),
newUrl,
'Key enter when focus on list item at index ' +
index +
'should active the link'
' should active the link'
);
}
});
Expand Down

0 comments on commit 888ec1b

Please sign in to comment.