Skip to content

Commit 888ec1b

Browse files
authored
Infrastructure: Fix regression test menu-button_links.js to wait for url change (pull #1921)
1 parent 092e3e1 commit 888ec1b

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

test/tests/menu-button_links.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,18 +262,27 @@ ariaTest('"enter" on role="menuitem"', exampleFile, 'menu-enter', async (t) => {
262262
const item = (await t.context.queryElements(t, ex.menuitemSelector))[index];
263263

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

268269
await openMenu(t);
269270
await item.sendKeys(Key.ENTER);
270271

272+
await t.context.session.wait(
273+
async function () {
274+
return t.context.session.getCurrentUrl() !== oldUrl;
275+
},
276+
t.context.waitTime,
277+
'The URL did not change'
278+
);
279+
271280
t.is(
272281
await t.context.session.getCurrentUrl(),
273282
newUrl,
274283
'Key enter when focus on list item at index ' +
275284
index +
276-
'should active the link'
285+
' should active the link'
277286
);
278287
}
279288
});

0 commit comments

Comments
 (0)