Skip to content

Commit 38b5f76

Browse files
yury-saslushnikov
authored andcommitted
fix(test): wait for load state before checking opener of popup (#714)
1 parent 2bef4ae commit 38b5f76

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/page.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ module.exports.describe = function({testRunner, expect, headless, playwright, FF
143143
await page.goto(server.EMPTY_PAGE);
144144
await page.setContent('<a target=_blank rel="opener" href="/one-style.html">yo</a>');
145145
const [popup] = await Promise.all([
146-
new Promise(x => page.once('popup', x)),
146+
page.waitForEvent('popup').then(async popup => { await popup.waitForLoadState(); return popup; }),
147147
page.click('a'),
148148
]);
149149
expect(await page.evaluate(() => !!window.opener)).toBe(false);

0 commit comments

Comments
 (0)