test: unflake "should fail when frame detaches" (#9095)
This commit is contained in:
parent
e6f5404621
commit
b978ce33cb
|
|
@ -238,12 +238,10 @@ it('should fail when frame detaches', async ({page, server}) => {
|
||||||
await page.goto(server.PREFIX + '/frames/one-frame.html');
|
await page.goto(server.PREFIX + '/frames/one-frame.html');
|
||||||
const frame = page.frames()[1];
|
const frame = page.frames()[1];
|
||||||
server.setRoute('/empty.html', () => {});
|
server.setRoute('/empty.html', () => {});
|
||||||
let error = null;
|
const [error] = await Promise.all([
|
||||||
await Promise.all([
|
frame.waitForNavigation().catch(e => e),
|
||||||
frame.waitForNavigation().catch(e => error = e),
|
page.evaluate('var frame = document.querySelector("iframe"); frame.contentWindow.location.href = "/empty.html"; setTimeout(() => frame.remove())'),
|
||||||
frame.evaluate('window.location.href = "/empty.html"'),
|
]);
|
||||||
page.evaluate('setTimeout(() => document.querySelector("iframe").remove())'),
|
|
||||||
]).catch(e => error = e);
|
|
||||||
expect(error.message).toContain('waiting for navigation until "load"');
|
expect(error.message).toContain('waiting for navigation until "load"');
|
||||||
expect(error.message).toContain('frame was detached');
|
expect(error.message).toContain('frame was detached');
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue