mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
fix(frames): networkidle for iframes with quirky urls (#13767)
This commit is contained in:
parent
37bee74ae5
commit
c0f0979055
@ -468,6 +468,7 @@ export class Frame extends SdkObject {
|
||||
|
||||
this._firedLifecycleEvents.add('commit');
|
||||
this._subtreeLifecycleEvents.add('commit');
|
||||
this._startNetworkIdleTimer();
|
||||
}
|
||||
|
||||
isDetached(): boolean {
|
||||
|
||||
@ -180,3 +180,32 @@ it('should work for frame', async ({ page, server }) => {
|
||||
request.continue();
|
||||
await loadPromise;
|
||||
});
|
||||
|
||||
it('should work with javascript: iframe', async ({ page, server, browserName }) => {
|
||||
it.fixme(browserName === 'firefox', 'no load event');
|
||||
|
||||
await page.goto(server.EMPTY_PAGE);
|
||||
await page.setContent(`<iframe src="javascript:false"></iframe>`, { waitUntil: 'commit' });
|
||||
await page.waitForLoadState('domcontentloaded');
|
||||
await page.waitForLoadState('load');
|
||||
await page.waitForLoadState('networkidle');
|
||||
});
|
||||
|
||||
it('should work with broken data-url iframe', async ({ page, server }) => {
|
||||
await page.goto(server.EMPTY_PAGE);
|
||||
await page.setContent(`<iframe src="data:text/html"></iframe>`, { waitUntil: 'commit' });
|
||||
await page.waitForLoadState('domcontentloaded');
|
||||
await page.waitForLoadState('load');
|
||||
await page.waitForLoadState('networkidle');
|
||||
});
|
||||
|
||||
it('should work with broken blob-url iframe', async ({ page, server, browserName }) => {
|
||||
it.fixme(browserName === 'chromium', 'no load event');
|
||||
it.fixme(browserName === 'firefox', 'no load event');
|
||||
|
||||
await page.goto(server.EMPTY_PAGE);
|
||||
await page.setContent(`<iframe src="blob:"></iframe>`, { waitUntil: 'commit' });
|
||||
await page.waitForLoadState('domcontentloaded');
|
||||
await page.waitForLoadState('load');
|
||||
await page.waitForLoadState('networkidle');
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user