Skip to content

Commit

Permalink
test: unflake should fail when frame detaches
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelfeldman committed Mar 10, 2020
1 parent 59f2e88 commit 044f774
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions test/navigation.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1113,18 +1113,15 @@ module.exports.describe = function({testRunner, expect, playwright, MAC, WIN, FF
expect(response.frame()).toBe(frame);
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');
const frame = page.frames()[1];

server.setRoute('/empty.html', () => {});
let error = null;
await Promise.all([
frame.waitForNavigation().catch(e => error = e),
server.waitForRequest('/empty.html').then(() => {
page.$eval('iframe', frame => frame.remove());
}),
frame.evaluate(() => window.location = '/empty.html'),
frame.evaluate('window.location = "/empty.html"'),
page.evaluate('setTimeout(() => document.querySelector("iframe").remove())'),
]).catch(e => error = e);
expect(error.message).toContain('frame was detached');
});
Expand Down

0 comments on commit 044f774

Please sign in to comment.