test: unflake should fail when frame detaches
This commit is contained in:
parent
59f2e888ca
commit
044f774458
|
|
@ -1113,18 +1113,15 @@ module.exports.describe = function({testRunner, expect, playwright, MAC, WIN, FF
|
||||||
expect(response.frame()).toBe(frame);
|
expect(response.frame()).toBe(frame);
|
||||||
expect(page.url()).toContain('/frames/one-frame.html');
|
expect(page.url()).toContain('/frames/one-frame.html');
|
||||||
});
|
});
|
||||||
it.fail(true)('should fail when frame detaches', async({page, server}) => {
|
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;
|
let error = null;
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
frame.waitForNavigation().catch(e => error = e),
|
frame.waitForNavigation().catch(e => error = e),
|
||||||
server.waitForRequest('/empty.html').then(() => {
|
frame.evaluate('window.location = "/empty.html"'),
|
||||||
page.$eval('iframe', frame => frame.remove());
|
page.evaluate('setTimeout(() => document.querySelector("iframe").remove())'),
|
||||||
}),
|
|
||||||
frame.evaluate(() => window.location = '/empty.html'),
|
|
||||||
]).catch(e => error = e);
|
]).catch(e => error = e);
|
||||||
expect(error.message).toContain('frame was detached');
|
expect(error.message).toContain('frame was detached');
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue