chore: BiDi waitForNavigation (#10424)

This commit is contained in:
Nikolay Vitkov 2023-06-21 12:45:17 +02:00 committed by GitHub
parent a3fa4017ad
commit 337184e722
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 439 additions and 113 deletions

16
package-lock.json generated
View File

@ -3020,9 +3020,9 @@
} }
}, },
"node_modules/chromium-bidi": { "node_modules/chromium-bidi": {
"version": "0.4.12", "version": "0.4.13",
"resolved": "https://registry.npmjs.org/chromium-bidi/-/chromium-bidi-0.4.12.tgz", "resolved": "https://registry.npmjs.org/chromium-bidi/-/chromium-bidi-0.4.13.tgz",
"integrity": "sha512-yl0ngMHtYUGJa2G0lkcbPvbnUZ9WMQyMNSfYmlrGD1nHRNyI9KOGw3dOaofFugXHHToneUaSmF9iUdgCBamCjA==", "integrity": "sha512-9m2SY5DHI43OBQ7SMXjwp/iQaYo6iihqJ4IiD1OlrawGQTNveYYeJJt1yCqMxjp5y86m/uHxc9VooOWVlKFi4w==",
"dependencies": { "dependencies": {
"mitt": "3.0.0" "mitt": "3.0.0"
}, },
@ -10109,7 +10109,7 @@
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@puppeteer/browsers": "1.4.2", "@puppeteer/browsers": "1.4.2",
"chromium-bidi": "0.4.12", "chromium-bidi": "0.4.13",
"cross-fetch": "3.1.6", "cross-fetch": "3.1.6",
"debug": "4.3.4", "debug": "4.3.4",
"devtools-protocol": "0.0.1135028", "devtools-protocol": "0.0.1135028",
@ -12230,9 +12230,9 @@
} }
}, },
"chromium-bidi": { "chromium-bidi": {
"version": "0.4.12", "version": "0.4.13",
"resolved": "https://registry.npmjs.org/chromium-bidi/-/chromium-bidi-0.4.12.tgz", "resolved": "https://registry.npmjs.org/chromium-bidi/-/chromium-bidi-0.4.13.tgz",
"integrity": "sha512-yl0ngMHtYUGJa2G0lkcbPvbnUZ9WMQyMNSfYmlrGD1nHRNyI9KOGw3dOaofFugXHHToneUaSmF9iUdgCBamCjA==", "integrity": "sha512-9m2SY5DHI43OBQ7SMXjwp/iQaYo6iihqJ4IiD1OlrawGQTNveYYeJJt1yCqMxjp5y86m/uHxc9VooOWVlKFi4w==",
"requires": { "requires": {
"mitt": "3.0.0" "mitt": "3.0.0"
} }
@ -15653,7 +15653,7 @@
"version": "file:packages/puppeteer-core", "version": "file:packages/puppeteer-core",
"requires": { "requires": {
"@puppeteer/browsers": "1.4.2", "@puppeteer/browsers": "1.4.2",
"chromium-bidi": "0.4.12", "chromium-bidi": "0.4.13",
"cross-fetch": "3.1.6", "cross-fetch": "3.1.6",
"debug": "4.3.4", "debug": "4.3.4",
"devtools-protocol": "0.0.1135028", "devtools-protocol": "0.0.1135028",

View File

@ -133,7 +133,7 @@
"author": "The Chromium Authors", "author": "The Chromium Authors",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"chromium-bidi": "0.4.12", "chromium-bidi": "0.4.13",
"cross-fetch": "3.1.6", "cross-fetch": "3.1.6",
"debug": "4.3.4", "debug": "4.3.4",
"devtools-protocol": "0.0.1135028", "devtools-protocol": "0.0.1135028",

View File

@ -1548,10 +1548,9 @@ export class Page extends EventEmitter {
* API usage, the navigation will resolve with `null`. * API usage, the navigation will resolve with `null`.
*/ */
async waitForNavigation( async waitForNavigation(
options?: WaitForOptions options: WaitForOptions = {}
): Promise<HTTPResponse | null>; ): Promise<HTTPResponse | null> {
async waitForNavigation(): Promise<HTTPResponse | null> { return await this.mainFrame().waitForNavigation(options);
throw new Error('Not implemented');
} }
/** /**

View File

@ -885,12 +885,6 @@ export class CDPPage extends Page {
return result[0]; return result[0];
} }
override async waitForNavigation(
options: WaitForOptions = {}
): Promise<HTTPResponse | null> {
return await this.mainFrame().waitForNavigation(options);
}
override async waitForRequest( override async waitForRequest(
urlOrPredicate: string | ((req: HTTPRequest) => boolean | Promise<boolean>), urlOrPredicate: string | ((req: HTTPRequest) => boolean | Promise<boolean>),
options: {timeout?: number} = {} options: {timeout?: number} = {}

View File

@ -96,7 +96,10 @@ export class BrowserContext extends BrowserContextBase {
const {result} = await this.#connection.send('browsingContext.create', { const {result} = await this.#connection.send('browsingContext.create', {
type: 'tab', type: 'tab',
}); });
const page = new Page(this, result); const page = new Page(this, {
context: result.context,
children: [],
});
if (this.#defaultViewport) { if (this.#defaultViewport) {
try { try {
await page.setViewport(this.#defaultViewport); await page.setViewport(this.#defaultViewport);
@ -113,6 +116,10 @@ export class BrowserContext extends BrowserContextBase {
override async close(): Promise<void> { override async close(): Promise<void> {
await this.#init.valueOrThrow(); await this.#init.valueOrThrow();
if (this.#isDefault) {
throw new Error('Default context cannot be closed!');
}
for (const page of this.#pages.values()) { for (const page of this.#pages.values()) {
await page?.close().catch(error => { await page?.close().catch(error => {
debugError(error); debugError(error);

View File

@ -17,7 +17,10 @@ import {Realm} from './Realm.js';
/** /**
* @internal * @internal
*/ */
const lifeCycleToSubscribedEvent = new Map<PuppeteerLifeCycleEvent, string>([ export const lifeCycleToSubscribedEvent = new Map<
PuppeteerLifeCycleEvent,
string
>([
['load', 'browsingContext.load'], ['load', 'browsingContext.load'],
['domcontentloaded', 'browsingContext.domContentLoaded'], ['domcontentloaded', 'browsingContext.domContentLoaded'],
]); ]);
@ -87,7 +90,7 @@ export class CDPSessionWrapper extends EventEmitter implements CDPSession {
export class BrowsingContext extends Realm { export class BrowsingContext extends Realm {
#timeoutSettings: TimeoutSettings; #timeoutSettings: TimeoutSettings;
#id: string; #id: string;
#url = 'about:blank'; #url: string;
#cdpSession: CDPSession; #cdpSession: CDPSession;
constructor( constructor(
@ -99,7 +102,15 @@ export class BrowsingContext extends Realm {
this.connection = connection; this.connection = connection;
this.#timeoutSettings = timeoutSettings; this.#timeoutSettings = timeoutSettings;
this.#id = info.context; this.#id = info.context;
this.#url = info.url;
this.#cdpSession = new CDPSessionWrapper(this); this.#cdpSession = new CDPSessionWrapper(this);
this.on(
'browsingContext.fragmentNavigated',
(info: Bidi.BrowsingContext.NavigationInfo) => {
this.#url = info.url;
}
);
} }
createSandboxRealm(sandbox: string): Realm { createSandboxRealm(sandbox: string): Realm {
@ -118,6 +129,10 @@ export class BrowsingContext extends Realm {
return this.#cdpSession; return this.#cdpSession;
} }
navigated(url: string): void {
this.#url = url;
}
async goto( async goto(
url: string, url: string,
options: { options: {

View File

@ -14,15 +14,22 @@
* limitations under the License. * limitations under the License.
*/ */
import * as Bidi from 'chromium-bidi/lib/cjs/protocol/protocol.js';
import {ElementHandle} from '../../api/ElementHandle.js'; import {ElementHandle} from '../../api/ElementHandle.js';
import {Frame as BaseFrame} from '../../api/Frame.js'; import {Frame as BaseFrame} from '../../api/Frame.js';
import {Deferred} from '../../util/Deferred.js';
import {UTILITY_WORLD_NAME} from '../FrameManager.js'; import {UTILITY_WORLD_NAME} from '../FrameManager.js';
import {PuppeteerLifeCycleEvent} from '../LifecycleWatcher.js'; import {PuppeteerLifeCycleEvent} from '../LifecycleWatcher.js';
import {TimeoutSettings} from '../TimeoutSettings.js'; import {TimeoutSettings} from '../TimeoutSettings.js';
import {EvaluateFunc, EvaluateFuncWith, HandleFor, NodeFor} from '../types.js'; import {EvaluateFunc, EvaluateFuncWith, HandleFor, NodeFor} from '../types.js';
import {withSourcePuppeteerURLIfNone} from '../util.js'; import {waitForEvent, withSourcePuppeteerURLIfNone} from '../util.js';
import {BrowsingContext} from './BrowsingContext.js'; import {
BrowsingContext,
getWaitUntilSingle,
lifeCycleToSubscribedEvent,
} from './BrowsingContext.js';
import {HTTPResponse} from './HTTPResponse.js'; import {HTTPResponse} from './HTTPResponse.js';
import {Page} from './Page.js'; import {Page} from './Page.js';
import { import {
@ -39,6 +46,8 @@ import {
export class Frame extends BaseFrame { export class Frame extends BaseFrame {
#page: Page; #page: Page;
#context: BrowsingContext; #context: BrowsingContext;
#timeoutSettings: TimeoutSettings;
#abortDeferred = Deferred.create<Error>();
sandboxes: SandboxChart; sandboxes: SandboxChart;
override _id: string; override _id: string;
@ -51,6 +60,7 @@ export class Frame extends BaseFrame {
super(); super();
this.#page = page; this.#page = page;
this.#context = context; this.#context = context;
this.#timeoutSettings = timeoutSettings;
this._id = this.#context.id; this._id = this.#context.id;
this._parentId = parentId ?? undefined; this._parentId = parentId ?? undefined;
@ -114,17 +124,12 @@ export class Frame extends BaseFrame {
override async goto( override async goto(
url: string, url: string,
options?: options?: {
| { referer?: string;
referer?: string | undefined; referrerPolicy?: string;
referrerPolicy?: string | undefined; timeout?: number;
timeout?: number | undefined; waitUntil?: PuppeteerLifeCycleEvent | PuppeteerLifeCycleEvent[];
waitUntil?: }
| PuppeteerLifeCycleEvent
| PuppeteerLifeCycleEvent[]
| undefined;
}
| undefined
): Promise<HTTPResponse | null> { ): Promise<HTTPResponse | null> {
const navigationId = await this.#context.goto(url, options); const navigationId = await this.#context.goto(url, options);
return this.#page.getNavigationResponse(navigationId); return this.#page.getNavigationResponse(navigationId);
@ -155,13 +160,13 @@ export class Frame extends BaseFrame {
override $<Selector extends string>( override $<Selector extends string>(
selector: Selector selector: Selector
): Promise<ElementHandle<NodeFor<Selector>> | null> { ): Promise<ElementHandle<NodeFor<Selector>> | null> {
return this.sandboxes[MAIN_SANDBOX].$(selector); return this.mainRealm().$(selector);
} }
override $$<Selector extends string>( override $$<Selector extends string>(
selector: Selector selector: Selector
): Promise<Array<ElementHandle<NodeFor<Selector>>>> { ): Promise<Array<ElementHandle<NodeFor<Selector>>>> {
return this.sandboxes[MAIN_SANDBOX].$$(selector); return this.mainRealm().$$(selector);
} }
override $eval< override $eval<
@ -177,7 +182,7 @@ export class Frame extends BaseFrame {
...args: Params ...args: Params
): Promise<Awaited<ReturnType<Func>>> { ): Promise<Awaited<ReturnType<Func>>> {
pageFunction = withSourcePuppeteerURLIfNone(this.$eval.name, pageFunction); pageFunction = withSourcePuppeteerURLIfNone(this.$eval.name, pageFunction);
return this.sandboxes[MAIN_SANDBOX].$eval(selector, pageFunction, ...args); return this.mainRealm().$eval(selector, pageFunction, ...args);
} }
override $$eval< override $$eval<
@ -193,14 +198,54 @@ export class Frame extends BaseFrame {
...args: Params ...args: Params
): Promise<Awaited<ReturnType<Func>>> { ): Promise<Awaited<ReturnType<Func>>> {
pageFunction = withSourcePuppeteerURLIfNone(this.$$eval.name, pageFunction); pageFunction = withSourcePuppeteerURLIfNone(this.$$eval.name, pageFunction);
return this.sandboxes[MAIN_SANDBOX].$$eval(selector, pageFunction, ...args); return this.mainRealm().$$eval(selector, pageFunction, ...args);
} }
override $x(expression: string): Promise<Array<ElementHandle<Node>>> { override $x(expression: string): Promise<Array<ElementHandle<Node>>> {
return this.sandboxes[MAIN_SANDBOX].$x(expression); return this.mainRealm().$x(expression);
}
override async waitForNavigation(
options: {
timeout?: number;
waitUntil?: PuppeteerLifeCycleEvent | PuppeteerLifeCycleEvent[];
} = {}
): Promise<HTTPResponse | null> {
const {
waitUntil = 'load',
timeout = this.#timeoutSettings.navigationTimeout(),
} = options;
const waitUntilEvent = lifeCycleToSubscribedEvent.get(
getWaitUntilSingle(waitUntil)
) as string;
const [info] = await Promise.all([
waitForEvent<Bidi.BrowsingContext.NavigationInfo>(
this.#context,
waitUntilEvent,
() => {
return true;
},
timeout,
this.#abortDeferred.valueOrThrow()
),
waitForEvent(
this.#context,
Bidi.BrowsingContext.EventNames.FragmentNavigated,
() => {
return true;
},
timeout,
this.#abortDeferred.valueOrThrow()
),
]);
return this.#page.getNavigationResponse(info.navigation);
} }
dispose(): void { dispose(): void {
this.#abortDeferred.reject(new Error('Frame detached'));
this.#context.dispose(); this.#context.dispose();
} }
} }

View File

@ -16,6 +16,7 @@
import * as Bidi from 'chromium-bidi/lib/cjs/protocol/protocol.js'; import * as Bidi from 'chromium-bidi/lib/cjs/protocol/protocol.js';
import Protocol from 'devtools-protocol'; import Protocol from 'devtools-protocol';
import {Frame} from '../../api/Frame.js';
import { import {
HTTPResponse as BaseHTTPResponse, HTTPResponse as BaseHTTPResponse,
RemoteAddress, RemoteAddress,
@ -93,4 +94,8 @@ export class HTTPResponse extends BaseHTTPResponse {
override timing(): Protocol.Network.ResourceTiming | null { override timing(): Protocol.Network.ResourceTiming | null {
return this.#timings as any; return this.#timings as any;
} }
override frame(): Frame | null {
return this.#request.frame();
}
} }

View File

@ -35,7 +35,6 @@ import {Coverage} from '../Coverage.js';
import {EmulationManager} from '../EmulationManager.js'; import {EmulationManager} from '../EmulationManager.js';
import {TargetCloseError} from '../Errors.js'; import {TargetCloseError} from '../Errors.js';
import {Handler} from '../EventEmitter.js'; import {Handler} from '../EventEmitter.js';
import {FrameManagerEmittedEvents} from '../FrameManager.js';
import {FrameTree} from '../FrameTree.js'; import {FrameTree} from '../FrameTree.js';
import {NetworkManagerEmittedEvents} from '../NetworkManager.js'; import {NetworkManagerEmittedEvents} from '../NetworkManager.js';
import {PDFOptions} from '../PDFOptions.js'; import {PDFOptions} from '../PDFOptions.js';
@ -77,17 +76,10 @@ export class Page extends PageBase {
#closedDeferred = Deferred.create<TargetCloseError>(); #closedDeferred = Deferred.create<TargetCloseError>();
#subscribedEvents = new Map<string, Handler<any>>([ #subscribedEvents = new Map<string, Handler<any>>([
['log.entryAdded', this.#onLogEntryAdded.bind(this)], ['log.entryAdded', this.#onLogEntryAdded.bind(this)],
[ ['browsingContext.load', this.#onFrameLoaded.bind(this)],
'browsingContext.load',
() => {
return this.emit(PageEmittedEvents.Load);
},
],
[ [
'browsingContext.domContentLoaded', 'browsingContext.domContentLoaded',
() => { this.#onFrameDOMContentLoaded.bind(this),
return this.emit(PageEmittedEvents.DOMContentLoaded);
},
], ],
['browsingContext.contextCreated', this.#onFrameAttached.bind(this)], ['browsingContext.contextCreated', this.#onFrameAttached.bind(this)],
['browsingContext.contextDestroyed', this.#onFrameDetached.bind(this)], ['browsingContext.contextDestroyed', this.#onFrameDetached.bind(this)],
@ -96,33 +88,23 @@ export class Page extends PageBase {
#networkManagerEvents = new Map<symbol, Handler<any>>([ #networkManagerEvents = new Map<symbol, Handler<any>>([
[ [
NetworkManagerEmittedEvents.Request, NetworkManagerEmittedEvents.Request,
event => { this.emit.bind(this, PageEmittedEvents.Request),
return this.emit(PageEmittedEvents.Request, event);
},
], ],
[ [
NetworkManagerEmittedEvents.RequestServedFromCache, NetworkManagerEmittedEvents.RequestServedFromCache,
event => { this.emit.bind(this, PageEmittedEvents.RequestServedFromCache),
return this.emit(PageEmittedEvents.RequestServedFromCache, event);
},
], ],
[ [
NetworkManagerEmittedEvents.RequestFailed, NetworkManagerEmittedEvents.RequestFailed,
event => { this.emit.bind(this, PageEmittedEvents.RequestFailed),
return this.emit(PageEmittedEvents.RequestFailed, event);
},
], ],
[ [
NetworkManagerEmittedEvents.RequestFinished, NetworkManagerEmittedEvents.RequestFinished,
event => { this.emit.bind(this, PageEmittedEvents.RequestFinished),
return this.emit(PageEmittedEvents.RequestFinished, event);
},
], ],
[ [
NetworkManagerEmittedEvents.Response, NetworkManagerEmittedEvents.Response,
event => { this.emit.bind(this, PageEmittedEvents.Response),
return this.emit(PageEmittedEvents.Response, event);
},
], ],
]); ]);
#tracing: Tracing; #tracing: Tracing;
@ -132,7 +114,12 @@ export class Page extends PageBase {
#touchscreen: Touchscreen; #touchscreen: Touchscreen;
#keyboard: Keyboard; #keyboard: Keyboard;
constructor(browserContext: BrowserContext, info: {context: string}) { constructor(
browserContext: BrowserContext,
info: Omit<Bidi.BrowsingContext.Info, 'url'> & {
url?: string;
}
) {
super(); super();
this.#browserContext = browserContext; this.#browserContext = browserContext;
this.#connection = browserContext.connection; this.#connection = browserContext.connection;
@ -140,8 +127,8 @@ export class Page extends PageBase {
this.#networkManager = new NetworkManager(this.#connection, this); this.#networkManager = new NetworkManager(this.#connection, this);
this.#onFrameAttached({ this.#onFrameAttached({
...info, ...info,
url: 'about:blank', url: info.url ?? 'about:blank',
children: [], children: info.children ?? [],
}); });
for (const [event, subscriber] of this.#subscribedEvents) { for (const [event, subscriber] of this.#subscribedEvents) {
@ -216,6 +203,20 @@ export class Page extends PageBase {
return this.#frameTree.childFrames(frameId); return this.#frameTree.childFrames(frameId);
} }
#onFrameLoaded(info: Bidi.BrowsingContext.NavigationInfo): void {
const frame = this.frame(info.context);
if (frame && this.mainFrame() === frame) {
this.emit(PageEmittedEvents.Load);
}
}
#onFrameDOMContentLoaded(info: Bidi.BrowsingContext.NavigationInfo): void {
const frame = this.frame(info.context);
if (frame && this.mainFrame() === frame) {
this.emit(PageEmittedEvents.DOMContentLoaded);
}
}
#onFrameAttached(info: Bidi.BrowsingContext.Info): void { #onFrameAttached(info: Bidi.BrowsingContext.Info): void {
if ( if (
!this.frame(info.context) && !this.frame(info.context) &&
@ -235,7 +236,7 @@ export class Page extends PageBase {
info.parent info.parent
); );
this.#frameTree.addFrame(frame); this.#frameTree.addFrame(frame);
this.emit(FrameManagerEmittedEvents.FrameAttached, frame); this.emit(PageEmittedEvents.FrameAttached, frame);
} }
} }
@ -247,12 +248,8 @@ export class Page extends PageBase {
let frame = this.frame(frameId); let frame = this.frame(frameId);
// Detach all child frames first. // Detach all child frames first.
if (frame) { if (frame) {
for (const child of frame.childFrames()) {
this.#removeFramesRecursively(child);
}
frame = await this.#frameTree.waitForFrame(frameId); frame = await this.#frameTree.waitForFrame(frameId);
this.emit(FrameManagerEmittedEvents.FrameNavigated, frame); this.emit(PageEmittedEvents.FrameNavigated, frame);
} }
} }
@ -260,6 +257,9 @@ export class Page extends PageBase {
const frame = this.frame(info.context); const frame = this.frame(info.context);
if (frame) { if (frame) {
if (frame === this.mainFrame()) {
this.emit(PageEmittedEvents.Close);
}
this.#removeFramesRecursively(frame); this.#removeFramesRecursively(frame);
} }
} }
@ -270,7 +270,7 @@ export class Page extends PageBase {
} }
frame.dispose(); frame.dispose();
this.#frameTree.removeFrame(frame); this.#frameTree.removeFrame(frame);
this.emit(FrameManagerEmittedEvents.FrameDetached, frame); this.emit(PageEmittedEvents.FrameDetached, frame);
} }
#onLogEntryAdded(event: Bidi.Log.LogEntry): void { #onLogEntryAdded(event: Bidi.Log.LogEntry): void {
@ -337,12 +337,13 @@ export class Page extends PageBase {
return; return;
} }
this.#closedDeferred.resolve(new TargetCloseError('Page closed!')); this.#closedDeferred.resolve(new TargetCloseError('Page closed!'));
this.removeAllListeners();
this.#networkManager.dispose(); this.#networkManager.dispose();
await this.#connection.send('browsingContext.close', { await this.#connection.send('browsingContext.close', {
context: this.mainFrame()._id, context: this.mainFrame()._id,
}); });
this.emit(PageEmittedEvents.Close);
this.removeAllListeners();
} }
override async evaluateHandle< override async evaluateHandle<

View File

@ -87,7 +87,7 @@
"testIdPattern": "[navigation.spec] navigation Frame.waitForNavigation *", "testIdPattern": "[navigation.spec] navigation Frame.waitForNavigation *",
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],
"parameters": ["webDriverBiDi"], "parameters": ["webDriverBiDi"],
"expectations": ["FAIL", "TIMEOUT"] "expectations": ["PASS"]
}, },
{ {
"testIdPattern": "[navigation.spec] navigation Page.goBack *", "testIdPattern": "[navigation.spec] navigation Page.goBack *",
@ -95,12 +95,6 @@
"parameters": ["webDriverBiDi"], "parameters": ["webDriverBiDi"],
"expectations": ["FAIL"] "expectations": ["FAIL"]
}, },
{
"testIdPattern": "[navigation.spec] navigation Page.waitForNavigation *",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["webDriverBiDi"],
"expectations": ["FAIL", "TIMEOUT"]
},
{ {
"testIdPattern": "[network.spec] network *", "testIdPattern": "[network.spec] network *",
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],
@ -359,12 +353,6 @@
"parameters": ["webDriverBiDi"], "parameters": ["webDriverBiDi"],
"expectations": ["PASS"] "expectations": ["PASS"]
}, },
{
"testIdPattern": "[click.spec] Page.click should click on checkbox input and toggle",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["webDriverBiDi"],
"expectations": ["PASS"]
},
{ {
"testIdPattern": "[click.spec] Page.click should click on checkbox label and toggle", "testIdPattern": "[click.spec] Page.click should click on checkbox label and toggle",
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],
@ -593,12 +581,6 @@
"parameters": ["webDriverBiDi"], "parameters": ["webDriverBiDi"],
"expectations": ["FAIL"] "expectations": ["FAIL"]
}, },
{
"testIdPattern": "[evaluation.spec] Evaluation specs Page.evaluate should work right after framenavigated",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["webDriverBiDi"],
"expectations": ["FAIL", "TIMEOUT"]
},
{ {
"testIdPattern": "[evaluation.spec] Evaluation specs Page.evaluateOnNewDocument *", "testIdPattern": "[evaluation.spec] Evaluation specs Page.evaluateOnNewDocument *",
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],
@ -629,18 +611,6 @@
"parameters": ["webDriverBiDi"], "parameters": ["webDriverBiDi"],
"expectations": ["PASS"] "expectations": ["PASS"]
}, },
{
"testIdPattern": "[frame.spec] Frame specs Frame Management should report frame from-inside shadow DOM",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["webDriverBiDi"],
"expectations": ["FAIL"]
},
{
"testIdPattern": "[frame.spec] Frame specs Frame Management should support url fragment",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["webDriverBiDi"],
"expectations": ["FAIL"]
},
{ {
"testIdPattern": "[frame.spec] Frame specs Frame.evaluate allows readonly array to be an argument", "testIdPattern": "[frame.spec] Frame specs Frame.evaluate allows readonly array to be an argument",
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],
@ -837,7 +807,7 @@
"testIdPattern": "[launcher.spec] Launcher specs Puppeteer Puppeteer.launch should have custom URL when launching browser", "testIdPattern": "[launcher.spec] Launcher specs Puppeteer Puppeteer.launch should have custom URL when launching browser",
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],
"parameters": ["webDriverBiDi"], "parameters": ["webDriverBiDi"],
"expectations": ["FAIL"] "expectations": ["SKIP"]
}, },
{ {
"testIdPattern": "[launcher.spec] Launcher specs Puppeteer Puppeteer.launch should take fullPage screenshots when defaultViewport is null", "testIdPattern": "[launcher.spec] Launcher specs Puppeteer Puppeteer.launch should take fullPage screenshots when defaultViewport is null",
@ -911,6 +881,30 @@
"parameters": ["webDriverBiDi"], "parameters": ["webDriverBiDi"],
"expectations": ["PASS"] "expectations": ["PASS"]
}, },
{
"testIdPattern": "[mouse.spec] Mouse should click the document",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["webDriverBiDi"],
"expectations": ["PASS"]
},
{
"testIdPattern": "[mouse.spec] Mouse should not throw if clicking in parallel",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["webDriverBiDi"],
"expectations": ["PASS"]
},
{
"testIdPattern": "[mouse.spec] Mouse should trigger hover state",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["webDriverBiDi"],
"expectations": ["PASS"]
},
{
"testIdPattern": "[mouse.spec] Mouse should trigger hover state with removed window.Node",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["webDriverBiDi"],
"expectations": ["PASS"]
},
{ {
"testIdPattern": "[navigation.spec] navigation \"after each\" hook for \"should work with both domcontentloaded and load\"", "testIdPattern": "[navigation.spec] navigation \"after each\" hook for \"should work with both domcontentloaded and load\"",
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],
@ -959,6 +953,36 @@
"parameters": ["webDriverBiDi"], "parameters": ["webDriverBiDi"],
"expectations": ["FAIL"] "expectations": ["FAIL"]
}, },
{
"testIdPattern": "[navigation.spec] navigation Page.waitForNavigation *",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["chrome", "webDriverBiDi"],
"expectations": ["PASS"]
},
{
"testIdPattern": "[navigation.spec] navigation Page.waitForNavigation should work with clicking on anchor links",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["webDriverBiDi"],
"expectations": ["TIMEOUT"]
},
{
"testIdPattern": "[navigation.spec] navigation Page.waitForNavigation should work with DOM history.back()/history.forward()",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["webDriverBiDi"],
"expectations": ["FAIL", "TIMEOUT"]
},
{
"testIdPattern": "[navigation.spec] navigation Page.waitForNavigation should work with history.pushState()",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["webDriverBiDi"],
"expectations": ["TIMEOUT"]
},
{
"testIdPattern": "[navigation.spec] navigation Page.waitForNavigation should work with history.replaceState()",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["webDriverBiDi"],
"expectations": ["TIMEOUT"]
},
{ {
"testIdPattern": "[network.spec] network Network Events Page.Events.RequestFinished", "testIdPattern": "[network.spec] network Network Events Page.Events.RequestFinished",
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],
@ -1079,12 +1103,24 @@
"parameters": ["cdp", "firefox"], "parameters": ["cdp", "firefox"],
"expectations": ["SKIP"] "expectations": ["SKIP"]
}, },
{
"testIdPattern": "[page.spec] Page Page.close should *not* run beforeunload by default",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["chrome", "webDriverBiDi"],
"expectations": ["PASS"]
},
{ {
"testIdPattern": "[page.spec] Page Page.close should reject all promises when page is closed", "testIdPattern": "[page.spec] Page Page.close should reject all promises when page is closed",
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],
"parameters": ["webDriverBiDi"], "parameters": ["webDriverBiDi"],
"expectations": ["PASS"] "expectations": ["PASS"]
}, },
{
"testIdPattern": "[page.spec] Page Page.Events.Close should work with page.close",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["webDriverBiDi"],
"expectations": ["PASS"]
},
{ {
"testIdPattern": "[page.spec] Page Page.Events.Console should not fail for window object", "testIdPattern": "[page.spec] Page Page.Events.Console should not fail for window object",
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],
@ -1109,6 +1145,90 @@
"parameters": ["webDriverBiDi"], "parameters": ["webDriverBiDi"],
"expectations": ["PASS"] "expectations": ["PASS"]
}, },
{
"testIdPattern": "[page.spec] Page Page.select should deselect all options when passed no values for a multiple select",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["webDriverBiDi"],
"expectations": ["PASS"]
},
{
"testIdPattern": "[page.spec] Page Page.select should deselect all options when passed no values for a select without multiple",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["webDriverBiDi"],
"expectations": ["PASS"]
},
{
"testIdPattern": "[page.spec] Page Page.select should respect event bubbling",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["webDriverBiDi"],
"expectations": ["PASS"]
},
{
"testIdPattern": "[page.spec] Page Page.select should return [] on no matched values",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["webDriverBiDi"],
"expectations": ["PASS"]
},
{
"testIdPattern": "[page.spec] Page Page.select should return [] on no values",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["webDriverBiDi"],
"expectations": ["PASS"]
},
{
"testIdPattern": "[page.spec] Page Page.select should return an array of matched values",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["webDriverBiDi"],
"expectations": ["PASS"]
},
{
"testIdPattern": "[page.spec] Page Page.select should return an array of one element when multiple is not set",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["webDriverBiDi"],
"expectations": ["PASS"]
},
{
"testIdPattern": "[page.spec] Page Page.select should select multiple options",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["webDriverBiDi"],
"expectations": ["PASS"]
},
{
"testIdPattern": "[page.spec] Page Page.select should select only first option",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["webDriverBiDi"],
"expectations": ["PASS"]
},
{
"testIdPattern": "[page.spec] Page Page.select should select single option",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["webDriverBiDi"],
"expectations": ["PASS"]
},
{
"testIdPattern": "[page.spec] Page Page.select should throw if passed in non-strings",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["webDriverBiDi"],
"expectations": ["PASS"]
},
{
"testIdPattern": "[page.spec] Page Page.select should throw when element is not a <select>",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["webDriverBiDi"],
"expectations": ["PASS"]
},
{
"testIdPattern": "[page.spec] Page Page.select should work when re-defining top-level Event class",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["webDriverBiDi"],
"expectations": ["PASS"]
},
{
"testIdPattern": "[page.spec] Page Page.setGeolocation should throw when invalid longitude",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["webDriverBiDi"],
"expectations": ["PASS"]
},
{ {
"testIdPattern": "[page.spec] Page Page.title should return the page title", "testIdPattern": "[page.spec] Page Page.title should return the page title",
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],
@ -1199,6 +1319,12 @@
"parameters": ["webDriverBiDi"], "parameters": ["webDriverBiDi"],
"expectations": ["PASS"] "expectations": ["PASS"]
}, },
{
"testIdPattern": "[target.spec] Target should be able to use the default page in the browser",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["webDriverBiDi"],
"expectations": ["PASS"]
},
{ {
"testIdPattern": "[TargetManager.spec] *", "testIdPattern": "[TargetManager.spec] *",
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],
@ -1475,6 +1601,18 @@
"parameters": ["firefox", "webDriverBiDi"], "parameters": ["firefox", "webDriverBiDi"],
"expectations": ["SKIP"] "expectations": ["SKIP"]
}, },
{
"testIdPattern": "[click.spec] Page.click should click on checkbox input and toggle",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["chrome", "webDriverBiDi"],
"expectations": ["PASS"]
},
{
"testIdPattern": "[click.spec] Page.click should click on checkbox input and toggle",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["FAIL", "PASS"]
},
{ {
"testIdPattern": "[click.spec] Page.click should click on checkbox label and toggle", "testIdPattern": "[click.spec] Page.click should click on checkbox label and toggle",
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],
@ -1829,18 +1967,42 @@
"parameters": ["cdp", "firefox"], "parameters": ["cdp", "firefox"],
"expectations": ["SKIP"] "expectations": ["SKIP"]
}, },
{
"testIdPattern": "[evaluation.spec] Evaluation specs Page.evaluate should work right after framenavigated",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["chrome", "webDriverBiDi"],
"expectations": ["PASS"]
},
{
"testIdPattern": "[evaluation.spec] Evaluation specs Page.evaluate should work right after framenavigated",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["FAIL"]
},
{ {
"testIdPattern": "[fixtures.spec] Fixtures should close the browser when the node process closes", "testIdPattern": "[fixtures.spec] Fixtures should close the browser when the node process closes",
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"], "parameters": ["firefox", "webDriverBiDi"],
"expectations": ["FAIL", "TIMEOUT"] "expectations": ["FAIL", "TIMEOUT"]
}, },
{
"testIdPattern": "[frame.spec] Frame specs Frame Management should detach child frames on navigation",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["chrome", "webDriverBiDi"],
"expectations": ["PASS"]
},
{ {
"testIdPattern": "[frame.spec] Frame specs Frame Management should report different frame instance when frame re-attaches", "testIdPattern": "[frame.spec] Frame specs Frame Management should report different frame instance when frame re-attaches",
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],
"parameters": ["cdp", "firefox"], "parameters": ["cdp", "firefox"],
"expectations": ["FAIL"] "expectations": ["FAIL"]
}, },
{
"testIdPattern": "[frame.spec] Frame specs Frame Management should report frame from-inside shadow DOM",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["chrome", "webDriverBiDi"],
"expectations": ["PASS"]
},
{ {
"testIdPattern": "[frame.spec] Frame specs Frame Management should report frame from-inside shadow DOM", "testIdPattern": "[frame.spec] Frame specs Frame Management should report frame from-inside shadow DOM",
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],
@ -1859,18 +2021,36 @@
"parameters": ["cdp", "firefox"], "parameters": ["cdp", "firefox"],
"expectations": ["SKIP"] "expectations": ["SKIP"]
}, },
{
"testIdPattern": "[frame.spec] Frame specs Frame Management should send \"framenavigated\" when navigating on anchor URLs",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["chrome", "webDriverBiDi"],
"expectations": ["PASS"]
},
{ {
"testIdPattern": "[frame.spec] Frame specs Frame Management should send events when frames are manipulated dynamically", "testIdPattern": "[frame.spec] Frame specs Frame Management should send events when frames are manipulated dynamically",
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],
"parameters": ["cdp", "firefox"], "parameters": ["cdp", "firefox"],
"expectations": ["FAIL"] "expectations": ["FAIL"]
}, },
{
"testIdPattern": "[frame.spec] Frame specs Frame Management should support framesets",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["chrome", "webDriverBiDi"],
"expectations": ["PASS"]
},
{ {
"testIdPattern": "[frame.spec] Frame specs Frame Management should support lazy frames", "testIdPattern": "[frame.spec] Frame specs Frame Management should support lazy frames",
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],
"parameters": ["cdp", "firefox"], "parameters": ["cdp", "firefox"],
"expectations": ["FAIL"] "expectations": ["FAIL"]
}, },
{
"testIdPattern": "[frame.spec] Frame specs Frame Management should support url fragment",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["chrome", "webDriverBiDi"],
"expectations": ["PASS"]
},
{ {
"testIdPattern": "[frame.spec] Frame specs Frame.evaluate should throw for detached frames", "testIdPattern": "[frame.spec] Frame specs Frame.evaluate should throw for detached frames",
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],
@ -2165,6 +2345,12 @@
"parameters": ["cdp", "chrome"], "parameters": ["cdp", "chrome"],
"expectations": ["FAIL", "PASS"] "expectations": ["FAIL", "PASS"]
}, },
{
"testIdPattern": "[mouse.spec] Mouse should select the text with mouse",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["chrome", "webDriverBiDi"],
"expectations": ["PASS"]
},
{ {
"testIdPattern": "[mouse.spec] Mouse should send mouse wheel events", "testIdPattern": "[mouse.spec] Mouse should send mouse wheel events",
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],
@ -2189,12 +2375,24 @@
"parameters": ["cdp", "firefox"], "parameters": ["cdp", "firefox"],
"expectations": ["FAIL", "PASS"] "expectations": ["FAIL", "PASS"]
}, },
{
"testIdPattern": "[mouse.spec] Mouse should work with mobile viewports and cross process navigations",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["chrome", "webDriverBiDi"],
"expectations": ["PASS"]
},
{ {
"testIdPattern": "[navigation.spec] navigation Frame.goto should navigate subframes", "testIdPattern": "[navigation.spec] navigation Frame.goto should navigate subframes",
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],
"parameters": ["cdp", "firefox"], "parameters": ["cdp", "firefox"],
"expectations": ["FAIL"] "expectations": ["FAIL"]
}, },
{
"testIdPattern": "[navigation.spec] navigation Frame.goto should navigate subframes",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["chrome", "webDriverBiDi"],
"expectations": ["PASS"]
},
{ {
"testIdPattern": "[navigation.spec] navigation Frame.goto should reject when frame detaches", "testIdPattern": "[navigation.spec] navigation Frame.goto should reject when frame detaches",
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],
@ -2219,12 +2417,24 @@
"parameters": ["cdp", "firefox"], "parameters": ["cdp", "firefox"],
"expectations": ["SKIP"] "expectations": ["SKIP"]
}, },
{
"testIdPattern": "[navigation.spec] navigation Frame.waitForNavigation should fail when frame detaches",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["TIMEOUT"]
},
{ {
"testIdPattern": "[navigation.spec] navigation Frame.waitForNavigation should work", "testIdPattern": "[navigation.spec] navigation Frame.waitForNavigation should work",
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],
"parameters": ["cdp", "firefox"], "parameters": ["cdp", "firefox"],
"expectations": ["FAIL"] "expectations": ["FAIL"]
}, },
{
"testIdPattern": "[navigation.spec] navigation Frame.waitForNavigation should work",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["TIMEOUT"]
},
{ {
"testIdPattern": "[navigation.spec] navigation Page.goBack should work with HistoryAPI", "testIdPattern": "[navigation.spec] navigation Page.goBack should work with HistoryAPI",
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],
@ -2405,12 +2615,30 @@
"parameters": ["firefox", "webDriverBiDi"], "parameters": ["firefox", "webDriverBiDi"],
"expectations": ["FAIL"] "expectations": ["FAIL"]
}, },
{
"testIdPattern": "[navigation.spec] navigation Page.waitForNavigation should work",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["TIMEOUT"]
},
{ {
"testIdPattern": "[navigation.spec] navigation Page.waitForNavigation should work when subframe issues window.stop()", "testIdPattern": "[navigation.spec] navigation Page.waitForNavigation should work when subframe issues window.stop()",
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],
"parameters": ["cdp", "firefox"], "parameters": ["cdp", "firefox"],
"expectations": ["SKIP"] "expectations": ["SKIP"]
}, },
{
"testIdPattern": "[navigation.spec] navigation Page.waitForNavigation should work when subframe issues window.stop()",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["FAIL"]
},
{
"testIdPattern": "[navigation.spec] navigation Page.waitForNavigation should work with both domcontentloaded and load",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["TIMEOUT"]
},
{ {
"testIdPattern": "[navigation.spec] navigation Page.waitForNavigation should work with DOM history.back()/history.forward()", "testIdPattern": "[navigation.spec] navigation Page.waitForNavigation should work with DOM history.back()/history.forward()",
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],
@ -2801,6 +3029,12 @@
"parameters": ["cdp", "firefox"], "parameters": ["cdp", "firefox"],
"expectations": ["SKIP"] "expectations": ["SKIP"]
}, },
{
"testIdPattern": "[page.spec] Page Page.close should not be visible in browser.pages",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["chrome", "webDriverBiDi"],
"expectations": ["PASS"]
},
{ {
"testIdPattern": "[page.spec] Page Page.close should run beforeunload if asked for", "testIdPattern": "[page.spec] Page Page.close should run beforeunload if asked for",
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],
@ -2993,6 +3227,12 @@
"parameters": ["cdp", "firefox"], "parameters": ["cdp", "firefox"],
"expectations": ["FAIL"] "expectations": ["FAIL"]
}, },
{
"testIdPattern": "[page.spec] Page Page.select should not throw when select causes navigation",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["chrome", "webDriverBiDi"],
"expectations": ["PASS"]
},
{ {
"testIdPattern": "[page.spec] Page Page.select should work when re-defining top-level Event class", "testIdPattern": "[page.spec] Page Page.select should work when re-defining top-level Event class",
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],
@ -3047,6 +3287,12 @@
"parameters": ["cdp", "firefox"], "parameters": ["cdp", "firefox"],
"expectations": ["FAIL"] "expectations": ["FAIL"]
}, },
{
"testIdPattern": "[page.spec] Page Page.setJavaScriptEnabled should work",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["chrome", "webDriverBiDi"],
"expectations": ["PASS"]
},
{ {
"testIdPattern": "[page.spec] Page Page.setOfflineMode should emulate navigator.onLine", "testIdPattern": "[page.spec] Page Page.setOfflineMode should emulate navigator.onLine",
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],
@ -3107,6 +3353,18 @@
"parameters": ["chrome", "webDriverBiDi"], "parameters": ["chrome", "webDriverBiDi"],
"expectations": ["PASS"] "expectations": ["PASS"]
}, },
{
"testIdPattern": "[proxy.spec] request proxy should proxy requests when configured",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["chrome", "webDriverBiDi"],
"expectations": ["PASS"]
},
{
"testIdPattern": "[proxy.spec] request proxy should respect proxy bypass list",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["chrome", "webDriverBiDi"],
"expectations": ["PASS"]
},
{ {
"testIdPattern": "[queryhandler.spec] Query handler tests P selectors should work ARIA selectors", "testIdPattern": "[queryhandler.spec] Query handler tests P selectors should work ARIA selectors",
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],

View File

@ -610,9 +610,9 @@ describe('navigation', function () {
return (error = _error); return (error = _error);
}); });
const bothFiredPromise = page const loadFiredPromise = page
.waitForNavigation({ .waitForNavigation({
waitUntil: ['load', 'domcontentloaded'], waitUntil: 'load',
}) })
.then(() => { .then(() => {
return (bothFired = true); return (bothFired = true);
@ -625,7 +625,7 @@ describe('navigation', function () {
await domContentLoadedPromise; await domContentLoadedPromise;
expect(bothFired).toBe(false); expect(bothFired).toBe(false);
response.end(); response.end();
await bothFiredPromise; await loadFiredPromise;
await navigationPromise; await navigationPromise;
expect(error).toBeUndefined(); expect(error).toBeUndefined();
}); });
@ -734,7 +734,6 @@ describe('navigation', function () {
navigationPromise.catch(() => {}); navigationPromise.catch(() => {});
throw error; throw error;
} }
await Promise.all([ await Promise.all([
frame!.evaluate(() => { frame!.evaluate(() => {
return window.stop(); return window.stop();
@ -884,7 +883,10 @@ describe('navigation', function () {
return frame.remove(); return frame.remove();
}); });
await navigationPromise; await navigationPromise;
expect(error.message).toBe('Navigating frame was detached'); expect(error.message).atLeastOneToContain([
'Navigating frame was detached',
'Frame detached',
]);
}); });
}); });