mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
test: unflake network idle test (#17784)
Too slow on Firefox to fit 500ms network idle timeout.
This commit is contained in:
parent
06e0ea5e24
commit
f14f69624f
@ -156,17 +156,23 @@ it('should wait for networkidle from the popup', async ({ page, server }) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should wait for networkidle when iframe attaches and detaches', async ({ page }) => {
|
it('should wait for networkidle when iframe attaches and detaches', async ({ page, server }) => {
|
||||||
await page.setContent(`
|
server.setRoute('/empty.html', () => {});
|
||||||
|
let done = false;
|
||||||
|
const promise = page.setContent(`
|
||||||
<body>
|
<body>
|
||||||
<script>
|
<script>
|
||||||
setTimeout(() => {
|
const iframe = document.createElement('iframe');
|
||||||
const iframe = document.createElement('iframe');
|
iframe.src = ${JSON.stringify(server.EMPTY_PAGE)};
|
||||||
document.body.appendChild(iframe);
|
document.body.appendChild(iframe);
|
||||||
setTimeout(() => iframe.remove(), 400);
|
|
||||||
}, 400);
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
`, { waitUntil: 'networkidle' });
|
`, { waitUntil: 'networkidle' }).then(() => done = true);
|
||||||
expect(await page.$('iframe')).toBe(null);
|
await page.waitForTimeout(600);
|
||||||
|
expect(done).toBe(false);
|
||||||
|
await page.evaluate(() => {
|
||||||
|
document.querySelector('iframe').remove();
|
||||||
|
});
|
||||||
|
await promise;
|
||||||
|
expect(done).toBe(true);
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user