Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

chore(protocol): split channel and dispatcher types (#41321)

Simon Knott18af5623415c
diff --git a/.claude/skills/playwright-dev/library.md b/.claude/skills/playwright-dev/library.md
index 1a6fa28946..52456a47cb 100644
--- a/.claude/skills/playwright-dev/library.md
+++ b/.claude/skills/playwright-dev/library.md
@@ -7,12 +7,12 @@ Playwright uses a client-server architecture connected by a protocol layer. The
```
packages/protocol/src/
protocol.yml — RPC protocol definition (source of truth)
- channels.d.ts — generated TypeScript channel interfaces
- callMetadata.d.ts — call metadata types
packages/playwright-core/src/
client/ — public API objects (ChannelOwner subclasses)
+ channels.d.ts — generated client channel interfaces
server/ — browser automation implementation (SdkObject subclasses)
+ channels.d.ts — generated server channel interfaces
server/dispatchers/ — protocol bridge (Dispatcher subclasses)
protocol/ — validators (generated + primitives)
utils/isomorphic/ — shared code used by both client and server
diff --git a/packages/dashboard/vite.config.ts b/packages/dashboard/vite.config.ts
index d4f0b3ad9b..5356d3365c 100644
--- a/packages/dashboard/vite.config.ts
+++ b/packages/dashboard/vite.config.ts
@@ -27,7 +27,6 @@ export default defineConfig({
resolve: {
alias: {
'@isomorphic': path.resolve(__dirname, '../isomorphic'),
- '@protocol': path.resolve(__dirname, '../protocol/src'),
'@web': path.resolve(__dirname, '../web/src'),
'@trace-viewer': path.resolve(__dirname, '../trace-viewer/src'),
},
diff --git a/packages/injected/src/injectedScript.ts b/packages/injected/src/injectedScript.ts
index f91fdbed3b..6c265ae8ff 100644
--- a/packages/injected/src/injectedScript.ts
+++ b/packages/injected/src/injectedScript.ts
@@ -37,7 +37,6 @@ import type { AriaTemplateNode } from '@isomorphic/ariaSnapshot';
import type { CSSComplexSelectorList } from '@isomorphic/cssParser';
import type { Language } from '@isomorphic/locatorGenerators';
import type { AttributeSelectorPart, NestedSelectorBody, ParsedSelector, ParsedSelectorPart } from '@isomorphic/selectorParser';
-import type * as channels from '@protocol/channels';
import type { AriaSnapshot, AriaTreeOptions } from './ariaSnapshot';
import type { LayoutSelectorName } from './layoutSelectorUtils';
import type { SelectorEngine, SelectorRoot } from './selectorEngine';
@@ -46,8 +45,28 @@ import type { ElementText, TextMatcher } from './selectorUtils';
import type { Builtins } from './utilityScript';
-export type FrameExpectParams = Omit<channels.FrameExpectParams, 'expectedValue' | 'timeout'> & {
- expectedValue?: any;
+type ExpectedTextValue = {
+ string?: string,
+ regexSource?: string,
+ regexFlags?: string,
+ matchSubstring?: boolean,
+ ignoreCase?: boolean,
+ normalizeWhiteSpace?: boolean,
+};
+
+type Point = { x: number, y: number };
+type Rect = Point & { width: number, height: number };
+
+export type FrameExpectParams = {
+ selector?: string,
+ expression: string,
+ expressionArg?: any,
+ pseudo?: 'before' | 'after',
+ expectedText?: ExpectedTextValue[],
+ expectedNumber?: number,
+ expectedValue?: any,
+ useInnerText?: boolean,
+ isNot: boolean,
};
export type ElementState = 'visible' | 'hidden' | 'enabled' | 'disabled' | 'editable' | 'checked' | 'unchecked' | 'indeterminate' | 'stable';
@@ -1337,7 +1356,7 @@ export class InjectedScript {
highlight.removeElementHighlight(selector);
}
- setScreencastAnnotation(annotation: { point?: channels.Point, box?: channels.Rect, actionTitle?: string, duration?: number, position?: string, fontSize?: number, cursor?: 'none' | 'pointer' } | null) {
+ setScreencastAnnotation(annotation: { point?: Point, box?: Rect, actionTitle?: string, duration?: number, position?: string, fontSize?: number, cursor?: 'none' | 'pointer' } | null) {
const highlight = this._ensureHighlight();
if (!annotation) {
highlight.updateHighlight([]);
@@ -1722,7 +1741,7 @@ export class InjectedScript {
}
private _matchSequentially<T>(
- expectedText: channels.ExpectedTextValue[],
+ expectedText: ExpectedTextValue[],
received: T[],
matchFn: (matcher: ExpectedTextMatcher, received: T) => boolean
): boolean {
@@ -1811,7 +1830,7 @@ class ExpectedTextMatcher {
private _normalizeWhiteSpace: boolean | undefined;
private _ignoreCase: boolean | undefined;
- constructor(expected: channels.ExpectedTextValue) {
+ constructor(expected: ExpectedTextValue) {
this._normalizeWhiteSpace = expected.normalizeWhiteSpace;
this._ignoreCase = expected.ignoreCase;
this._string = expected.matchSubstring ? undefined : this.normalize(expected.string);
diff --git a/packages/injected/src/storageScript.ts b/packages/injected/src/storageScript.ts
index 6f25ce9669..13ec974c01 100644
--- a/packages/injected/src/storageScript.ts
+++ b/packages/injected/src/storageScript.ts
@@ -16,9 +16,42 @@
import { parseEvaluationResultValue, serializeAsCallArgument } from '@isomorphic/utilityScriptSerializers';
-import type * as channels from '@protocol/channels';
-
-export type SerializedStorage = Omit<channels.OriginStorage, 'origin'>;
+type NameValue = { name: string, value: string };
+
+type IndexedDBDatabase = {
+ name: string,
+ version: number,
+ stores: {
+ name: string,
+ autoIncrement: boolean,
+ keyPath?: string,
+ keyPathArray?: string[],
+ records: {
+ key?: any,
+ keyEncoded?: any,
+ value?: any,
+ valueEncoded?: any,
+ }[],
+ indexes: {
+ name: string,
+ keyPath?: string,
+ keyPathArray?: string[],
+ multiEntry: boolean,
+ unique: boolean,
+ }[],
+ }[],
+};
+
+type SetOriginStorage = {
+ origin: string,
+ localStorage: NameValue[],
+ indexedDB?: IndexedDBDatabase[],
+};
+
+export type SerializedStorage = {
+ localStorage: NameValue[],
+ indexedDB?: IndexedDBDatabase[],
+};
export class StorageScript {
private _isFirefox: boolean;
@@ -85,7 +118,7 @@ export class StorageScript {
const keys = await this._idbRequestToPromise(objectStore.getAllKeys());
const records = await Promise.all(keys.map(async key => {
- const record: channels.IndexedDBDatabase['stores'][0]['records'][0] = {};
+ const record: IndexedDBDatabase['stores'][0]['records'][0] = {};
if (objectStore.keyPath === null) {
const { encoded, trivial } = this._trySerialize(key);
@@ -146,7 +179,7 @@ export class StorageScript {
}
}
- private async _restoreDB(dbInfo: channels.IndexedDBDatabase) {
+ private async _restoreDB(dbInfo: IndexedDBDatabase) {
const openRequest = this._global.indexedDB.open(dbInfo.name, dbInfo.version);
openRequest.addEventListener('upgradeneeded', () => {
const db = openRequest.result;
@@ -176,7 +209,7 @@ export class StorageScript {
}));
}
- async restore(originState: channels.SetOriginStorage | undefined) {
+ async restore(originState: SetOriginStorage | undefined) {
// Clean Service Workers.
const registrations = this._global.navigator.serviceWorker ? await this._global.navigator.serviceWorker.getRegistrations() : [];
await Promise.all(registrations.map(async r => {
diff --git a/packages/isomorphic/expectUtils.ts b/packages/isomorphic/expectUtils.ts
deleted file mode 100644
index e7be8db852..0000000000
--- a/packages/isomorphic/expectUtils.ts
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * Copyright (c) Microsoft Corporation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import { isRegExp, isString } from './rtti';
-import type { ExpectedTextValue } from '@protocol/channels';
-
-export function serializeExpectedTextValues(items: (string | RegExp)[], options: { matchSubstring?: boolean, normalizeWhiteSpace?: boolean, ignoreCase?: boolean } = {}): ExpectedTextValue[] {
- return items.map(i => ({
- string: isString(i) ? i : undefined,
- regexSource: isRegExp(i) ? i.source : undefined,
- regexFlags: isRegExp(i) ? i.flags : undefined,
- matchSubstring: options.matchSubstring,
- ignoreCase: options.ignoreCase,
- normalizeWhiteSpace: options.normalizeWhiteSpace,
- }));
-}
diff --git a/packages/isomorphic/index.ts b/packages/isomorphic/index.ts
index fd97cdfbcf..f645b878b7 100644
--- a/packages/isomorphic/index.ts
+++ b/packages/isomorphic/index.ts
@@ -15,7 +15,6 @@
*/
export * from './ariaSnapshot';
-export * from './expectUtils';
export * from './assert';
export * from './base64';
export * from './colors';
diff --git a/packages/isomorphic/platform.ts b/packages/isomorphic/platform.ts
index 7c27221cc4..497b50cff7 100644
--- a/packages/isomorphic/platform.ts
+++ b/packages/isomorphic/platform.ts
@@ -20,7 +20,6 @@ import type * as fs from 'fs';
import type * as path from 'path';
import type { Readable, Writable } from 'stream';
import type { Colors } from '@isomorphic/colors';
-import type * as channels from '@protocol/channels';
export type Zone = {
push(data: unknown): Zone;
@@ -29,6 +28,16 @@ export type Zone = {
data<T>(): T | undefined;
};
+export type StreamChannel = {
+ read(params: { size?: number }): Promise<{ binary: Buffer }>;
+ close(params?: {}): Promise<any>;
+};
+
+export type WritableStreamChannel = {
+ write(params: { binary: Buffer }): Promise<any>;
+ close(params?: {}): Promise<any>;
+};
+
const noopZone: Zone = {
push: () => noopZone,
pop: () => noopZone,
@@ -57,8 +66,8 @@ export type Platform = {
pathSeparator: string;
showInternalStackFrames: () => boolean,
streamFile: (path: string, writable: Writable) => Promise<void>,
- streamReadable: (channel: channels.StreamChannel) => Readable,
- streamWritable: (channel: channels.WritableStreamChannel) => Writable,
+ streamReadable: (channel: StreamChannel) => Readable,
+ streamWritable: (channel: WritableStreamChannel) => Writable,
zones: { empty: Zone, current: () => Zone; };
};
@@ -111,11 +120,11 @@ export const emptyPlatform: Platform = {
throw new Error('Streams are not available');
},
- streamReadable: (channel: channels.StreamChannel) => {
+ streamReadable: (channel: StreamChannel) => {
throw new Error('Streams are not available');
},
- streamWritable: (channel: channels.WritableStreamChannel) => {
+ streamWritable: (channel: WritableStreamChannel) => {
throw new Error('Streams are not available');
},
diff --git a/packages/isomorphic/trace/traceModel.ts b/packages/isomorphic/trace/traceModel.ts
index ea8381f910..f6f9187dd6 100644
--- a/packages/isomorphic/trace/traceModel.ts
+++ b/packages/isomorphic/trace/traceModel.ts
@@ -16,12 +16,12 @@
import { getActionGroup, renderTitleForCall } from '../protocolFormatter';
+import type { StackFrame } from '../stackTrace';
import type { Language } from '../locatorGenerators';
import type { ResourceSnapshot } from '@trace/snapshot';
import type * as trace from '@trace/trace';
import type { ActionTraceEvent } from '@trace/trace';
import type { ActionEntry, ContextEntry, PageEntry } from './entries';
-import type { StackFrame } from '@protocol/channels';
import type { ActionGroup } from '../protocolFormatter';
const contextSymbol = Symbol('context');
diff --git a/packages/isomorphic/trace/traceUtils.ts b/packages/isomorphic/trace/traceUtils.ts
index f077cc5c4b..aa11c397ac 100644
--- a/packages/isomorphic/trace/traceUtils.ts
+++ b/packages/isomorphic/trace/traceUtils.ts
@@ -14,7 +14,12 @@
* limitations under the License.
*/
-import type { ClientSideCallMetadata, StackFrame } from '@protocol/channels';
+import type { StackFrame } from '../stackTrace';
+
+type ClientSideCallMetadata = {
+ id: number,
+ stack?: StackFrame[],
+};
export type SerializedStackFrame = [number, number, number, string];
export type SerializedStack = [number, SerializedStackFrame[]];
diff --git a/packages/playwright-core/src/client/android.ts b/packages/playwright-core/src/client/android.ts
index 3f6ad60f04..8286a92e1c 100644
--- a/packages/playwright-core/src/client/android.ts
+++ b/packages/playwright-core/src/client/android.ts
@@ -31,7 +31,7 @@ import type * as types from './types';
import type * as api from '../../types/types';
import type { AndroidServerLauncherImpl } from '../androidServerImpl';
import type { Platform } from '@isomorphic/platform';
-import type * as channels from '@protocol/channels';
+import type * as channels from './channels';
import type { Playwright } from './playwright';
type Direction = 'down' | 'up' | 'left' | 'right';
diff --git a/packages/playwright-core/src/client/artifact.ts b/packages/playwright-core/src/client/artifact.ts
index 7c6fd947cf..794d327037 100644
--- a/packages/playwright-core/src/client/artifact.ts
+++ b/packages/playwright-core/src/client/artifact.ts
@@ -18,7 +18,7 @@ import { ChannelOwner } from './channelOwner';
import { Stream } from './stream';
import { mkdirIfNeeded } from './fileUtils';
-import type * as channels from '@protocol/channels';
+import type * as channels from './channels';
import type { Readable } from 'stream';
export class Artifact extends ChannelOwner<channels.ArtifactChannel> {
diff --git a/packages/playwright-core/src/client/browser.ts b/packages/playwright-core/src/client/browser.ts
index 010d16bb5f..d11adf305e 100644
--- a/packages/playwright-core/src/client/browser.ts
+++ b/packages/playwright-core/src/client/browser.ts
@@ -26,7 +26,7 @@ import type { BrowserType } from './browserType';
import type { Page } from './page';
import type { BrowserContextOptions, LaunchOptions, Logger } from './types';
import type * as api from '../../types/types';
-import type * as channels from '@protocol/channels';
+import type * as channels from './channels';
export class Browser extends ChannelOwner<channels.BrowserChannel> implements api.Browser {
readonly _contexts = new Set<BrowserContext>();
diff --git a/packages/playwright-core/src/client/browserContext.ts b/packages/playwright-core/src/client/browserContext.ts
index ff4b4241de..e450deaeb8 100644
--- a/packages/playwright-core/src/client/browserContext.ts
+++ b/packages/playwright-core/src/client/browserContext.ts
@@ -48,7 +48,7 @@ import type * as structs from '../../types/structs';
import type * as api from '../../types/types';
import type { URLMatch } from '@isomorphic/urlMatch';
import type { Platform } from '@isomorphic/platform';
-import type * as channels from '@protocol/channels';
+import type * as channels from './channels';
import type * as actions from '@recorder/actions';
interface RecorderEventSink {
diff --git a/packages/playwright-core/src/client/browserType.ts b/packages/playwright-core/src/client/browserType.ts
index c0af1bda9d..a37aca97c6 100644
--- a/packages/playwright-core/src/client/browserType.ts
+++ b/packages/playwright-core/src/client/browserType.ts
@@ -27,7 +27,7 @@ import { Worker } from './worker';
import type { Playwright } from './playwright';
import type { ConnectOptions, LaunchOptions, LaunchPersistentContextOptions, LaunchServerOptions } from './types';
import type * as api from '../../types/types';
-import type * as channels from '@protocol/channels';
+import type * as channels from './channels';
import type { ChildProcess } from 'child_process';
export interface BrowserServerLauncher {
diff --git a/packages/playwright-core/src/client/cdpSession.ts b/packages/playwright-core/src/client/cdpSession.ts
index d27b2aaeb2..57a08aefa5 100644
--- a/packages/playwright-core/src/client/cdpSession.ts
+++ b/packages/playwright-core/src/client/cdpSession.ts
@@ -18,7 +18,7 @@ import { ChannelOwner } from './channelOwner';
import type * as api from '../../types/types';
import type { Protocol } from '../server/chromium/protocol';
-import type * as channels from '@protocol/channels';
+import type * as channels from './channels';
export class CDPSession extends ChannelOwner<channels.CDPSessionChannel> implements api.CDPSession {
static from(cdpSession: channels.CDPSessionChannel): CDPSession {
diff --git a/packages/playwright-core/src/client/channelOwner.ts b/packages/playwright-core/src/client/channelOwner.ts
index 7542265254..781b2e86a9 100644
--- a/packages/playwright-core/src/client/channelOwner.ts
+++ b/packages/playwright-core/src/client/channelOwner.ts
@@ -25,7 +25,7 @@ import type { Connection } from './connection';
import type { Logger } from './types';
import type { ValidatorContext } from '../protocol/validator';
import type { Platform } from '@isomorphic/platform';
-import type * as channels from '@protocol/channels';
+import type * as channels from './channels';
type Listener = (...args: any[]) => void;
diff --git a/packages/protocol/src/channels.d.ts b/packages/playwright-core/src/client/channels.d.ts
similarity index 81%
rename from packages/protocol/src/channels.d.ts
rename to packages/playwright-core/src/client/channels.d.ts
index ddec4af4c3..3d116fac27 100644
--- a/packages/protocol/src/channels.d.ts
+++ b/packages/playwright-core/src/client/channels.d.ts
@@ -15,10 +15,6 @@
*/
// This file is generated by generate_channels.js, do not edit manually.
-
-import type { CallMetadata } from './callMetadata';
-import type { Progress } from './progress';
-
export type Binary = Buffer;
export interface Channel {
@@ -144,7 +140,7 @@ export interface AndroidEventTarget {
}
export interface AndroidChannel extends AndroidEventTarget, Channel {
_type_Android: boolean;
- devices(params: AndroidDevicesParams, progress?: Progress): Promise<AndroidDevicesResult>;
+ devices(params: AndroidDevicesParams): Promise<AndroidDevicesResult>;
}
export type AndroidDevicesParams = {
host?: string,
@@ -171,8 +167,8 @@ export interface AndroidSocketEventTarget {
}
export interface AndroidSocketChannel extends AndroidSocketEventTarget, Channel {
_type_AndroidSocket: boolean;
- write(params: AndroidSocketWriteParams, progress?: Progress): Promise<AndroidSocketWriteResult>;
- close(params?: AndroidSocketCloseParams, progress?: Progress): Promise<AndroidSocketCloseResult>;
+ write(params: AndroidSocketWriteParams): Promise<AndroidSocketWriteResult>;
+ close(params?: AndroidSocketCloseParams): Promise<AndroidSocketCloseResult>;
}
export type AndroidSocketDataEvent = {
data: Binary,
@@ -206,30 +202,30 @@ export interface AndroidDeviceEventTarget {
}
export interface AndroidDeviceChannel extends AndroidDeviceEventTarget, Channel {
_type_AndroidDevice: boolean;
- wait(params: AndroidDeviceWaitParams, progress?: Progress): Promise<AndroidDeviceWaitResult>;
- fill(params: AndroidDeviceFillParams, progress?: Progress): Promise<AndroidDeviceFillResult>;
- tap(params: AndroidDeviceTapParams, progress?: Progress): Promise<AndroidDeviceTapResult>;
- drag(params: AndroidDeviceDragParams, progress?: Progress): Promise<AndroidDeviceDragResult>;
- fling(params: AndroidDeviceFlingParams, progress?: Progress): Promise<AndroidDeviceFlingResult>;
- longTap(params: AndroidDeviceLongTapParams, progress?: Progress): Promise<AndroidDeviceLongTapResult>;
- pinchClose(params: AndroidDevicePinchCloseParams, progress?: Progress): Promise<AndroidDevicePinchCloseResult>;
- pinchOpen(params: AndroidDevicePinchOpenParams, progress?: Progress): Promise<AndroidDevicePinchOpenResult>;
- scroll(params: AndroidDeviceScrollParams, progress?: Progress): Promise<AndroidDeviceScrollResult>;
- swipe(params: AndroidDeviceSwipeParams, progress?: Progress): Promise<AndroidDeviceSwipeResult>;
- info(params: AndroidDeviceInfoParams, progress?: Progress): Promise<AndroidDeviceInfoResult>;
- screenshot(params?: AndroidDeviceScreenshotParams, progress?: Progress): Promise<AndroidDeviceScreenshotResult>;
- inputType(params: AndroidDeviceInputTypeParams, progress?: Progress): Promise<AndroidDeviceInputTypeResult>;
- inputPress(params: AndroidDeviceInputPressParams, progress?: Progress): Promise<AndroidDeviceInputPressResult>;
- inputTap(params: AndroidDeviceInputTapParams, progress?: Progress): Promise<AndroidDeviceInputTapResult>;
- inputSwipe(params: AndroidDeviceInputSwipeParams, progress?: Progress): Promise<AndroidDeviceInputSwipeResult>;
- inputDrag(params: AndroidDeviceInputDragParams, progress?: Progress): Promise<AndroidDeviceInputDragResult>;
- launchBrowser(params: AndroidDeviceLaunchBrowserParams, progress?: Progress): Promise<AndroidDeviceLaunchBrowserResult>;
- open(params: AndroidDeviceOpenParams, progress?: Progress): Promise<AndroidDeviceOpenResult>;
- shell(params: AndroidDeviceShellParams, progress?: Progress): Promise<AndroidDeviceShellResult>;
- installApk(params: AndroidDeviceInstallApkParams, progress?: Progress): Promise<AndroidDeviceInstallApkResult>;
- push(params: AndroidDevicePushParams, progress?: Progress): Promise<AndroidDevicePushResult>;
- connectToWebView(params: AndroidDeviceConnectToWebViewParams, progress?: Progress): Promise<AndroidDeviceConnectToWebViewResult>;
- close(params?: AndroidDeviceCloseParams, progress?: Progress): Promise<AndroidDeviceCloseResult>;
+ wait(params: AndroidDeviceWaitParams): Promise<AndroidDeviceWaitResult>;
+ fill(params: AndroidDeviceFillParams): Promise<AndroidDeviceFillResult>;
+ tap(params: AndroidDeviceTapParams): Promise<AndroidDeviceTapResult>;
+ drag(params: AndroidDeviceDragParams): Promise<AndroidDeviceDragResult>;
+ fling(params: AndroidDeviceFlingParams): Promise<AndroidDeviceFlingResult>;
+ longTap(params: AndroidDeviceLongTapParams): Promise<AndroidDeviceLongTapResult>;
+ pinchClose(params: AndroidDevicePinchCloseParams): Promise<AndroidDevicePinchCloseResult>;
+ pinchOpen(params: AndroidDevicePinchOpenParams): Promise<AndroidDevicePinchOpenResult>;
+ scroll(params: AndroidDeviceScrollParams): Promise<AndroidDeviceScrollResult>;
+ swipe(params: AndroidDeviceSwipeParams): Promise<AndroidDeviceSwipeResult>;
+ info(params: AndroidDeviceInfoParams): Promise<AndroidDeviceInfoResult>;
+ screenshot(params?: AndroidDeviceScreenshotParams): Promise<AndroidDeviceScreenshotResult>;
+ inputType(params: AndroidDeviceInputTypeParams): Promise<AndroidDeviceInputTypeResult>;
+ inputPress(params: AndroidDeviceInputPressParams): Promise<AndroidDeviceInputPressResult>;
+ inputTap(params: AndroidDeviceInputTapParams): Promise<AndroidDeviceInputTapResult>;
+ inputSwipe(params: AndroidDeviceInputSwipeParams): Promise<AndroidDeviceInputSwipeResult>;
+ inputDrag(params: AndroidDeviceInputDragParams): Promise<AndroidDeviceInputDragResult>;
+ launchBrowser(params: AndroidDeviceLaunchBrowserParams): Promise<AndroidDeviceLaunchBrowserResult>;
+ open(params: AndroidDeviceOpenParams): Promise<AndroidDeviceOpenResult>;
+ shell(params: AndroidDeviceShellParams): Promise<AndroidDeviceShellResult>;
+ installApk(params: AndroidDeviceInstallApkParams): Promise<AndroidDeviceInstallApkResult>;
+ push(params: AndroidDevicePushParams): Promise<AndroidDevicePushResult>;
+ connectToWebView(params: AndroidDeviceConnectToWebViewParams): Promise<AndroidDeviceConnectToWebViewResult>;
+ close(params?: AndroidDeviceCloseParams): Promise<AndroidDeviceCloseResult>;
}
export type AndroidDeviceCloseEvent = {};
export type AndroidDeviceWebViewAddedEvent = {
@@ -646,12 +642,12 @@ export interface APIRequestContextEventTarget {
}
export interface APIRequestContextChannel extends APIRequestContextEventTarget, Channel {
_type_APIRequestContext: boolean;
- fetch(params: APIRequestContextFetchParams, progress?: Progress): Promise<APIRequestContextFetchResult>;
- fetchResponseBody(params: APIRequestContextFetchResponseBodyParams, progress?: Progress): Promise<APIRequestContextFetchResponseBodyResult>;
- fetchLog(params: APIRequestContextFetchLogParams, progress?: Progress): Promise<APIRequestContextFetchLogResult>;
- storageState(params: APIRequestContextStorageStateParams, progress?: Progress): Promise<APIRequestContextStorageStateResult>;
- disposeAPIResponse(params: APIRequestContextDisposeAPIResponseParams, progress?: Progress): Promise<APIRequestContextDisposeAPIResponseResult>;
- dispose(params: APIRequestContextDisposeParams, progress?: Progress): Promise<APIRequestContextDisposeResult>;
+ fetch(params: APIRequestContextFetchParams): Promise<APIRequestContextFetchResult>;
+ fetchResponseBody(params: APIRequestContextFetchResponseBodyParams): Promise<APIRequestContextFetchResponseBodyResult>;
+ fetchLog(params: APIRequestContextFetchLogParams): Promise<APIRequestContextFetchLogResult>;
+ storageState(params: APIRequestContextStorageStateParams): Promise<APIRequestContextStorageStateResult>;
+ disposeAPIResponse(params: APIRequestContextDisposeAPIResponseParams): Promise<APIRequestContextDisposeAPIResponseResult>;
+ dispose(params: APIRequestContextDisposeParams): Promise<APIRequestContextDisposeResult>;
}
export type APIRequestContextFetchParams = {
url: string,
@@ -750,13 +746,13 @@ export interface ArtifactEventTarget {
}
export interface ArtifactChannel extends ArtifactEventTarget, Channel {
_type_Artifact: boolean;
- pathAfterFinished(params?: ArtifactPathAfterFinishedParams, progress?: Progress): Promise<ArtifactPathAfterFinishedResult>;
- saveAs(params: ArtifactSaveAsParams, progress?: Progress): Promise<ArtifactSaveAsResult>;
- saveAsStream(params?: ArtifactSaveAsStreamParams, progress?: Progress): Promise<ArtifactSaveAsStreamResult>;
- failure(params?: ArtifactFailureParams, progress?: Progress): Promise<ArtifactFailureResult>;
- stream(params?: ArtifactStreamParams, progress?: Progress): Promise<ArtifactStreamResult>;
- cancel(params?: ArtifactCancelParams, progress?: Progress): Promise<ArtifactCancelResult>;
- delete(params?: ArtifactDeleteParams, progress?: Progress): Promise<ArtifactDeleteResult>;
+ pathAfterFinished(params?: ArtifactPathAfterFinishedParams): Promise<ArtifactPathAfterFinishedResult>;
+ saveAs(params: ArtifactSaveAsParams): Promise<ArtifactSaveAsResult>;
+ saveAsStream(params?: ArtifactSaveAsStreamParams): Promise<ArtifactSaveAsStreamResult>;
+ failure(params?: ArtifactFailureParams): Promise<ArtifactFailureResult>;
+ stream(params?: ArtifactStreamParams): Promise<ArtifactStreamResult>;
+ cancel(params?: ArtifactCancelParams): Promise<ArtifactCancelResult>;
+ delete(params?: ArtifactDeleteParams): Promise<ArtifactDeleteResult>;
}
export type ArtifactPathAfterFinishedParams = {};
export type ArtifactPathAfterFinishedOptions = {};
@@ -801,8 +797,8 @@ export interface StreamEventTarget {
}
export interface StreamChannel extends StreamEventTarget, Channel {
_type_Stream: boolean;
- read(params: StreamReadParams, progress?: Progress): Promise<StreamReadResult>;
- close(params?: StreamCloseParams, progress?: Progress): Promise<StreamCloseResult>;
+ read(params: StreamReadParams): Promise<StreamReadResult>;
+ close(params?: StreamCloseParams): Promise<StreamCloseResult>;
}
export type StreamReadParams = {
size?: number,
@@ -826,8 +822,8 @@ export interface WritableStreamEventTarget {
}
export interface WritableStreamChannel extends WritableStreamEventTarget, Channel {
_type_WritableStream: boolean;
- write(params: WritableStreamWriteParams, progress?: Progress): Promise<WritableStreamWriteResult>;
- close(params?: WritableStreamCloseParams, progress?: Progress): Promise<WritableStreamCloseResult>;
+ write(params: WritableStreamWriteParams): Promise<WritableStreamWriteResult>;
+ close(params?: WritableStreamCloseParams): Promise<WritableStreamCloseResult>;
}
export type WritableStreamWriteParams = {
binary: Binary,
@@ -855,17 +851,17 @@ export interface BrowserEventTarget {
}
export interface BrowserChannel extends BrowserEventTarget, Channel {
_type_Browser: boolean;
- startServer(params: BrowserStartServerParams, progress?: Progress): Promise<BrowserStartServerResult>;
- stopServer(params?: BrowserStopServerParams, progress?: Progress): Promise<BrowserStopServerResult>;
- close(params: BrowserCloseParams, progress?: Progress): Promise<BrowserCloseResult>;
- killForTests(params?: BrowserKillForTestsParams, progress?: Progress): Promise<BrowserKillForTestsResult>;
- defaultUserAgentForTest(params?: BrowserDefaultUserAgentForTestParams, progress?: Progress): Promise<BrowserDefaultUserAgentForTestResult>;
- newContext(params: BrowserNewContextParams, progress?: Progress): Promise<BrowserNewContextResult>;
- newContextForReuse(params: BrowserNewContextForReuseParams, progress?: Progress): Promise<BrowserNewContextForReuseResult>;
- disconnectFromReusedContext(params: BrowserDisconnectFromReusedContextParams, progress?: Progress): Promise<BrowserDisconnectFromReusedContextResult>;
- newBrowserCDPSession(params?: BrowserNewBrowserCDPSessionParams, progress?: Progress): Promise<BrowserNewBrowserCDPSessionResult>;
- startTracing(params: BrowserStartTracingParams, progress?: Progress): Promise<BrowserStartTracingResult>;
- stopTracing(params?: BrowserStopTracingParams, progress?: Progress): Promise<BrowserStopTracingResult>;
+ startServer(params: BrowserStartServerParams): Promise<BrowserStartServerResult>;
+ stopServer(params?: BrowserStopServerParams): Promise<BrowserStopServerResult>;
+ close(params: BrowserCloseParams): Promise<BrowserCloseResult>;
+ killForTests(params?: BrowserKillForTestsParams): Promise<BrowserKillForTestsResult>;
+ defaultUserAgentForTest(params?: BrowserDefaultUserAgentForTestParams): Promise<BrowserDefaultUserAgentForTestResult>;
+ newContext(params: BrowserNewContextParams): Promise<BrowserNewContextResult>;
+ newContextForReuse(params: BrowserNewContextForReuseParams): Promise<BrowserNewContextForReuseResult>;
+ disconnectFromReusedContext(params: BrowserDisconnectFromReusedContextParams): Promise<BrowserDisconnectFromReusedContextResult>;
+ newBrowserCDPSession(params?: BrowserNewBrowserCDPSessionParams): Promise<BrowserNewBrowserCDPSessionResult>;
+ startTracing(params: BrowserStartTracingParams): Promise<BrowserStartTracingResult>;
+ stopTracing(params?: BrowserStopTracingParams): Promise<BrowserStopTracingResult>;
}
export type BrowserContextEvent = {
context: BrowserContextChannel,
@@ -1329,43 +1325,43 @@ export interface BrowserContextEventTarget {
}
export interface BrowserContextChannel extends BrowserContextEventTarget, Channel {
_type_BrowserContext: boolean;
- addCookies(params: BrowserContextAddCookiesParams, progress?: Progress): Promise<BrowserContextAddCookiesResult>;
- addInitScript(params: BrowserContextAddInitScriptParams, progress?: Progress): Promise<BrowserContextAddInitScriptResult>;
- clearCookies(params: BrowserContextClearCookiesParams, progress?: Progress): Promise<BrowserContextClearCookiesResult>;
- clearPermissions(params?: BrowserContextClearPermissionsParams, progress?: Progress): Promise<BrowserContextClearPermissionsResult>;
- close(params: BrowserContextCloseParams, progress?: Progress): Promise<BrowserContextCloseResult>;
- cookies(params: BrowserContextCookiesParams, progress?: Progress): Promise<BrowserContextCookiesResult>;
- exposeBinding(params: BrowserContextExposeBindingParams, progress?: Progress): Promise<BrowserContextExposeBindingResult>;
- grantPermissions(params: BrowserContextGrantPermissionsParams, progress?: Progress): Promise<BrowserContextGrantPermissionsResult>;
- newPage(params?: BrowserContextNewPageParams, progress?: Progress): Promise<BrowserContextNewPageResult>;
- registerSelectorEngine(params: BrowserContextRegisterSelectorEngineParams, progress?: Progress): Promise<BrowserContextRegisterSelectorEngineResult>;
- setTestIdAttributeName(params: BrowserContextSetTestIdAttributeNameParams, progress?: Progress): Promise<BrowserContextSetTestIdAttributeNameResult>;
- setExtraHTTPHeaders(params: BrowserContextSetExtraHTTPHeadersParams, progress?: Progress): Promise<BrowserContextSetExtraHTTPHeadersResult>;
- setGeolocation(params: BrowserContextSetGeolocationParams, progress?: Progress): Promise<BrowserContextSetGeolocationResult>;
- setHTTPCredentials(params: BrowserContextSetHTTPCredentialsParams, progress?: Progress): Promise<BrowserContextSetHTTPCredentialsResult>;
- setNetworkInterceptionPatterns(params: BrowserContextSetNetworkInterceptionPatternsParams, progress?: Progress): Promise<BrowserContextSetNetworkInterceptionPatternsResult>;
- setWebSocketInterceptionPatterns(params: BrowserContextSetWebSocketInterceptionPatternsParams, progress?: Progress): Promise<BrowserContextSetWebSocketInterceptionPatternsResult>;
- setOffline(params: BrowserContextSetOfflineParams, progress?: Progress): Promise<BrowserContextSetOfflineResult>;
- storageState(params: BrowserContextStorageStateParams, progress?: Progress): Promise<BrowserContextStorageStateResult>;
- setStorageState(params: BrowserContextSetStorageStateParams, progress?: Progress): Promise<BrowserContextSetStorageStateResult>;
- pause(params?: BrowserContextPauseParams, progress?: Progress): Promise<BrowserContextPauseResult>;
- enableRecorder(params: BrowserContextEnableRecorderParams, progress?: Progress): Promise<BrowserContextEnableRecorderResult>;
- disableRecorder(params?: BrowserContextDisableRecorderParams, progress?: Progress): Promise<BrowserContextDisableRecorderResult>;
- exposeConsoleApi(params?: BrowserContextExposeConsoleApiParams, progress?: Progress): Promise<BrowserContextExposeConsoleApiResult>;
- newCDPSession(params: BrowserContextNewCDPSessionParams, progress?: Progress): Promise<BrowserContextNewCDPSessionResult>;
- createTempFiles(params: BrowserContextCreateTempFilesParams, progress?: Progress): Promise<BrowserContextCreateTempFilesResult>;
- updateSubscription(params: BrowserContextUpdateSubscriptionParams, progress?: Progress): Promise<BrowserContextUpdateSubscriptionResult>;
- clockFastForward(params: BrowserContextClockFastForwardParams, progress?: Progress): Promise<BrowserContextClockFastForwardResult>;
- clockInstall(params: BrowserContextClockInstallParams, progress?: Progress): Promise<BrowserContextClockInstallResult>;
- clockPauseAt(params: BrowserContextClockPauseAtParams, progress?: Progress): Promise<BrowserContextClockPauseAtResult>;
- clockResume(params?: BrowserContextClockResumeParams, progress?: Progress): Promise<BrowserContextClockResumeResult>;
- clockRunFor(params: BrowserContextClockRunForParams, progress?: Progress): Promise<BrowserContextClockRunForResult>;
- clockSetFixedTime(params: BrowserContextClockSetFixedTimeParams, progress?: Progress): Promise<BrowserContextClockSetFixedTimeResult>;
- clockSetSystemTime(params: BrowserContextClockSetSystemTimeParams, progress?: Progress): Promise<BrowserContextClockSetSystemTimeResult>;
- credentialsInstall(params?: BrowserContextCredentialsInstallParams, progress?: Progress): Promise<BrowserContextCredentialsInstallResult>;
- credentialsCreate(params: BrowserContextCredentialsCreateParams, progress?: Progress): Promise<BrowserContextCredentialsCreateResult>;
- credentialsGet(params: BrowserContextCredentialsGetParams, progress?: Progress): Promise<BrowserContextCredentialsGetResult>;
- credentialsDelete(params: BrowserContextCredentialsDeleteParams, progress?: Progress): Promise<BrowserContextCredentialsDeleteResult>;
+ addCookies(params: BrowserContextAddCookiesParams): Promise<BrowserContextAddCookiesResult>;
+ addInitScript(params: BrowserContextAddInitScriptParams): Promise<BrowserContextAddInitScriptResult>;
+ clearCookies(params: BrowserContextClearCookiesParams): Promise<BrowserContextClearCookiesResult>;
+ clearPermissions(params?: BrowserContextClearPermissionsParams): Promise<BrowserContextClearPermissionsResult>;
+ close(params: BrowserContextCloseParams): Promise<BrowserContextCloseResult>;
+ cookies(params: BrowserContextCookiesParams): Promise<BrowserContextCookiesResult>;
+ exposeBinding(params: BrowserContextExposeBindingParams): Promise<BrowserContextExposeBindingResult>;
+ grantPermissions(params: BrowserContextGrantPermissionsParams): Promise<BrowserContextGrantPermissionsResult>;
+ newPage(params?: BrowserContextNewPageParams): Promise<BrowserContextNewPageResult>;
+ registerSelectorEngine(params: BrowserContextRegisterSelectorEngineParams): Promise<BrowserContextRegisterSelectorEngineResult>;
+ setTestIdAttributeName(params: BrowserContextSetTestIdAttributeNameParams): Promise<BrowserContextSetTestIdAttributeNameResult>;
+ setExtraHTTPHeaders(params: BrowserContextSetExtraHTTPHeadersParams): Promise<BrowserContextSetExtraHTTPHeadersResult>;
+ setGeolocation(params: BrowserContextSetGeolocationParams): Promise<BrowserContextSetGeolocationResult>;
+ setHTTPCredentials(params: BrowserContextSetHTTPCredentialsParams): Promise<BrowserContextSetHTTPCredentialsResult>;
+ setNetworkInterceptionPatterns(params: BrowserContextSetNetworkInterceptionPatternsParams): Promise<BrowserContextSetNetworkInterceptionPatternsResult>;
+ setWebSocketInterceptionPatterns(params: BrowserContextSetWebSocketInterceptionPatternsParams): Promise<BrowserContextSetWebSocketInterceptionPatternsResult>;
+ setOffline(params: BrowserContextSetOfflineParams): Promise<BrowserContextSetOfflineResult>;
+ storageState(params: BrowserContextStorageStateParams): Promise<BrowserContextStorageStateResult>;
+ setStorageState(params: BrowserContextSetStorageStateParams): Promise<BrowserContextSetStorageStateResult>;
+ pause(params?: BrowserContextPauseParams): Promise<BrowserContextPauseResult>;
+ enableRecorder(params: BrowserContextEnableRecorderParams): Promise<BrowserContextEnableRecorderResult>;
+ disableRecorder(params?: BrowserContextDisableRecorderParams): Promise<BrowserContextDisableRecorderResult>;
+ exposeConsoleApi(params?: BrowserContextExposeConsoleApiParams): Promise<BrowserContextExposeConsoleApiResult>;
+ newCDPSession(params: BrowserContextNewCDPSessionParams): Promise<BrowserContextNewCDPSessionResult>;
+ createTempFiles(params: BrowserContextCreateTempFilesParams): Promise<BrowserContextCreateTempFilesResult>;
+ updateSubscription(params: BrowserContextUpdateSubscriptionParams): Promise<BrowserContextUpdateSubscriptionResult>;
+ clockFastForward(params: BrowserContextClockFastForwardParams): Promise<BrowserContextClockFastForwardResult>;
+ clockInstall(params: BrowserContextClockInstallParams): Promise<BrowserContextClockInstallResult>;
+ clockPauseAt(params: BrowserContextClockPauseAtParams): Promise<BrowserContextClockPauseAtResult>;
+ clockResume(params?: BrowserContextClockResumeParams): Promise<BrowserContextClockResumeResult>;
+ clockRunFor(params: BrowserContextClockRunForParams): Promise<BrowserContextClockRunForResult>;
+ clockSetFixedTime(params: BrowserContextClockSetFixedTimeParams): Promise<BrowserContextClockSetFixedTimeResult>;
+ clockSetSystemTime(params: BrowserContextClockSetSystemTimeParams): Promise<BrowserContextClockSetSystemTimeResult>;
+ credentialsInstall(params?: BrowserContextCredentialsInstallParams): Promise<BrowserContextCredentialsInstallResult>;
+ credentialsCreate(params: BrowserContextCredentialsCreateParams): Promise<BrowserContextCredentialsCreateResult>;
+ credentialsGet(params: BrowserContextCredentialsGetParams): Promise<BrowserContextCredentialsGetResult>;
+ credentialsDelete(params: BrowserContextCredentialsDeleteParams): Promise<BrowserContextCredentialsDeleteResult>;
}
export type BrowserContextBindingCallEvent = {
binding: BindingCallChannel,
@@ -1811,10 +1807,10 @@ export interface BrowserTypeEventTarget {
}
export interface BrowserTypeChannel extends BrowserTypeEventTarget, Channel {
_type_BrowserType: boolean;
- launch(params: BrowserTypeLaunchParams, progress?: Progress): Promise<BrowserTypeLaunchResult>;
- launchPersistentContext(params: BrowserTypeLaunchPersistentContextParams, progress?: Progress): Promise<BrowserTypeLaunchPersistentContextResult>;
- connectOverCDP(params: BrowserTypeConnectOverCDPParams, progress?: Progress): Promise<BrowserTypeConnectOverCDPResult>;
- connectToWorker(params: BrowserTypeConnectToWorkerParams, progress?: Progress): Promise<BrowserTypeConnectToWorkerResult>;
+ launch(params: BrowserTypeLaunchParams): Promise<BrowserTypeLaunchResult>;
+ launchPersistentContext(params: BrowserTypeLaunchPersistentContextParams): Promise<BrowserTypeLaunchPersistentContextResult>;
+ connectOverCDP(params: BrowserTypeConnectOverCDPParams): Promise<BrowserTypeConnectOverCDPResult>;
+ connectToWorker(params: BrowserTypeConnectToWorkerParams): Promise<BrowserTypeConnectToWorkerResult>;
}
export type BrowserTypeLaunchParams = {
channel?: string,
@@ -2110,7 +2106,7 @@ export interface DisposableEventTarget {
}
export interface DisposableChannel extends DisposableEventTarget, Channel {
_type_Disposable: boolean;
- dispose(params?: DisposableDisposeParams, progress?: Progress): Promise<DisposableDisposeResult>;
+ dispose(params?: DisposableDisposeParams): Promise<DisposableDisposeResult>;
}
export type DisposableDisposeParams = {};
export type DisposableDisposeOptions = {};
@@ -2133,7 +2129,7 @@ export interface ElectronEventTarget {
}
export interface ElectronChannel extends ElectronEventTarget, Channel {
_type_Electron: boolean;
- launch(params: ElectronLaunchParams, progress?: Progress): Promise<ElectronLaunchResult>;
+ launch(params: ElectronLaunchParams): Promise<ElectronLaunchResult>;
}
export type ElectronLaunchParams = {
executablePath?: string,
@@ -2239,10 +2235,10 @@ export interface ElectronApplicationEventTarget {
}
export interface ElectronApplicationChannel extends ElectronApplicationEventTarget, Channel {
_type_ElectronApplication: boolean;
- browserWindow(params: ElectronApplicationBrowserWindowParams, progress?: Progress): Promise<ElectronApplicationBrowserWindowResult>;
- evaluateExpression(params: ElectronApplicationEvaluateExpressionParams, progress?: Progress): Promise<ElectronApplicationEvaluateExpressionResult>;
- evaluateExpressionHandle(params: ElectronApplicationEvaluateExpressionHandleParams, progress?: Progress): Promise<ElectronApplicationEvaluateExpressionHandleResult>;
- updateSubscription(params: ElectronApplicationUpdateSubscriptionParams, progress?: Progress): Promise<ElectronApplicationUpdateSubscriptionResult>;
+ browserWindow(params: ElectronApplicationBrowserWindowParams): Promise<ElectronApplicationBrowserWindowResult>;
+ evaluateExpression(params: ElectronApplicationEvaluateExpressionParams): Promise<ElectronApplicationEvaluateExpressionResult>;
+ evaluateExpressionHandle(params: ElectronApplicationEvaluateExpressionHandleParams): Promise<ElectronApplicationEvaluateExpressionHandleResult>;
+ updateSubscription(params: ElectronApplicationUpdateSubscriptionParams): Promise<ElectronApplicationUpdateSubscriptionResult>;
}
export type ElectronApplicationCloseEvent = {};
export type ElectronApplicationConsoleEvent = {
@@ -2314,55 +2310,55 @@ export interface FrameEventTarget {
}
export interface FrameChannel extends FrameEventTarget, Channel {
_type_Frame: boolean;
- evalOnSelector(params: FrameEvalOnSelectorParams, progress?: Progress): Promise<FrameEvalOnSelectorResult>;
- evalOnSelectorAll(params: FrameEvalOnSelectorAllParams, progress?: Progress): Promise<FrameEvalOnSelectorAllResult>;
- addScriptTag(params: FrameAddScriptTagParams, progress?: Progress): Promise<FrameAddScriptTagResult>;
- addStyleTag(params: FrameAddStyleTagParams, progress?: Progress): Promise<FrameAddStyleTagResult>;
- ariaSnapshot(params: FrameAriaSnapshotParams, progress?: Progress): Promise<FrameAriaSnapshotResult>;
- blur(params: FrameBlurParams, progress?: Progress): Promise<FrameBlurResult>;
- check(params: FrameCheckParams, progress?: Progress): Promise<FrameCheckResult>;
- click(params: FrameClickParams, progress?: Progress): Promise<FrameClickResult>;
- content(params?: FrameContentParams, progress?: Progress): Promise<FrameContentResult>;
- dragAndDrop(params: FrameDragAndDropParams, progress?: Progress): Promise<FrameDragAndDropResult>;
- drop(params: FrameDropParams, progress?: Progress): Promise<FrameDropResult>;
- dblclick(params: FrameDblclickParams, progress?: Progress): Promise<FrameDblclickResult>;
- dispatchEvent(params: FrameDispatchEventParams, progress?: Progress): Promise<FrameDispatchEventResult>;
- evaluateExpression(params: FrameEvaluateExpressionParams, progress?: Progress): Promise<FrameEvaluateExpressionResult>;
- evaluateExpressionHandle(params: FrameEvaluateExpressionHandleParams, progress?: Progress): Promise<FrameEvaluateExpressionHandleResult>;
- fill(params: FrameFillParams, progress?: Progress): Promise<FrameFillResult>;
- focus(params: FrameFocusParams, progress?: Progress): Promise<FrameFocusResult>;
- frameElement(params?: FrameFrameElementParams, progress?: Progress): Promise<FrameFrameElementResult>;
- resolveSelector(params: FrameResolveSelectorParams, progress?: Progress): Promise<FrameResolveSelectorResult>;
- highlight(params: FrameHighlightParams, progress?: Progress): Promise<FrameHighlightResult>;
- hideHighlight(params: FrameHideHighlightParams, progress?: Progress): Promise<FrameHideHighlightResult>;
- getAttribute(params: FrameGetAttributeParams, progress?: Progress): Promise<FrameGetAttributeResult>;
- goto(params: FrameGotoParams, progress?: Progress): Promise<FrameGotoResult>;
- hover(params: FrameHoverParams, progress?: Progress): Promise<FrameHoverResult>;
- innerHTML(params: FrameInnerHTMLParams, progress?: Progress): Promise<FrameInnerHTMLResult>;
- innerText(params: FrameInnerTextParams, progress?: Progress): Promise<FrameInnerTextResult>;
- inputValue(params: FrameInputValueParams, progress?: Progress): Promise<FrameInputValueResult>;
- isChecked(params: FrameIsCheckedParams, progress?: Progress): Promise<FrameIsCheckedResult>;
- isDisabled(params: FrameIsDisabledParams, progress?: Progress): Promise<FrameIsDisabledResult>;
- isEnabled(params: FrameIsEnabledParams, progress?: Progress): Promise<FrameIsEnabledResult>;
- isHidden(params: FrameIsHiddenParams, progress?: Progress): Promise<FrameIsHiddenResult>;
- isVisible(params: FrameIsVisibleParams, progress?: Progress): Promise<FrameIsVisibleResult>;
- isEditable(params: FrameIsEditableParams, progress?: Progress): Promise<FrameIsEditableResult>;
- press(params: FramePressParams, progress?: Progress): Promise<FramePressResult>;
- querySelector(params: FrameQuerySelectorParams, progress?: Progress): Promise<FrameQuerySelectorResult>;
- querySelectorAll(params: FrameQuerySelectorAllParams, progress?: Progress): Promise<FrameQuerySelectorAllResult>;
- queryCount(params: FrameQueryCountParams, progress?: Progress): Promise<FrameQueryCountResult>;
- selectOption(params: FrameSelectOptionParams, progress?: Progress): Promise<FrameSelectOptionResult>;
- setContent(params: FrameSetContentParams, progress?: Progress): Promise<FrameSetContentResult>;
- setInputFiles(params: FrameSetInputFilesParams, progress?: Progress): Promise<FrameSetInputFilesResult>;
- tap(params: FrameTapParams, progress?: Progress): Promise<FrameTapResult>;
- textContent(params: FrameTextContentParams, progress?: Progress): Promise<FrameTextContentResult>;
- title(params?: FrameTitleParams, progress?: Progress): Promise<FrameTitleResult>;
- type(params: FrameTypeParams, progress?: Progress): Promise<FrameTypeResult>;
- uncheck(params: FrameUncheckParams, progress?: Progress): Promise<FrameUncheckResult>;
- waitForTimeout(params: FrameWaitForTimeoutParams, progress?: Progress): Promise<FrameWaitForTimeoutResult>;
- waitForFunction(params: FrameWaitForFunctionParams, progress?: Progress): Promise<FrameWaitForFunctionResult>;
- waitForSelector(params: FrameWaitForSelectorParams, progress?: Progress): Promise<FrameWaitForSelectorResult>;
- expect(params: FrameExpectParams, progress?: Progress): Promise<FrameExpectResult>;
+ evalOnSelector(params: FrameEvalOnSelectorParams): Promise<FrameEvalOnSelectorResult>;
+ evalOnSelectorAll(params: FrameEvalOnSelectorAllParams): Promise<FrameEvalOnSelectorAllResult>;
+ addScriptTag(params: FrameAddScriptTagParams): Promise<FrameAddScriptTagResult>;
+ addStyleTag(params: FrameAddStyleTagParams): Promise<FrameAddStyleTagResult>;
+ ariaSnapshot(params: FrameAriaSnapshotParams): Promise<FrameAriaSnapshotResult>;
+ blur(params: FrameBlurParams): Promise<FrameBlurResult>;
+ check(params: FrameCheckParams): Promise<FrameCheckResult>;
+ click(params: FrameClickParams): Promise<FrameClickResult>;
+ content(params?: FrameContentParams): Promise<FrameContentResult>;
+ dragAndDrop(params: FrameDragAndDropParams): Promise<FrameDragAndDropResult>;
+ drop(params: FrameDropParams): Promise<FrameDropResult>;
+ dblclick(params: FrameDblclickParams): Promise<FrameDblclickResult>;
+ dispatchEvent(params: FrameDispatchEventParams): Promise<FrameDispatchEventResult>;
+ evaluateExpression(params: FrameEvaluateExpressionParams): Promise<FrameEvaluateExpressionResult>;
+ evaluateExpressionHandle(params: FrameEvaluateExpressionHandleParams): Promise<FrameEvaluateExpressionHandleResult>;
+ fill(params: FrameFillParams): Promise<FrameFillResult>;
+ focus(params: FrameFocusParams): Promise<FrameFocusResult>;
+ frameElement(params?: FrameFrameElementParams): Promise<FrameFrameElementResult>;
+ resolveSelector(params: FrameResolveSelectorParams): Promise<FrameResolveSelectorResult>;
+ highlight(params: FrameHighlightParams): Promise<FrameHighlightResult>;
+ hideHighlight(params: FrameHideHighlightParams): Promise<FrameHideHighlightResult>;
+ getAttribute(params: FrameGetAttributeParams): Promise<FrameGetAttributeResult>;
+ goto(params: FrameGotoParams): Promise<FrameGotoResult>;
+ hover(params: FrameHoverParams): Promise<FrameHoverResult>;
+ innerHTML(params: FrameInnerHTMLParams): Promise<FrameInnerHTMLResult>;
+ innerText(params: FrameInnerTextParams): Promise<FrameInnerTextResult>;
+ inputValue(params: FrameInputValueParams): Promise<FrameInputValueResult>;
+ isChecked(params: FrameIsCheckedParams): Promise<FrameIsCheckedResult>;
+ isDisabled(params: FrameIsDisabledParams): Promise<FrameIsDisabledResult>;
+ isEnabled(params: FrameIsEnabledParams): Promise<FrameIsEnabledResult>;
+ isHidden(params: FrameIsHiddenParams): Promise<FrameIsHiddenResult>;
+ isVisible(params: FrameIsVisibleParams): Promise<FrameIsVisibleResult>;
+ isEditable(params: FrameIsEditableParams): Promise<FrameIsEditableResult>;
+ press(params: FramePressParams): Promise<FramePressResult>;
+ querySelector(params: FrameQuerySelectorParams): Promise<FrameQuerySelectorResult>;
+ querySelectorAll(params: FrameQuerySelectorAllParams): Promise<FrameQuerySelectorAllResult>;
+ queryCount(params: FrameQueryCountParams): Promise<FrameQueryCountResult>;
+ selectOption(params: FrameSelectOptionParams): Promise<FrameSelectOptionResult>;
+ setContent(params: FrameSetContentParams): Promise<FrameSetContentResult>;
+ setInputFiles(params: FrameSetInputFilesParams): Promise<FrameSetInputFilesResult>;
+ tap(params: FrameTapParams): Promise<FrameTapResult>;
+ textContent(params: FrameTextContentParams): Promise<FrameTextContentResult>;
+ title(params?: FrameTitleParams): Promise<FrameTitleResult>;
+ type(params: FrameTypeParams): Promise<FrameTypeResult>;
+ uncheck(params: FrameUncheckParams): Promise<FrameUncheckResult>;
+ waitForTimeout(params: FrameWaitForTimeoutParams): Promise<FrameWaitForTimeoutResult>;
+ waitForFunction(params: FrameWaitForFunctionParams): Promise<FrameWaitForFunctionResult>;
+ waitForSelector(params: FrameWaitForSelectorParams): Promise<FrameWaitForSelectorResult>;
+ expect(params: FrameExpectParams): Promise<FrameExpectResult>;
}
export type FrameLoadstateEvent = {
add?: LifecycleEvent,
@@ -3044,12 +3040,12 @@ export interface JSHandleEventTarget {
}
export interface JSHandleChannel extends JSHandleEventTarget, Channel {
_type_JSHandle: boolean;
- dispose(params?: JSHandleDisposeParams, progress?: Progress): Promise<JSHandleDisposeResult>;
- evaluateExpression(params: JSHandleEvaluateExpressionParams, progress?: Progress): Promise<JSHandleEvaluateExpressionResult>;
- evaluateExpressionHandle(params: JSHandleEvaluateExpressionHandleParams, progress?: Progress): Promise<JSHandleEvaluateExpressionHandleResult>;
- getPropertyList(params?: JSHandleGetPropertyListParams, progress?: Progress): Promise<JSHandleGetPropertyListResult>;
- getProperty(params: JSHandleGetPropertyParams, progress?: Progress): Promise<JSHandleGetPropertyResult>;
- jsonValue(params?: JSHandleJsonValueParams, progress?: Progress): Promise<JSHandleJsonValueResult>;
+ dispose(params?: JSHandleDisposeParams): Promise<JSHandleDisposeResult>;
+ evaluateExpression(params: JSHandleEvaluateExpressionParams): Promise<JSHandleEvaluateExpressionResult>;
+ evaluateExpressionHandle(params: JSHandleEvaluateExpressionHandleParams): Promise<JSHandleEvaluateExpressionHandleResult>;
+ getPropertyList(params?: JSHandleGetPropertyListParams): Promise<JSHandleGetPropertyListResult>;
+ getProperty(params: JSHandleGetPropertyParams): Promise<JSHandleGetPropertyResult>;
+ jsonValue(params?: JSHandleJsonValueParams): Promise<JSHandleJsonValueResult>;
}
export type JSHandlePreviewUpdatedEvent = {
preview: string,
@@ -3112,42 +3108,42 @@ export interface ElementHandleEventTarget {
}
export interface ElementHandleChannel extends ElementHandleEventTarget, JSHandleChannel {
_type_ElementHandle: boolean;
- evalOnSelector(params: ElementHandleEvalOnSelectorParams, progress?: Progress): Promise<ElementHandleEvalOnSelectorResult>;
- evalOnSelectorAll(params: ElementHandleEvalOnSelectorAllParams, progress?: Progress): Promise<ElementHandleEvalOnSelectorAllResult>;
- boundingBox(params?: ElementHandleBoundingBoxParams, progress?: Progress): Promise<ElementHandleBoundingBoxResult>;
- check(params: ElementHandleCheckParams, progress?: Progress): Promise<ElementHandleCheckResult>;
- click(params: ElementHandleClickParams, progress?: Progress): Promise<ElementHandleClickResult>;
- contentFrame(params?: ElementHandleContentFrameParams, progress?: Progress): Promise<ElementHandleContentFrameResult>;
- dblclick(params: ElementHandleDblclickParams, progress?: Progress): Promise<ElementHandleDblclickResult>;
- dispatchEvent(params: ElementHandleDispatchEventParams, progress?: Progress): Promise<ElementHandleDispatchEventResult>;
- fill(params: ElementHandleFillParams, progress?: Progress): Promise<ElementHandleFillResult>;
- focus(params?: ElementHandleFocusParams, progress?: Progress): Promise<ElementHandleFocusResult>;
- getAttribute(params: ElementHandleGetAttributeParams, progress?: Progress): Promise<ElementHandleGetAttributeResult>;
- hover(params: ElementHandleHoverParams, progress?: Progress): Promise<ElementHandleHoverResult>;
- innerHTML(params?: ElementHandleInnerHTMLParams, progress?: Progress): Promise<ElementHandleInnerHTMLResult>;
- innerText(params?: ElementHandleInnerTextParams, progress?: Progress): Promise<ElementHandleInnerTextResult>;
- inputValue(params?: ElementHandleInputValueParams, progress?: Progress): Promise<ElementHandleInputValueResult>;
- isChecked(params?: ElementHandleIsCheckedParams, progress?: Progress): Promise<ElementHandleIsCheckedResult>;
- isDisabled(params?: ElementHandleIsDisabledParams, progress?: Progress): Promise<ElementHandleIsDisabledResult>;
- isEditable(params?: ElementHandleIsEditableParams, progress?: Progress): Promise<ElementHandleIsEditableResult>;
- isEnabled(params?: ElementHandleIsEnabledParams, progress?: Progress): Promise<ElementHandleIsEnabledResult>;
- isHidden(params?: ElementHandleIsHiddenParams, progress?: Progress): Promise<ElementHandleIsHiddenResult>;
- isVisible(params?: ElementHandleIsVisibleParams, progress?: Progress): Promise<ElementHandleIsVisibleResult>;
- ownerFrame(params?: ElementHandleOwnerFrameParams, progress?: Progress): Promise<ElementHandleOwnerFrameResult>;
- press(params: ElementHandlePressParams, progress?: Progress): Promise<ElementHandlePressResult>;
- querySelector(params: ElementHandleQuerySelectorParams, progress?: Progress): Promise<ElementHandleQuerySelectorResult>;
- querySelectorAll(params: ElementHandleQuerySelectorAllParams, progress?: Progress): Promise<ElementHandleQuerySelectorAllResult>;
- screenshot(params: ElementHandleScreenshotParams, progress?: Progress): Promise<ElementHandleScreenshotResult>;
- scrollIntoViewIfNeeded(params: ElementHandleScrollIntoViewIfNeededParams, progress?: Progress): Promise<ElementHandleScrollIntoViewIfNeededResult>;
- selectOption(params: ElementHandleSelectOptionParams, progress?: Progress): Promise<ElementHandleSelectOptionResult>;
- selectText(params: ElementHandleSelectTextParams, progress?: Progress): Promise<ElementHandleSelectTextResult>;
- setInputFiles(params: ElementHandleSetInputFilesParams, progress?: Progress): Promise<ElementHandleSetInputFilesResult>;
- tap(params: ElementHandleTapParams, progress?: Progress): Promise<ElementHandleTapResult>;
- textContent(params?: ElementHandleTextContentParams, progress?: Progress): Promise<ElementHandleTextContentResult>;
- type(params: ElementHandleTypeParams, progress?: Progress): Promise<ElementHandleTypeResult>;
- uncheck(params: ElementHandleUncheckParams, progress?: Progress): Promise<ElementHandleUncheckResult>;
- waitForElementState(params: ElementHandleWaitForElementStateParams, progress?: Progress): Promise<ElementHandleWaitForElementStateResult>;
- waitForSelector(params: ElementHandleWaitForSelectorParams, progress?: Progress): Promise<ElementHandleWaitForSelectorResult>;
+ evalOnSelector(params: ElementHandleEvalOnSelectorParams): Promise<ElementHandleEvalOnSelectorResult>;
+ evalOnSelectorAll(params: ElementHandleEvalOnSelectorAllParams): Promise<ElementHandleEvalOnSelectorAllResult>;
+ boundingBox(params?: ElementHandleBoundingBoxParams): Promise<ElementHandleBoundingBoxResult>;
+ check(params: ElementHandleCheckParams): Promise<ElementHandleCheckResult>;
+ click(params: ElementHandleClickParams): Promise<ElementHandleClickResult>;
+ contentFrame(params?: ElementHandleContentFrameParams): Promise<ElementHandleContentFrameResult>;
+ dblclick(params: ElementHandleDblclickParams): Promise<ElementHandleDblclickResult>;
+ dispatchEvent(params: ElementHandleDispatchEventParams): Promise<ElementHandleDispatchEventResult>;
+ fill(params: ElementHandleFillParams): Promise<ElementHandleFillResult>;
+ focus(params?: ElementHandleFocusParams): Promise<ElementHandleFocusResult>;
+ getAttribute(params: ElementHandleGetAttributeParams): Promise<ElementHandleGetAttributeResult>;
+ hover(params: ElementHandleHoverParams): Promise<ElementHandleHoverResult>;
+ innerHTML(params?: ElementHandleInnerHTMLParams): Promise<ElementHandleInnerHTMLResult>;
+ innerText(params?: ElementHandleInnerTextParams): Promise<ElementHandleInnerTextResult>;
+ inputValue(params?: ElementHandleInputValueParams): Promise<ElementHandleInputValueResult>;
+ isChecked(params?: ElementHandleIsCheckedParams): Promise<ElementHandleIsCheckedResult>;
+ isDisabled(params?: ElementHandleIsDisabledParams): Promise<ElementHandleIsDisabledResult>;
+ isEditable(params?: ElementHandleIsEditableParams): Promise<ElementHandleIsEditableResult>;
+ isEnabled(params?: ElementHandleIsEnabledParams): Promise<ElementHandleIsEnabledResult>;
+ isHidden(params?: ElementHandleIsHiddenParams): Promise<ElementHandleIsHiddenResult>;
+ isVisible(params?: ElementHandleIsVisibleParams): Promise<ElementHandleIsVisibleResult>;
+ ownerFrame(params?: ElementHandleOwnerFrameParams): Promise<ElementHandleOwnerFrameResult>;
+ press(params: ElementHandlePressParams): Promise<ElementHandlePressResult>;
+ querySelector(params: ElementHandleQuerySelectorParams): Promise<ElementHandleQuerySelectorResult>;
+ querySelectorAll(params: ElementHandleQuerySelectorAllParams): Promise<ElementHandleQuerySelectorAllResult>;
+ screenshot(params: ElementHandleScreenshotParams): Promise<ElementHandleScreenshotResult>;
+ scrollIntoViewIfNeeded(params: ElementHandleScrollIntoViewIfNeededParams): Promise<ElementHandleScrollIntoViewIfNeededResult>;
+ selectOption(params: ElementHandleSelectOptionParams): Promise<ElementHandleSelectOptionResult>;
+ selectText(params: ElementHandleSelectTextParams): Promise<ElementHandleSelectTextResult>;
+ setInputFiles(params: ElementHandleSetInputFilesParams): Promise<ElementHandleSetInputFilesResult>;
+ tap(params: ElementHandleTapParams): Promise<ElementHandleTapResult>;
+ textContent(params?: ElementHandleTextContentParams): Promise<ElementHandleTextContentResult>;
+ type(params: ElementHandleTypeParams): Promise<ElementHandleTypeResult>;
+ uncheck(params: ElementHandleUncheckParams): Promise<ElementHandleUncheckResult>;
+ waitForElementState(params: ElementHandleWaitForElementStateParams): Promise<ElementHandleWaitForElementStateResult>;
+ waitForSelector(params: ElementHandleWaitForSelectorParams): Promise<ElementHandleWaitForSelectorResult>;
}
export type ElementHandleEvalOnSelectorParams = {
selector: string,
@@ -3549,16 +3545,16 @@ export interface LocalUtilsEventTarget {
}
export interface LocalUtilsChannel extends LocalUtilsEventTarget, Channel {
_type_LocalUtils: boolean;
- zip(params: LocalUtilsZipParams, progress?: Progress): Promise<LocalUtilsZipResult>;
- harOpen(params: LocalUtilsHarOpenParams, progress?: Progress): Promise<LocalUtilsHarOpenResult>;
- harLookup(params: LocalUtilsHarLookupParams, progress?: Progress): Promise<LocalUtilsHarLookupResult>;
- harClose(params: LocalUtilsHarCloseParams, progress?: Progress): Promise<LocalUtilsHarCloseResult>;
- harUnzip(params: LocalUtilsHarUnzipParams, progress?: Progress): Promise<LocalUtilsHarUnzipResult>;
- connect(params: LocalUtilsConnectParams, progress?: Progress): Promise<LocalUtilsConnectResult>;
- tracingStarted(params: LocalUtilsTracingStartedParams, progress?: Progress): Promise<LocalUtilsTracingStartedResult>;
- addStackToTracingNoReply(params: LocalUtilsAddStackToTracingNoReplyParams, progress?: Progress): Promise<LocalUtilsAddStackToTracingNoReplyResult>;
- traceDiscarded(params: LocalUtilsTraceDiscardedParams, progress?: Progress): Promise<LocalUtilsTraceDiscardedResult>;
- globToRegex(params: LocalUtilsGlobToRegexParams, progress?: Progress): Promise<LocalUtilsGlobToRegexResult>;
+ zip(params: LocalUtilsZipParams): Promise<LocalUtilsZipResult>;
+ harOpen(params: LocalUtilsHarOpenParams): Promise<LocalUtilsHarOpenResult>;
+ harLookup(params: LocalUtilsHarLookupParams): Promise<LocalUtilsHarLookupResult>;
+ harClose(params: LocalUtilsHarCloseParams): Promise<LocalUtilsHarCloseResult>;
+ harUnzip(params: LocalUtilsHarUnzipParams): Promise<LocalUtilsHarUnzipResult>;
+ connect(params: LocalUtilsConnectParams): Promise<LocalUtilsConnectResult>;
+ tracingStarted(params: LocalUtilsTracingStartedParams): Promise<LocalUtilsTracingStartedResult>;
+ addStackToTracingNoReply(params: LocalUtilsAddStackToTracingNoReplyParams): Promise<LocalUtilsAddStackToTracingNoReplyResult>;
+ traceDiscarded(params: LocalUtilsTraceDiscardedParams): Promise<LocalUtilsTraceDiscardedResult>;
+ globToRegex(params: LocalUtilsGlobToRegexParams): Promise<LocalUtilsGlobToRegexResult>;
}
export type LocalUtilsZipParams = {
zipFile: string,
@@ -3721,8 +3717,8 @@ export interface RequestEventTarget {
}
export interface RequestChannel extends RequestEventTarget, Channel {
_type_Request: boolean;
- response(params?: RequestResponseParams, progress?: Progress): Promise<RequestResponseResult>;
- rawRequestHeaders(params?: RequestRawRequestHeadersParams, progress?: Progress): Promise<RequestRawRequestHeadersResult>;
+ response(params?: RequestResponseParams): Promise<RequestResponseResult>;
+ rawRequestHeaders(params?: RequestRawRequestHeadersParams): Promise<RequestRawRequestHeadersResult>;
}
export type RequestResponseParams = {};
export type RequestResponseOptions = {};
@@ -3746,10 +3742,10 @@ export interface RouteEventTarget {
}
export interface RouteChannel extends RouteEventTarget, Channel {
_type_Route: boolean;
- redirectNavigationRequest(params: RouteRedirectNavigationRequestParams, progress?: Progress): Promise<RouteRedirectNavigationRequestResult>;
- abort(params: RouteAbortParams, progress?: Progress): Promise<RouteAbortResult>;
- continue(params: RouteContinueParams, progress?: Progress): Promise<RouteContinueResult>;
- fulfill(params: RouteFulfillParams, progress?: Progress): Promise<RouteFulfillResult>;
+ redirectNavigationRequest(params: RouteRedirectNavigationRequestParams): Promise<RouteRedirectNavigationRequestResult>;
+ abort(params: RouteAbortParams): Promise<RouteAbortResult>;
+ continue(params: RouteContinueParams): Promise<RouteContinueResult>;
+ fulfill(params: RouteFulfillParams): Promise<RouteFulfillResult>;
}
export type RouteRedirectNavigationRequestParams = {
url: string,
@@ -3811,12 +3807,12 @@ export interface WebSocketRouteEventTarget {
}
export interface WebSocketRouteChannel extends WebSocketRouteEventTarget, Channel {
_type_WebSocketRoute: boolean;
- connect(params?: WebSocketRouteConnectParams, progress?: Progress): Promise<WebSocketRouteConnectResult>;
- ensureOpened(params?: WebSocketRouteEnsureOpenedParams, progress?: Progress): Promise<WebSocketRouteEnsureOpenedResult>;
- sendToPage(params: WebSocketRouteSendToPageParams, progress?: Progress): Promise<WebSocketRouteSendToPageResult>;
- sendToServer(params: WebSocketRouteSendToServerParams, progress?: Progress): Promise<WebSocketRouteSendToServerResult>;
- closePage(params: WebSocketRouteClosePageParams, progress?: Progress): Promise<WebSocketRouteClosePageResult>;
- closeServer(params: WebSocketRouteCloseServerParams, progress?: Progress): Promise<WebSocketRouteCloseServerResult>;
+ connect(params?: WebSocketRouteConnectParams): Promise<WebSocketRouteConnectResult>;
+ ensureOpened(params?: WebSocketRouteEnsureOpenedParams): Promise<WebSocketRouteEnsureOpenedResult>;
+ sendToPage(params: WebSocketRouteSendToPageParams): Promise<WebSocketRouteSendToPageResult>;
+ sendToServer(params: WebSocketRouteSendToServerParams): Promise<WebSocketRouteSendToServerResult>;
+ closePage(params: WebSocketRouteClosePageParams): Promise<WebSocketRouteClosePageResult>;
+ closeServer(params: WebSocketRouteCloseServerParams): Promise<WebSocketRouteCloseServerResult>;
}
export type WebSocketRouteMessageFromPageEvent = {
message: string,
@@ -3911,12 +3907,12 @@ export interface ResponseEventTarget {
}
export interface ResponseChannel extends ResponseEventTarget, Channel {
_type_Response: boolean;
- body(params?: ResponseBodyParams, progress?: Progress): Promise<ResponseBodyResult>;
- securityDetails(params?: ResponseSecurityDetailsParams, progress?: Progress): Promise<ResponseSecurityDetailsResult>;
- serverAddr(params?: ResponseServerAddrParams, progress?: Progress): Promise<ResponseServerAddrResult>;
- rawResponseHeaders(params?: ResponseRawResponseHeadersParams, progress?: Progress): Promise<ResponseRawResponseHeadersResult>;
- httpVersion(params?: ResponseHttpVersionParams, progress?: Progress): Promise<ResponseHttpVersionResult>;
- sizes(params?: ResponseSizesParams, progress?: Progress): Promise<ResponseSizesResult>;
+ body(params?: ResponseBodyParams): Promise<ResponseBodyResult>;
+ securityDetails(params?: ResponseSecurityDetailsParams): Promise<ResponseSecurityDetailsResult>;
+ serverAddr(params?: ResponseServerAddrParams): Promise<ResponseServerAddrResult>;
+ rawResponseHeaders(params?: ResponseRawResponseHeadersParams): Promise<ResponseRawResponseHeadersResult>;
+ httpVersion(params?: ResponseHttpVersionParams): Promise<ResponseHttpVersionResult>;
+ sizes(params?: ResponseSizesParams): Promise<ResponseSizesResult>;
}
export type ResponseBodyParams = {};
export type ResponseBodyOptions = {};
@@ -4037,64 +4033,64 @@ export interface PageEventTarget {
}
export interface PageChannel extends PageEventTarget, Channel {
_type_Page: boolean;
- addInitScript(params: PageAddInitScriptParams, progress?: Progress): Promise<PageAddInitScriptResult>;
- close(params: PageCloseParams, progress?: Progress): Promise<PageCloseResult>;
- runBeforeUnload(params?: PageRunBeforeUnloadParams, progress?: Progress): Promise<PageRunBeforeUnloadResult>;
- clearConsoleMessages(params?: PageClearConsoleMessagesParams, progress?: Progress): Promise<PageClearConsoleMessagesResult>;
- consoleMessages(params: PageConsoleMessagesParams, progress?: Progress): Promise<PageConsoleMessagesResult>;
- emulateMedia(params: PageEmulateMediaParams, progress?: Progress): Promise<PageEmulateMediaResult>;
- exposeBinding(params: PageExposeBindingParams, progress?: Progress): Promise<PageExposeBindingResult>;
- goBack(params: PageGoBackParams, progress?: Progress): Promise<PageGoBackResult>;
- goForward(params: PageGoForwardParams, progress?: Progress): Promise<PageGoForwardResult>;
- requestGC(params?: PageRequestGCParams, progress?: Progress): Promise<PageRequestGCResult>;
- registerLocatorHandler(params: PageRegisterLocatorHandlerParams, progress?: Progress): Promise<PageRegisterLocatorHandlerResult>;
- resolveLocatorHandlerNoReply(params: PageResolveLocatorHandlerNoReplyParams, progress?: Progress): Promise<PageResolveLocatorHandlerNoReplyResult>;
- unregisterLocatorHandler(params: PageUnregisterLocatorHandlerParams, progress?: Progress): Promise<PageUnregisterLocatorHandlerResult>;
- reload(params: PageReloadParams, progress?: Progress): Promise<PageReloadResult>;
- expectScreenshot(params: PageExpectScreenshotParams, progress?: Progress): Promise<PageExpectScreenshotResult>;
- screenshot(params: PageScreenshotParams, progress?: Progress): Promise<PageScreenshotResult>;
- setExtraHTTPHeaders(params: PageSetExtraHTTPHeadersParams, progress?: Progress): Promise<PageSetExtraHTTPHeadersResult>;
- setNetworkInterceptionPatterns(params: PageSetNetworkInterceptionPatternsParams, progress?: Progress): Promise<PageSetNetworkInterceptionPatternsResult>;
- setWebSocketInterceptionPatterns(params: PageSetWebSocketInterceptionPatternsParams, progress?: Progress): Promise<PageSetWebSocketInterceptionPatternsResult>;
- setViewportSize(params: PageSetViewportSizeParams, progress?: Progress): Promise<PageSetViewportSizeResult>;
- keyboardDown(params: PageKeyboardDownParams, progress?: Progress): Promise<PageKeyboardDownResult>;
- keyboardUp(params: PageKeyboardUpParams, progress?: Progress): Promise<PageKeyboardUpResult>;
- keyboardInsertText(params: PageKeyboardInsertTextParams, progress?: Progress): Promise<PageKeyboardInsertTextResult>;
- keyboardType(params: PageKeyboardTypeParams, progress?: Progress): Promise<PageKeyboardTypeResult>;
- keyboardPress(params: PageKeyboardPressParams, progress?: Progress): Promise<PageKeyboardPressResult>;
- mouseMove(params: PageMouseMoveParams, progress?: Progress): Promise<PageMouseMoveResult>;
- mouseDown(params: PageMouseDownParams, progress?: Progress): Promise<PageMouseDownResult>;
- mouseUp(params: PageMouseUpParams, progress?: Progress): Promise<PageMouseUpResult>;
- mouseClick(params: PageMouseClickParams, progress?: Progress): Promise<PageMouseClickResult>;
- mouseWheel(params: PageMouseWheelParams, progress?: Progress): Promise<PageMouseWheelResult>;
- touchscreenTap(params: PageTouchscreenTapParams, progress?: Progress): Promise<PageTouchscreenTapResult>;
- clearPageErrors(params?: PageClearPageErrorsParams, progress?: Progress): Promise<PageClearPageErrorsResult>;
- pageErrors(params: PagePageErrorsParams, progress?: Progress): Promise<PagePageErrorsResult>;
- pdf(params: PagePdfParams, progress?: Progress): Promise<PagePdfResult>;
- requests(params?: PageRequestsParams, progress?: Progress): Promise<PageRequestsResult>;
- startJSCoverage(params: PageStartJSCoverageParams, progress?: Progress): Promise<PageStartJSCoverageResult>;
- stopJSCoverage(params?: PageStopJSCoverageParams, progress?: Progress): Promise<PageStopJSCoverageResult>;
- startCSSCoverage(params: PageStartCSSCoverageParams, progress?: Progress): Promise<PageStartCSSCoverageResult>;
- stopCSSCoverage(params?: PageStopCSSCoverageParams, progress?: Progress): Promise<PageStopCSSCoverageResult>;
- bringToFront(params?: PageBringToFrontParams, progress?: Progress): Promise<PageBringToFrontResult>;
- pickLocator(params?: PagePickLocatorParams, progress?: Progress): Promise<PagePickLocatorResult>;
- cancelPickLocator(params?: PageCancelPickLocatorParams, progress?: Progress): Promise<PageCancelPickLocatorResult>;
- hideHighlight(params?: PageHideHighlightParams, progress?: Progress): Promise<PageHideHighlightResult>;
- screencastShowOverlay(params: PageScreencastShowOverlayParams, progress?: Progress): Promise<PageScreencastShowOverlayResult>;
- screencastRemoveOverlay(params: PageScreencastRemoveOverlayParams, progress?: Progress): Promise<PageScreencastRemoveOverlayResult>;
- screencastChapter(params: PageScreencastChapterParams, progress?: Progress): Promise<PageScreencastChapterResult>;
- screencastSetOverlayVisible(params: PageScreencastSetOverlayVisibleParams, progress?: Progress): Promise<PageScreencastSetOverlayVisibleResult>;
- screencastShowActions(params: PageScreencastShowActionsParams, progress?: Progress): Promise<PageScreencastShowActionsResult>;
- screencastHideActions(params?: PageScreencastHideActionsParams, progress?: Progress): Promise<PageScreencastHideActionsResult>;
- screencastStart(params: PageScreencastStartParams, progress?: Progress): Promise<PageScreencastStartResult>;
- screencastStop(params?: PageScreencastStopParams, progress?: Progress): Promise<PageScreencastStopResult>;
- updateSubscription(params: PageUpdateSubscriptionParams, progress?: Progress): Promise<PageUpdateSubscriptionResult>;
- setDockTile(params: PageSetDockTileParams, progress?: Progress): Promise<PageSetDockTileResult>;
- webStorageItems(params: PageWebStorageItemsParams, progress?: Progress): Promise<PageWebStorageItemsResult>;
- webStorageGetItem(params: PageWebStorageGetItemParams, progress?: Progress): Promise<PageWebStorageGetItemResult>;
- webStorageSetItem(params: PageWebStorageSetItemParams, progress?: Progress): Promise<PageWebStorageSetItemResult>;
- webStorageRemoveItem(params: PageWebStorageRemoveItemParams, progress?: Progress): Promise<PageWebStorageRemoveItemResult>;
- webStorageClear(params: PageWebStorageClearParams, progress?: Progress): Promise<PageWebStorageClearResult>;
+ addInitScript(params: PageAddInitScriptParams): Promise<PageAddInitScriptResult>;
+ close(params: PageCloseParams): Promise<PageCloseResult>;
+ runBeforeUnload(params?: PageRunBeforeUnloadParams): Promise<PageRunBeforeUnloadResult>;
+ clearConsoleMessages(params?: PageClearConsoleMessagesParams): Promise<PageClearConsoleMessagesResult>;
+ consoleMessages(params: PageConsoleMessagesParams): Promise<PageConsoleMessagesResult>;
+ emulateMedia(params: PageEmulateMediaParams): Promise<PageEmulateMediaResult>;
+ exposeBinding(params: PageExposeBindingParams): Promise<PageExposeBindingResult>;
+ goBack(params: PageGoBackParams): Promise<PageGoBackResult>;
+ goForward(params: PageGoForwardParams): Promise<PageGoForwardResult>;
+ requestGC(params?: PageRequestGCParams): Promise<PageRequestGCResult>;
+ registerLocatorHandler(params: PageRegisterLocatorHandlerParams): Promise<PageRegisterLocatorHandlerResult>;
+ resolveLocatorHandlerNoReply(params: PageResolveLocatorHandlerNoReplyParams): Promise<PageResolveLocatorHandlerNoReplyResult>;
+ unregisterLocatorHandler(params: PageUnregisterLocatorHandlerParams): Promise<PageUnregisterLocatorHandlerResult>;
+ reload(params: PageReloadParams): Promise<PageReloadResult>;
+ expectScreenshot(params: PageExpectScreenshotParams): Promise<PageExpectScreenshotResult>;
+ screenshot(params: PageScreenshotParams): Promise<PageScreenshotResult>;
+ setExtraHTTPHeaders(params: PageSetExtraHTTPHeadersParams): Promise<PageSetExtraHTTPHeadersResult>;
+ setNetworkInterceptionPatterns(params: PageSetNetworkInterceptionPatternsParams): Promise<PageSetNetworkInterceptionPatternsResult>;
+ setWebSocketInterceptionPatterns(params: PageSetWebSocketInterceptionPatternsParams): Promise<PageSetWebSocketInterceptionPatternsResult>;
+ setViewportSize(params: PageSetViewportSizeParams): Promise<PageSetViewportSizeResult>;
+ keyboardDown(params: PageKeyboardDownParams): Promise<PageKeyboardDownResult>;
+ keyboardUp(params: PageKeyboardUpParams): Promise<PageKeyboardUpResult>;
+ keyboardInsertText(params: PageKeyboardInsertTextParams): Promise<PageKeyboardInsertTextResult>;
+ keyboardType(params: PageKeyboardTypeParams): Promise<PageKeyboardTypeResult>;
+ keyboardPress(params: PageKeyboardPressParams): Promise<PageKeyboardPressResult>;
+ mouseMove(params: PageMouseMoveParams): Promise<PageMouseMoveResult>;
+ mouseDown(params: PageMouseDownParams): Promise<PageMouseDownResult>;
+ mouseUp(params: PageMouseUpParams): Promise<PageMouseUpResult>;
+ mouseClick(params: PageMouseClickParams): Promise<PageMouseClickResult>;
+ mouseWheel(params: PageMouseWheelParams): Promise<PageMouseWheelResult>;
+ touchscreenTap(params: PageTouchscreenTapParams): Promise<PageTouchscreenTapResult>;
+ clearPageErrors(params?: PageClearPageErrorsParams): Promise<PageClearPageErrorsResult>;
+ pageErrors(params: PagePageErrorsParams): Promise<PagePageErrorsResult>;
+ pdf(params: PagePdfParams): Promise<PagePdfResult>;
+ requests(params?: PageRequestsParams): Promise<PageRequestsResult>;
+ startJSCoverage(params: PageStartJSCoverageParams): Promise<PageStartJSCoverageResult>;
+ stopJSCoverage(params?: PageStopJSCoverageParams): Promise<PageStopJSCoverageResult>;
+ startCSSCoverage(params: PageStartCSSCoverageParams): Promise<PageStartCSSCoverageResult>;
+ stopCSSCoverage(params?: PageStopCSSCoverageParams): Promise<PageStopCSSCoverageResult>;
+ bringToFront(params?: PageBringToFrontParams): Promise<PageBringToFrontResult>;
+ pickLocator(params?: PagePickLocatorParams): Promise<PagePickLocatorResult>;
+ cancelPickLocator(params?: PageCancelPickLocatorParams): Promise<PageCancelPickLocatorResult>;
+ hideHighlight(params?: PageHideHighlightParams): Promise<PageHideHighlightResult>;
+ screencastShowOverlay(params: PageScreencastShowOverlayParams): Promise<PageScreencastShowOverlayResult>;
+ screencastRemoveOverlay(params: PageScreencastRemoveOverlayParams): Promise<PageScreencastRemoveOverlayResult>;
+ screencastChapter(params: PageScreencastChapterParams): Promise<PageScreencastChapterResult>;
+ screencastSetOverlayVisible(params: PageScreencastSetOverlayVisibleParams): Promise<PageScreencastSetOverlayVisibleResult>;
+ screencastShowActions(params: PageScreencastShowActionsParams): Promise<PageScreencastShowActionsResult>;
+ screencastHideActions(params?: PageScreencastHideActionsParams): Promise<PageScreencastHideActionsResult>;
+ screencastStart(params: PageScreencastStartParams): Promise<PageScreencastStartResult>;
+ screencastStop(params?: PageScreencastStopParams): Promise<PageScreencastStopResult>;
+ updateSubscription(params: PageUpdateSubscriptionParams): Promise<PageUpdateSubscriptionResult>;
+ setDockTile(params: PageSetDockTileParams): Promise<PageSetDockTileResult>;
+ webStorageItems(params: PageWebStorageItemsParams): Promise<PageWebStorageItemsResult>;
+ webStorageGetItem(params: PageWebStorageGetItemParams): Promise<PageWebStorageGetItemResult>;
+ webStorageSetItem(params: PageWebStorageSetItemParams): Promise<PageWebStorageSetItemResult>;
+ webStorageRemoveItem(params: PageWebStorageRemoveItemParams): Promise<PageWebStorageRemoveItemResult>;
+ webStorageClear(params: PageWebStorageClearParams): Promise<PageWebStorageClearResult>;
}
export type PageBindingCallEvent = {
binding: BindingCallChannel,
@@ -4773,7 +4769,7 @@ export interface RootEventTarget {
}
export interface RootChannel extends RootEventTarget, Channel {
_type_Root: boolean;
- initialize(params: RootInitializeParams, progress?: Progress): Promise<RootInitializeResult>;
+ initialize(params: RootInitializeParams): Promise<RootInitializeResult>;
}
export type RootInitializeParams = {
sdkLanguage: SDKLanguage,
@@ -4804,7 +4800,7 @@ export interface PlaywrightEventTarget {
}
export interface PlaywrightChannel extends PlaywrightEventTarget, Channel {
_type_Playwright: boolean;
- newRequest(params: PlaywrightNewRequestParams, progress?: Progress): Promise<PlaywrightNewRequestResult>;
+ newRequest(params: PlaywrightNewRequestParams): Promise<PlaywrightNewRequestResult>;
}
export type PlaywrightNewRequestParams = {
baseURL?: string,
@@ -4888,13 +4884,13 @@ export interface DebugControllerEventTarget {
}
export interface DebugControllerChannel extends DebugControllerEventTarget, Channel {
_type_DebugController: boolean;
- initialize(params: DebugControllerInitializeParams, progress?: Progress): Promise<DebugControllerInitializeResult>;
- setReportStateChanged(params: DebugControllerSetReportStateChangedParams, progress?: Progress): Promise<DebugControllerSetReportStateChangedResult>;
- setRecorderMode(params: DebugControllerSetRecorderModeParams, progress?: Progress): Promise<DebugControllerSetRecorderModeResult>;
- highlight(params: DebugControllerHighlightParams, progress?: Progress): Promise<DebugControllerHighlightResult>;
- hideHighlight(params?: DebugControllerHideHighlightParams, progress?: Progress): Promise<DebugControllerHideHighlightResult>;
- resume(params?: DebugControllerResumeParams, progress?: Progress): Promise<DebugControllerResumeResult>;
- kill(params?: DebugControllerKillParams, progress?: Progress): Promise<DebugControllerKillResult>;
+ initialize(params: DebugControllerInitializeParams): Promise<DebugControllerInitializeResult>;
+ setReportStateChanged(params: DebugControllerSetReportStateChangedParams): Promise<DebugControllerSetReportStateChangedResult>;
+ setRecorderMode(params: DebugControllerSetRecorderModeParams): Promise<DebugControllerSetRecorderModeResult>;
+ highlight(params: DebugControllerHighlightParams): Promise<DebugControllerHighlightResult>;
+ hideHighlight(params?: DebugControllerHideHighlightParams): Promise<DebugControllerHideHighlightResult>;
+ resume(params?: DebugControllerResumeParams): Promise<DebugControllerResumeResult>;
+ kill(params?: DebugControllerKillParams): Promise<DebugControllerKillResult>;
}
export type DebugControllerInspectRequestedEvent = {
selector: string,
@@ -4977,11 +4973,11 @@ export interface SocksSupportEventTarget {
}
export interface SocksSupportChannel extends SocksSupportEventTarget, Channel {
_type_SocksSupport: boolean;
- socksConnected(params: SocksSupportSocksConnectedParams, progress?: Progress): Promise<SocksSupportSocksConnectedResult>;
- socksFailed(params: SocksSupportSocksFailedParams, progress?: Progress): Promise<SocksSupportSocksFailedResult>;
- socksData(params: SocksSupportSocksDataParams, progress?: Progress): Promise<SocksSupportSocksDataResult>;
- socksError(params: SocksSupportSocksErrorParams, progress?: Progress): Promise<SocksSupportSocksErrorResult>;
- socksEnd(params: SocksSupportSocksEndParams, progress?: Progress): Promise<SocksSupportSocksEndResult>;
+ socksConnected(params: SocksSupportSocksConnectedParams): Promise<SocksSupportSocksConnectedResult>;
+ socksFailed(params: SocksSupportSocksFailedParams): Promise<SocksSupportSocksFailedResult>;
+ socksData(params: SocksSupportSocksDataParams): Promise<SocksSupportSocksDataResult>;
+ socksError(params: SocksSupportSocksErrorParams): Promise<SocksSupportSocksErrorResult>;
+ socksEnd(params: SocksSupportSocksEndParams): Promise<SocksSupportSocksEndResult>;
}
export type SocksSupportSocksRequestedEvent = {
uid: string,
@@ -5050,8 +5046,8 @@ export interface JsonPipeEventTarget {
}
export interface JsonPipeChannel extends JsonPipeEventTarget, Channel {
_type_JsonPipe: boolean;
- send(params: JsonPipeSendParams, progress?: Progress): Promise<JsonPipeSendResult>;
- close(params?: JsonPipeCloseParams, progress?: Progress): Promise<JsonPipeCloseResult>;
+ send(params: JsonPipeSendParams): Promise<JsonPipeSendResult>;
+ close(params?: JsonPipeCloseParams): Promise<JsonPipeCloseResult>;
}
export type JsonPipeMessageEvent = {
message: any,
@@ -5170,8 +5166,8 @@ export interface CDPSessionEventTarget {
}
export interface CDPSessionChannel extends CDPSessionEventTarget, Channel {
_type_CDPSession: boolean;
- send(params: CDPSessionSendParams, progress?: Progress): Promise<CDPSessionSendResult>;
- detach(params?: CDPSessionDetachParams, progress?: Progress): Promise<CDPSessionDetachResult>;
+ send(params: CDPSessionSendParams): Promise<CDPSessionSendResult>;
+ detach(params?: CDPSessionDetachParams): Promise<CDPSessionDetachResult>;
}
export type CDPSessionEventEvent = {
method: string,
@@ -5207,8 +5203,8 @@ export interface BindingCallEventTarget {
}
export interface BindingCallChannel extends BindingCallEventTarget, Channel {
_type_BindingCall: boolean;
- reject(params: BindingCallRejectParams, progress?: Progress): Promise<BindingCallRejectResult>;
- resolve(params: BindingCallResolveParams, progress?: Progress): Promise<BindingCallResolveResult>;
+ reject(params: BindingCallRejectParams): Promise<BindingCallRejectResult>;
+ resolve(params: BindingCallResolveParams): Promise<BindingCallResolveResult>;
}
export type BindingCallRejectParams = {
error: SerializedError,
@@ -5235,10 +5231,10 @@ export interface DebuggerEventTarget {
}
export interface DebuggerChannel extends DebuggerEventTarget, Channel {
_type_Debugger: boolean;
- requestPause(params?: DebuggerRequestPauseParams, progress?: Progress): Promise<DebuggerRequestPauseResult>;
- resume(params?: DebuggerResumeParams, progress?: Progress): Promise<DebuggerResumeResult>;
- next(params?: DebuggerNextParams, progress?: Progress): Promise<DebuggerNextResult>;
- runTo(params: DebuggerRunToParams, progress?: Progress): Promise<DebuggerRunToResult>;
+ requestPause(params?: DebuggerRequestPauseParams): Promise<DebuggerRequestPauseResult>;
+ resume(params?: DebuggerResumeParams): Promise<DebuggerResumeResult>;
+ next(params?: DebuggerNextParams): Promise<DebuggerNextResult>;
+ runTo(params: DebuggerRunToParams): Promise<DebuggerRunToResult>;
}
export type DebuggerPausedStateChangedEvent = {
pausedDetails?: {
@@ -5287,8 +5283,8 @@ export interface DialogEventTarget {
}
export interface DialogChannel extends DialogEventTarget, Channel {
_type_Dialog: boolean;
- accept(params: DialogAcceptParams, progress?: Progress): Promise<DialogAcceptResult>;
- dismiss(params?: DialogDismissParams, progress?: Progress): Promise<DialogDismissResult>;
+ accept(params: DialogAcceptParams): Promise<DialogAcceptResult>;
+ dismiss(params?: DialogDismissParams): Promise<DialogDismissResult>;
}
export type DialogAcceptParams = {
promptText?: string,
@@ -5398,14 +5394,14 @@ export interface TracingEventTarget {
}
export interface TracingChannel extends TracingEventTarget, Channel {
_type_Tracing: boolean;
- tracingStart(params: TracingTracingStartParams, progress?: Progress): Promise<TracingTracingStartResult>;
- tracingStartChunk(params: TracingTracingStartChunkParams, progress?: Progress): Promise<TracingTracingStartChunkResult>;
- tracingGroup(params: TracingTracingGroupParams, progress?: Progress): Promise<TracingTracingGroupResult>;
- tracingGroupEnd(params?: TracingTracingGroupEndParams, progress?: Progress): Promise<TracingTracingGroupEndResult>;
- tracingStopChunk(params: TracingTracingStopChunkParams, progress?: Progress): Promise<TracingTracingStopChunkResult>;
- tracingStop(params?: TracingTracingStopParams, progress?: Progress): Promise<TracingTracingStopResult>;
- harStart(params: TracingHarStartParams, progress?: Progress): Promise<TracingHarStartResult>;
- harExport(params: TracingHarExportParams, progress?: Progress): Promise<TracingHarExportResult>;
+ tracingStart(params: TracingTracingStartParams): Promise<TracingTracingStartResult>;
+ tracingStartChunk(params: TracingTracingStartChunkParams): Promise<TracingTracingStartChunkResult>;
+ tracingGroup(params: TracingTracingGroupParams): Promise<TracingTracingGroupResult>;
+ tracingGroupEnd(params?: TracingTracingGroupEndParams): Promise<TracingTracingGroupEndResult>;
+ tracingStopChunk(params: TracingTracingStopChunkParams): Promise<TracingTracingStopChunkResult>;
+ tracingStop(params?: TracingTracingStopParams): Promise<TracingTracingStopResult>;
+ harStart(params: TracingHarStartParams): Promise<TracingHarStartResult>;
+ harExport(params: TracingHarExportParams): Promise<TracingHarExportResult>;
}
export type TracingTracingStartParams = {
name?: string,
@@ -5498,10 +5494,10 @@ export interface WorkerEventTarget {
}
export interface WorkerChannel extends WorkerEventTarget, Channel {
_type_Worker: boolean;
- disconnect(params: WorkerDisconnectParams, progress?: Progress): Promise<WorkerDisconnectResult>;
- evaluateExpression(params: WorkerEvaluateExpressionParams, progress?: Progress): Promise<WorkerEvaluateExpressionResult>;
- evaluateExpressionHandle(params: WorkerEvaluateExpressionHandleParams, progress?: Progress): Promise<WorkerEvaluateExpressionHandleResult>;
- updateSubscription(params: WorkerUpdateSubscriptionParams, progress?: Progress): Promise<WorkerUpdateSubscriptionResult>;
+ disconnect(params: WorkerDisconnectParams): Promise<WorkerDisconnectResult>;
+ evaluateExpression(params: WorkerEvaluateExpressionParams): Promise<WorkerEvaluateExpressionResult>;
+ evaluateExpressionHandle(params: WorkerEvaluateExpressionHandleParams): Promise<WorkerEvaluateExpressionHandleResult>;
+ updateSubscription(params: WorkerUpdateSubscriptionParams): Promise<WorkerUpdateSubscriptionResult>;
}
export type WorkerConsoleEvent = {
type: string,
diff --git a/packages/playwright-core/src/client/clientInstrumentation.ts b/packages/playwright-core/src/client/clientInstrumentation.ts
index 670994cd61..098ca06abd 100644
--- a/packages/playwright-core/src/client/clientInstrumentation.ts
+++ b/packages/playwright-core/src/client/clientInstrumentation.ts
@@ -16,7 +16,7 @@
import type { BrowserContext } from './browserContext';
import type { APIRequestContext, NewContextOptions } from './fetch';
-import type { StackFrame } from '@protocol/channels';
+import type { StackFrame } from './channels';
import type { Page } from './page';
import type { BrowserContextOptions } from './types';
diff --git a/packages/playwright-core/src/client/connect.ts b/packages/playwright-core/src/client/connect.ts
index ffd2da4d57..86836d4d3b 100644
--- a/packages/playwright-core/src/client/connect.ts
+++ b/packages/playwright-core/src/client/connect.ts
@@ -23,7 +23,7 @@ import { Events } from './events';
import type { Playwright } from './playwright';
import type { ConnectOptions, HeadersArray } from './types';
-import type * as channels from '@protocol/channels';
+import type * as channels from './channels';
export async function connectToBrowser(playwright: Playwright, params: ConnectOptions): Promise<Browser> {
const deadline = params.timeout ? monotonicTime() + params.timeout : 0;
diff --git a/packages/playwright-core/src/client/connection.ts b/packages/playwright-core/src/client/connection.ts
index 01c04284bb..41b6485e64 100644
--- a/packages/playwright-core/src/client/connection.ts
+++ b/packages/playwright-core/src/client/connection.ts
@@ -47,7 +47,7 @@ import type { ClientInstrumentation } from './clientInstrumentation';
import type { HeadersArray } from './types';
import type { ValidatorContext } from '../protocol/validator';
import type { Platform } from '@isomorphic/platform';
-import type * as channels from '@protocol/channels';
+import type * as channels from './channels';
class Root extends ChannelOwner<channels.RootChannel> {
constructor(connection: Connection) {
diff --git a/packages/playwright-core/src/client/consoleMessage.ts b/packages/playwright-core/src/client/consoleMessage.ts
index 4b4e213293..6c50bc8168 100644
--- a/packages/playwright-core/src/client/consoleMessage.ts
+++ b/packages/playwright-core/src/client/consoleMessage.ts
@@ -18,7 +18,7 @@ import { JSHandle } from './jsHandle';
import type * as api from '../../types/types';
import type { Platform } from '@isomorphic/platform';
-import type * as channels from '@protocol/channels';
+import type * as channels from './channels';
import type { Page } from './page';
import type { Worker } from './worker';
diff --git a/packages/playwright-core/src/client/coverage.ts b/packages/playwright-core/src/client/coverage.ts
index 7e1cb7ef2b..5251ef9f65 100644
--- a/packages/playwright-core/src/client/coverage.ts
+++ b/packages/playwright-core/src/client/coverage.ts
@@ -15,7 +15,7 @@
*/
import type * as api from '../../types/types';
-import type * as channels from '@protocol/channels';
+import type * as channels from './channels';
export class Coverage implements api.Coverage {
private _channel: channels.PageChannel;
diff --git a/packages/playwright-core/src/client/credentials.ts b/packages/playwright-core/src/client/credentials.ts
index 973fdad736..81b3d68986 100644
--- a/packages/playwright-core/src/client/credentials.ts
+++ b/packages/playwright-core/src/client/credentials.ts
@@ -16,7 +16,7 @@
import type { BrowserContext } from './browserContext';
import type * as api from '../../types/types';
-import type * as channels from '@protocol/channels';
+import type * as channels from './channels';
export class Credentials implements api.Credentials {
private _browserContext: BrowserContext;
diff --git a/packages/playwright-core/src/client/debugger.ts b/packages/playwright-core/src/client/debugger.ts
index b83427bdb0..55fb8a6639 100644
--- a/packages/playwright-core/src/client/debugger.ts
+++ b/packages/playwright-core/src/client/debugger.ts
@@ -18,7 +18,7 @@ import { ChannelOwner } from './channelOwner';
import { Events } from './events';
import type * as api from '../../types/types';
-import type * as channels from '@protocol/channels';
+import type * as channels from './channels';
type PausedDetails = { location: { file: string, line?: number, column?: number }, title: string, stack?: string };
diff --git a/packages/playwright-core/src/client/dialog.ts b/packages/playwright-core/src/client/dialog.ts
index 98a41291cc..dd38c1ff6d 100644
--- a/packages/playwright-core/src/client/dialog.ts
+++ b/packages/playwright-core/src/client/dialog.ts
@@ -19,7 +19,7 @@ import { Page } from './page';
import { isTargetClosedError } from './errors';
import type * as api from '../../types/types';
-import type * as channels from '@protocol/channels';
+import type * as channels from './channels';
export class Dialog extends ChannelOwner<channels.DialogChannel> implements api.Dialog {
diff --git a/packages/playwright-core/src/client/disposable.ts b/packages/playwright-core/src/client/disposable.ts
index fc6b414d5a..129eae1b2c 100644
--- a/packages/playwright-core/src/client/disposable.ts
+++ b/packages/playwright-core/src/client/disposable.ts
@@ -17,7 +17,7 @@
import { ChannelOwner } from './channelOwner';
import { isTargetClosedError } from './errors';
-import type * as channels from '@protocol/channels';
+import type * as channels from './channels';
export interface Disposable {
dispose: () => Promise<void>;
diff --git a/packages/playwright-core/src/client/electron.ts b/packages/playwright-core/src/client/electron.ts
index f83be02946..a409236009 100644
--- a/packages/playwright-core/src/client/electron.ts
+++ b/packages/playwright-core/src/client/electron.ts
@@ -28,7 +28,7 @@ import type { Page } from './page';
import type { BrowserContextOptions, Headers, TimeoutOptions, WaitForEventOptions } from './types';
import type * as structs from '../../types/structs';
import type * as api from '../../types/types';
-import type * as channels from '@protocol/channels';
+import type * as channels from './channels';
import type * as childProcess from 'child_process';
import type { BrowserWindow } from 'electron';
import type { Playwright } from './playwright';
diff --git a/packages/playwright-core/src/client/elementHandle.ts b/packages/playwright-core/src/client/elementHandle.ts
index 99e3c555d9..afaf107a6f 100644
--- a/packages/playwright-core/src/client/elementHandle.ts
+++ b/packages/playwright-core/src/client/elementHandle.ts
@@ -29,7 +29,7 @@ import type { FilePayload, Rect, SelectOption, SelectOptionOptions, TimeoutOptio
import type * as structs from '../../types/structs';
import type * as api from '../../types/types';
import type { Platform } from '@isomorphic/platform';
-import type * as channels from '@protocol/channels';
+import type * as channels from './channels';
export class ElementHandle<T extends Node = Node> extends JSHandle<T> implements api.ElementHandle {
private _frame: Frame;
diff --git a/packages/playwright-core/src/client/errors.ts b/packages/playwright-core/src/client/errors.ts
index ce4869d00d..92169c09d4 100644
--- a/packages/playwright-core/src/client/errors.ts
+++ b/packages/playwright-core/src/client/errors.ts
@@ -17,7 +17,7 @@
import { isError } from '@isomorphic/rtti';
import { parseSerializedValue, serializeValue } from '../protocol/serializers';
-import type { SerializedError } from '@protocol/channels';
+import type { SerializedError } from './channels';
export class PlaywrightError extends Error {
log: string[] = [];
diff --git a/packages/playwright-core/src/client/fetch.ts b/packages/playwright-core/src/client/fetch.ts
index 8d58a81f0f..8f94e622e1 100644
--- a/packages/playwright-core/src/client/fetch.ts
+++ b/packages/playwright-core/src/client/fetch.ts
@@ -31,7 +31,7 @@ import type { Serializable } from '../../types/structs';
import type * as api from '../../types/types';
import type { HeadersArray, NameValue } from '@isomorphic/types';
import type { Platform } from '@isomorphic/platform';
-import type * as channels from '@protocol/channels';
+import type * as channels from './channels';
import type * as fs from 'fs';
export type FetchOptions = {
diff --git a/packages/playwright-core/src/client/fileChooser.ts b/packages/playwright-core/src/client/fileChooser.ts
index 04a08d35a4..d37e8577e9 100644
--- a/packages/playwright-core/src/client/fileChooser.ts
+++ b/packages/playwright-core/src/client/fileChooser.ts
@@ -18,7 +18,7 @@ import type { ElementHandle } from './elementHandle';
import type { Page } from './page';
import type { FilePayload, TimeoutOptions } from './types';
import type * as api from '../../types/types';
-import type * as channels from '@protocol/channels';
+import type * as channels from './channels';
export class FileChooser implements api.FileChooser {
private _page: Page;
diff --git a/packages/playwright-core/src/client/frame.ts b/packages/playwright-core/src/client/frame.ts
index bb28e67377..c6b9695ff9 100644
--- a/packages/playwright-core/src/client/frame.ts
+++ b/packages/playwright-core/src/client/frame.ts
@@ -38,7 +38,7 @@ import type * as structs from '../../types/structs';
import type * as api from '../../types/types';
import type { ByRoleOptions } from '@isomorphic/locatorUtils';
import type { URLMatch } from '@isomorphic/urlMatch';
-import type * as channels from '@protocol/channels';
+import type * as channels from './channels';
export type WaitForNavigationOptions = {
timeout?: number,
diff --git a/packages/playwright-core/src/client/input.ts b/packages/playwright-core/src/client/input.ts
index d77fc3b54d..cb4a551d68 100644
--- a/packages/playwright-core/src/client/input.ts
+++ b/packages/playwright-core/src/client/input.ts
@@ -17,7 +17,7 @@
import type { Page } from './page';
import type * as api from '../../types/types';
-import type * as channels from '@protocol/channels';
+import type * as channels from './channels';
export class Keyboard implements api.Keyboard {
private _page: Page;
diff --git a/packages/playwright-core/src/client/jsHandle.ts b/packages/playwright-core/src/client/jsHandle.ts
index 62a54950d5..a6ca8a038f 100644
--- a/packages/playwright-core/src/client/jsHandle.ts
+++ b/packages/playwright-core/src/client/jsHandle.ts
@@ -20,7 +20,7 @@ import { parseSerializedValue, serializeValue } from '../protocol/serializers';
import type * as structs from '../../types/structs';
import type * as api from '../../types/types';
-import type * as channels from '@protocol/channels';
+import type * as channels from './channels';
export class JSHandle<T = any> extends ChannelOwner<channels.JSHandleChannel> implements api.JSHandle {
diff --git a/packages/playwright-core/src/client/jsonPipe.ts b/packages/playwright-core/src/client/jsonPipe.ts
index 9e6635638e..9f250329b4 100644
--- a/packages/playwright-core/src/client/jsonPipe.ts
+++ b/packages/playwright-core/src/client/jsonPipe.ts
@@ -16,7 +16,7 @@
import { ChannelOwner } from './channelOwner';
-import type * as channels from '@protocol/channels';
+import type * as channels from './channels';
export class JsonPipe extends ChannelOwner<channels.JsonPipeChannel> {
static from(jsonPipe: channels.JsonPipeChannel): JsonPipe {
diff --git a/packages/playwright-core/src/client/localUtils.ts b/packages/playwright-core/src/client/localUtils.ts
index 79a035c0f6..5d34adc053 100644
--- a/packages/playwright-core/src/client/localUtils.ts
+++ b/packages/playwright-core/src/client/localUtils.ts
@@ -17,7 +17,7 @@
import { ChannelOwner } from './channelOwner';
import type { Size } from './types';
-import type * as channels from '@protocol/channels';
+import type * as channels from './channels';
type DeviceDescriptor = {
userAgent: string,
diff --git a/packages/playwright-core/src/client/locator.ts b/packages/playwright-core/src/client/locator.ts
index fcd2165e7d..89c892c540 100644
--- a/packages/playwright-core/src/client/locator.ts
+++ b/packages/playwright-core/src/client/locator.ts
@@ -27,7 +27,7 @@ import type { DropPayload, FilePayload, FrameExpectParams, Rect, SelectOption, S
import type * as structs from '../../types/structs';
import type * as api from '../../types/types';
import type { ByRoleOptions } from '@isomorphic/locatorUtils';
-import type * as channels from '@protocol/channels';
+import type * as channels from './channels';
export type LocatorOptions = {
diff --git a/packages/playwright-core/src/client/network.ts b/packages/playwright-core/src/client/network.ts
index 49ab620c19..38b14c3866 100644
--- a/packages/playwright-core/src/client/network.ts
+++ b/packages/playwright-core/src/client/network.ts
@@ -37,7 +37,7 @@ import type { Serializable } from '../../types/structs';
import type * as api from '../../types/types';
import type { HeadersArray } from '@isomorphic/types';
import type { URLMatch } from '@isomorphic/urlMatch';
-import type * as channels from '@protocol/channels';
+import type * as channels from './channels';
import type { Platform, Zone } from '@isomorphic/platform';
export type NetworkCookie = {
diff --git a/packages/playwright-core/src/client/page.ts b/packages/playwright-core/src/client/page.ts
index b45b623083..3f571d72a8 100644
--- a/packages/playwright-core/src/client/page.ts
+++ b/packages/playwright-core/src/client/page.ts
@@ -55,7 +55,7 @@ import type * as structs from '../../types/structs';
import type * as api from '../../types/types';
import type { ByRoleOptions } from '@isomorphic/locatorUtils';
import type { URLMatch } from '@isomorphic/urlMatch';
-import type * as channels from '@protocol/channels';
+import type * as channels from './channels';
type PDFOptions = Omit<channels.PagePdfParams, 'width' | 'height' | 'margin'> & {
width?: string | number,
diff --git a/packages/playwright-core/src/client/playwright.ts b/packages/playwright-core/src/client/playwright.ts
index c5f2074aee..5e375daa18 100644
--- a/packages/playwright-core/src/client/playwright.ts
+++ b/packages/playwright-core/src/client/playwright.ts
@@ -23,7 +23,7 @@ import { TimeoutError } from './errors';
import { APIRequest } from './fetch';
import { Selectors } from './selectors';
-import type * as channels from '@protocol/channels';
+import type * as channels from './channels';
import type { LaunchOptions } from 'playwright-core';
export class Playwright extends ChannelOwner<channels.PlaywrightChannel> {
diff --git a/packages/playwright-core/src/client/selectors.ts b/packages/playwright-core/src/client/selectors.ts
index c287ed989d..7e5f17f139 100644
--- a/packages/playwright-core/src/client/selectors.ts
+++ b/packages/playwright-core/src/client/selectors.ts
@@ -19,7 +19,7 @@ import { setTestIdAttribute } from './locator';
import type { SelectorEngine } from './types';
import type * as api from '../../types/types';
-import type * as channels from '@protocol/channels';
+import type * as channels from './channels';
import type { BrowserContext } from './browserContext';
import type { Platform } from '@isomorphic/platform';
diff --git a/packages/playwright-core/src/client/stream.ts b/packages/playwright-core/src/client/stream.ts
index 97c1e4b634..bbfe8f3045 100644
--- a/packages/playwright-core/src/client/stream.ts
+++ b/packages/playwright-core/src/client/stream.ts
@@ -18,7 +18,7 @@ import { Readable } from 'stream';
import { ChannelOwner } from './channelOwner';
-import type * as channels from '@protocol/channels';
+import type * as channels from './channels';
export class Stream extends ChannelOwner<channels.StreamChannel> {
static from(Stream: channels.StreamChannel): Stream {
diff --git a/packages/playwright-core/src/client/tracing.ts b/packages/playwright-core/src/client/tracing.ts
index 5d771656b2..b4ed8f2a7d 100644
--- a/packages/playwright-core/src/client/tracing.ts
+++ b/packages/playwright-core/src/client/tracing.ts
@@ -21,7 +21,7 @@ import { DisposableStub } from './disposable';
import type { Page } from './page';
import type * as api from '../../types/types';
-import type * as channels from '@protocol/channels';
+import type * as channels from './channels';
export class Tracing extends ChannelOwner<channels.TracingChannel> implements api.Tracing {
private _includeSources = false;
diff --git a/packages/playwright-core/src/client/types.ts b/packages/playwright-core/src/client/types.ts
index cf7bedd7af..ee0ae314ce 100644
--- a/packages/playwright-core/src/client/types.ts
+++ b/packages/playwright-core/src/client/types.ts
@@ -16,7 +16,7 @@
*/
import type { Size } from '@isomorphic/types';
-import type * as channels from '@protocol/channels';
+import type * as channels from './channels';
export type { HeadersArray, Point, Quad, Rect, Size } from '@isomorphic/types';
type LoggerSeverity = 'verbose' | 'info' | 'warning' | 'error';
diff --git a/packages/playwright-core/src/client/waiter.ts b/packages/playwright-core/src/client/waiter.ts
index e53aeae27d..1ab3bd0294 100644
--- a/packages/playwright-core/src/client/waiter.ts
+++ b/packages/playwright-core/src/client/waiter.ts
@@ -18,7 +18,7 @@ import { rewriteErrorMessage } from '@isomorphic/stackTrace';
import { TimeoutError } from './errors';
import type { ChannelOwner } from './channelOwner';
-import type * as channels from '@protocol/channels';
+import type * as channels from './channels';
import type { EventEmitter } from 'events';
import type { Zone } from '@isomorphic/platform';
diff --git a/packages/playwright-core/src/client/webError.ts b/packages/playwright-core/src/client/webError.ts
index 413317633b..2bc5059a22 100644
--- a/packages/playwright-core/src/client/webError.ts
+++ b/packages/playwright-core/src/client/webError.ts
@@ -16,7 +16,7 @@
import type { Page } from './page';
import type * as api from '../../types/types';
-import type * as channels from '@protocol/channels';
+import type * as channels from './channels';
type WebErrorLocation = channels.BrowserContextPageErrorEvent['location'];
diff --git a/packages/playwright-core/src/client/worker.ts b/packages/playwright-core/src/client/worker.ts
index 1d11e65b21..2b5ba55dd2 100644
--- a/packages/playwright-core/src/client/worker.ts
+++ b/packages/playwright-core/src/client/worker.ts
@@ -27,7 +27,7 @@ import type { BrowserContext } from './browserContext';
import type { Page } from './page';
import type * as structs from '../../types/structs';
import type * as api from '../../types/types';
-import type * as channels from '@protocol/channels';
+import type * as channels from './channels';
import type { TimeoutOptions, WaitForEventOptions } from './types';
diff --git a/packages/playwright-core/src/client/writableStream.ts b/packages/playwright-core/src/client/writableStream.ts
index 38a2d0214a..c346ee353c 100644
--- a/packages/playwright-core/src/client/writableStream.ts
+++ b/packages/playwright-core/src/client/writableStream.ts
@@ -16,7 +16,7 @@
import { ChannelOwner } from './channelOwner';
-import type * as channels from '@protocol/channels';
+import type * as channels from './channels';
import type { Writable } from 'stream';
export class WritableStream extends ChannelOwner<channels.WritableStreamChannel> {
diff --git a/packages/playwright-core/src/protocol/serializers.ts b/packages/playwright-core/src/protocol/serializers.ts
index c6d0d926bc..ccf795af15 100644
--- a/packages/playwright-core/src/protocol/serializers.ts
+++ b/packages/playwright-core/src/protocol/serializers.ts
@@ -14,7 +14,36 @@
* limitations under the License.
*/
-import type { SerializedValue } from '@protocol/channels';
+export type SerializedValue = {
+ n?: number,
+ b?: boolean,
+ s?: string,
+ v?: 'null' | 'undefined' | 'NaN' | 'Infinity' | '-Infinity' | '-0',
+ d?: string,
+ u?: string,
+ bi?: string,
+ ta?: {
+ b: Buffer,
+ k: 'i8' | 'ui8' | 'ui8c' | 'i16' | 'ui16' | 'i32' | 'ui32' | 'f32' | 'f64' | 'bi64' | 'bui64',
+ },
+ e?: {
+ m: string,
+ n: string,
+ s: string,
+ },
+ r?: {
+ p: string,
+ f: string,
+ },
+ a?: SerializedValue[],
+ o?: {
+ k: string,
+ v: SerializedValue,
+ }[],
+ h?: number,
+ id?: number,
+ ref?: number,
+};
export function parseSerializedValue(value: SerializedValue, handles: any[] | undefined): any {
return innerParseSerializedValue(value, handles, new Map(), []);
diff --git a/packages/playwright-core/src/server/android/android.ts b/packages/playwright-core/src/server/android/android.ts
index 4ddb98ed4a..1fc6a296bf 100644
--- a/packages/playwright-core/src/server/android/android.ts
+++ b/packages/playwright-core/src/server/android/android.ts
@@ -40,7 +40,7 @@ import { registry } from '../registry';
import type { BrowserOptions, BrowserProcess } from '../browser';
import type { BrowserContext } from '../browserContext';
import type * as types from '../types';
-import type * as channels from '@protocol/channels';
+import type * as channels from '../channels';
import type * as stream from 'stream';
const ARTIFACTS_FOLDER = path.join(os.tmpdir(), 'playwright-artifacts-');
diff --git a/packages/playwright-core/src/server/android/backendAdb.ts b/packages/playwright-core/src/server/android/backendAdb.ts
index 010dec61c3..09d4bc0c29 100644
--- a/packages/playwright-core/src/server/android/backendAdb.ts
+++ b/packages/playwright-core/src/server/android/backendAdb.ts
@@ -20,7 +20,7 @@ import net from 'net';
import debug from 'debug';
import { assert } from '@isomorphic/assert';
import type { Backend, DeviceBackend, SocketBackend } from './android';
-import type * as channels from '@protocol/channels';
+import type * as channels from '../channels';
export class AdbBackend implements Backend {
diff --git a/packages/playwright-core/src/server/artifact.ts b/packages/playwright-core/src/server/artifact.ts
index 1a08e7e133..7e4ee4e59a 100644
--- a/packages/playwright-core/src/server/artifact.ts
+++ b/packages/playwright-core/src/server/artifact.ts
@@ -21,7 +21,7 @@ import { assert } from '@isomorphic/assert';
import { TargetClosedError } from './errors';
import { SdkObject } from './instrumentation';
-import type { Progress } from '@protocol/progress';
+import type { Progress } from './progress';
type SaveCallback = (localPath: string, error?: Error) => Promise<void>;
type CancelCallback = () => Promise<void>;
diff --git a/packages/playwright-core/src/server/bidi/bidiBrowser.ts b/packages/playwright-core/src/server/bidi/bidiBrowser.ts
index 7e0c9f2863..236bbec39a 100644
--- a/packages/playwright-core/src/server/bidi/bidiBrowser.ts
+++ b/packages/playwright-core/src/server/bidi/bidiBrowser.ts
@@ -31,7 +31,7 @@ import type { InitScript, Page } from '../page';
import type { ConnectionTransport } from '../transport';
import type * as types from '../types';
import type { BidiSession } from './bidiConnection';
-import type * as channels from '@protocol/channels';
+import type * as channels from '../channels';
export class BidiBrowser extends Browser {
diff --git a/packages/playwright-core/src/server/bidi/bidiPage.ts b/packages/playwright-core/src/server/bidi/bidiPage.ts
index ac8fd62fca..2380c6da0a 100644
--- a/packages/playwright-core/src/server/bidi/bidiPage.ts
+++ b/packages/playwright-core/src/server/bidi/bidiPage.ts
@@ -35,7 +35,7 @@ import type { InitScript, PageDelegate } from '../page';
import type { Progress } from '../progress';
import type * as types from '../types';
import type { BidiSession } from './bidiConnection';
-import type * as channels from '@protocol/channels';
+import type * as channels from '../channels';
const UTILITY_WORLD_NAME = '__playwright_utility_world__';
export const kPlaywrightBindingChannel = 'playwrightChannel';
diff --git a/packages/playwright-core/src/server/bidi/bidiPdf.ts b/packages/playwright-core/src/server/bidi/bidiPdf.ts
index bc67b3af82..7feb148b05 100644
--- a/packages/playwright-core/src/server/bidi/bidiPdf.ts
+++ b/packages/playwright-core/src/server/bidi/bidiPdf.ts
@@ -18,7 +18,7 @@
import { assert } from '@isomorphic/assert';
import type { BidiSession } from './bidiConnection';
-import type * as channels from '@protocol/channels';
+import type * as channels from '../channels';
const PagePaperFormats: { [key: string]: { width: number, height: number }} = {
letter: { width: 8.5, height: 11 },
diff --git a/packages/playwright-core/src/server/browser.ts b/packages/playwright-core/src/server/browser.ts
index 0f441fdcb1..56fff6415a 100644
--- a/packages/playwright-core/src/server/browser.ts
+++ b/packages/playwright-core/src/server/browser.ts
@@ -32,7 +32,7 @@ import { TargetClosedError } from './errors';
import type * as types from './types';
import type { ProxySettings } from './types';
import type { RecentLogsCollector } from '@utils/debugLogger';
-import type * as channels from '@protocol/channels';
+import type * as channels from './channels';
import type { ChildProcess } from 'child_process';
import type { Language } from '@isomorphic/locatorGenerators';
import type { Progress } from './progress';
diff --git a/packages/playwright-core/src/server/browserContext.ts b/packages/playwright-core/src/server/browserContext.ts
index 788179e985..2e1ea62038 100644
--- a/packages/playwright-core/src/server/browserContext.ts
+++ b/packages/playwright-core/src/server/browserContext.ts
@@ -44,7 +44,7 @@ import type { Progress } from './progress';
import type { ClientCertificatesProxy } from './socksClientCertificatesInterceptor';
import type { SerializedStorage } from '@injected/storageScript';
import type * as types from './types';
-import type * as channels from '@protocol/channels';
+import type * as channels from './channels';
const BrowserContextEvent = {
Console: 'console',
diff --git a/packages/playwright-core/src/server/browserType.ts b/packages/playwright-core/src/server/browserType.ts
index 0e0119c45c..bed4f1d3e8 100644
--- a/packages/playwright-core/src/server/browserType.ts
+++ b/packages/playwright-core/src/server/browserType.ts
@@ -41,7 +41,7 @@ import type { Progress } from './progress';
import type { BrowserName } from './registry';
import type { ConnectionTransport } from './transport';
import type * as types from './types';
-import type * as channels from '@protocol/channels';
+import type * as channels from './channels';
export const kNoXServerRunningError = 'Looks like you launched a headed browser without having a XServer running.\n' +
'Set either \'headless: true\' or use \'xvfb-run <your-playwright-app>\' before running Playwright.\n\n<3 Playwright Team';
diff --git a/packages/playwright-core/src/server/channels.d.ts b/packages/playwright-core/src/server/channels.d.ts
new file mode 100644
index 0000000000..01047a43f6
--- /dev/null
+++ b/packages/playwright-core/src/server/channels.d.ts
@@ -0,0 +1,5559 @@
+/**
+ * Copyright (c) Microsoft Corporation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// This file is generated by generate_channels.js, do not edit manually.
+
+import type { Progress } from './progress';
+
+export type Binary = Buffer;
+
+export interface Channel {
+}
+
+// ----------- Initializer Traits -----------
+export type InitializerTraits<T> =
+ T extends ElementHandleChannel ? ElementHandleInitializer :
+ T extends AndroidChannel ? AndroidInitializer :
+ T extends AndroidSocketChannel ? AndroidSocketInitializer :
+ T extends AndroidDeviceChannel ? AndroidDeviceInitializer :
+ T extends APIRequestContextChannel ? APIRequestContextInitializer :
+ T extends ArtifactChannel ? ArtifactInitializer :
+ T extends StreamChannel ? StreamInitializer :
+ T extends WritableStreamChannel ? WritableStreamInitializer :
+ T extends BrowserChannel ? BrowserInitializer :
+ T extends BrowserContextChannel ? BrowserContextInitializer :
+ T extends BrowserTypeChannel ? BrowserTypeInitializer :
+ T extends DisposableChannel ? DisposableInitializer :
+ T extends ElectronChannel ? ElectronInitializer :
+ T extends ElectronApplicationChannel ? ElectronApplicationInitializer :
+ T extends FrameChannel ? FrameInitializer :
+ T extends JSHandleChannel ? JSHandleInitializer :
+ T extends LocalUtilsChannel ? LocalUtilsInitializer :
+ T extends RequestChannel ? RequestInitializer :
+ T extends RouteChannel ? RouteInitializer :
+ T extends WebSocketRouteChannel ? WebSocketRouteInitializer :
+ T extends ResponseChannel ? ResponseInitializer :
+ T extends WebSocketChannel ? WebSocketInitializer :
+ T extends PageChannel ? PageInitializer :
+ T extends RootChannel ? RootInitializer :
+ T extends PlaywrightChannel ? PlaywrightInitializer :
+ T extends DebugControllerChannel ? DebugControllerInitializer :
+ T extends SocksSupportChannel ? SocksSupportInitializer :
+ T extends JsonPipeChannel ? JsonPipeInitializer :
+ T extends CDPSessionChannel ? CDPSessionInitializer :
+ T extends BindingCallChannel ? BindingCallInitializer :
+ T extends DebuggerChannel ? DebuggerInitializer :
+ T extends DialogChannel ? DialogInitializer :
+ T extends TracingChannel ? TracingInitializer :
+ T extends WorkerChannel ? WorkerInitializer :
+ object;
+
+// ----------- Event Traits -----------
+export type EventsTraits<T> =
+ T extends ElementHandleChannel ? ElementHandleEvents :
+ T extends AndroidChannel ? AndroidEvents :
+ T extends AndroidSocketChannel ? AndroidSocketEvents :
+ T extends AndroidDeviceChannel ? AndroidDeviceEvents :
+ T extends APIRequestContextChannel ? APIRequestContextEvents :
+ T extends ArtifactChannel ? ArtifactEvents :
+ T extends StreamChannel ? StreamEvents :
+ T extends WritableStreamChannel ? WritableStreamEvents :
+ T extends BrowserChannel ? BrowserEvents :
+ T extends BrowserContextChannel ? BrowserContextEvents :
+ T extends BrowserTypeChannel ? BrowserTypeEvents :
+ T extends DisposableChannel ? DisposableEvents :
+ T extends ElectronChannel ? ElectronEvents :
+ T extends ElectronApplicationChannel ? ElectronApplicationEvents :
+ T extends FrameChannel ? FrameEvents :
+ T extends JSHandleChannel ? JSHandleEvents :
+ T extends LocalUtilsChannel ? LocalUtilsEvents :
+ T extends RequestChannel ? RequestEvents :
+ T extends RouteChannel ? RouteEvents :
+ T extends WebSocketRouteChannel ? WebSocketRouteEvents :
+ T extends ResponseChannel ? ResponseEvents :
+ T extends WebSocketChannel ? WebSocketEvents :
+ T extends PageChannel ? PageEvents :
+ T extends RootChannel ? RootEvents :
+ T extends PlaywrightChannel ? PlaywrightEvents :
+ T extends DebugControllerChannel ? DebugControllerEvents :
+ T extends SocksSupportChannel ? SocksSupportEvents :
+ T extends JsonPipeChannel ? JsonPipeEvents :
+ T extends CDPSessionChannel ? CDPSessionEvents :
+ T extends BindingCallChannel ? BindingCallEvents :
+ T extends DebuggerChannel ? DebuggerEvents :
+ T extends DialogChannel ? DialogEvents :
+ T extends TracingChannel ? TracingEvents :
+ T extends WorkerChannel ? WorkerEvents :
+ undefined;
+
+// ----------- EventTarget Traits -----------
+export type EventTargetTraits<T> =
+ T extends ElementHandleChannel ? ElementHandleEventTarget :
+ T extends AndroidChannel ? AndroidEventTarget :
+ T extends AndroidSocketChannel ? AndroidSocketEventTarget :
+ T extends AndroidDeviceChannel ? AndroidDeviceEventTarget :
+ T extends APIRequestContextChannel ? APIRequestContextEventTarget :
+ T extends ArtifactChannel ? ArtifactEventTarget :
+ T extends StreamChannel ? StreamEventTarget :
+ T extends WritableStreamChannel ? WritableStreamEventTarget :
+ T extends BrowserChannel ? BrowserEventTarget :
+ T extends BrowserContextChannel ? BrowserContextEventTarget :
+ T extends BrowserTypeChannel ? BrowserTypeEventTarget :
+ T extends DisposableChannel ? DisposableEventTarget :
+ T extends ElectronChannel ? ElectronEventTarget :
+ T extends ElectronApplicationChannel ? ElectronApplicationEventTarget :
+ T extends FrameChannel ? FrameEventTarget :
+ T extends JSHandleChannel ? JSHandleEventTarget :
+ T extends LocalUtilsChannel ? LocalUtilsEventTarget :
+ T extends RequestChannel ? RequestEventTarget :
+ T extends RouteChannel ? RouteEventTarget :
+ T extends WebSocketRouteChannel ? WebSocketRouteEventTarget :
+ T extends ResponseChannel ? ResponseEventTarget :
+ T extends WebSocketChannel ? WebSocketEventTarget :
+ T extends PageChannel ? PageEventTarget :
+ T extends RootChannel ? RootEventTarget :
+ T extends PlaywrightChannel ? PlaywrightEventTarget :
+ T extends DebugControllerChannel ? DebugControllerEventTarget :
+ T extends SocksSupportChannel ? SocksSupportEventTarget :
+ T extends JsonPipeChannel ? JsonPipeEventTarget :
+ T extends CDPSessionChannel ? CDPSessionEventTarget :
+ T extends BindingCallChannel ? BindingCallEventTarget :
+ T extends DebuggerChannel ? DebuggerEventTarget :
+ T extends DialogChannel ? DialogEventTarget :
+ T extends TracingChannel ? TracingEventTarget :
+ T extends WorkerChannel ? WorkerEventTarget :
+ undefined;
+
+// ----------- Android -----------
+export type AndroidInitializer = {};
+export interface AndroidEventTarget {
+}
+export interface AndroidChannel extends AndroidEventTarget, Channel {
+ _type_Android: boolean;
+ devices(params: AndroidDevicesParams, progress: Progress): Promise<AndroidDevicesResult>;
+}
+export type AndroidDevicesParams = {
+ host?: string,
+ port?: number,
+ omitDriverInstall?: boolean,
+};
+export type AndroidDevicesOptions = {
+ host?: string,
+ port?: number,
+ omitDriverInstall?: boolean,
+};
+export type AndroidDevicesResult = {
+ devices: AndroidDeviceChannel[],
+};
+
+export interface AndroidEvents {
+}
+
+// ----------- AndroidSocket -----------
+export type AndroidSocketInitializer = {};
+export interface AndroidSocketEventTarget {
+ _dispatchEvent(event: 'data', params?: AndroidSocketDataEvent): void;
+ _dispatchEvent(event: 'close', params?: AndroidSocketCloseEvent): void;
+}
+export interface AndroidSocketChannel extends AndroidSocketEventTarget, Channel {
+ _type_AndroidSocket: boolean;
+ write(params: AndroidSocketWriteParams, progress: Progress): Promise<AndroidSocketWriteResult>;
+ close(params: AndroidSocketCloseParams, progress: Progress): Promise<AndroidSocketCloseResult>;
+}
+export type AndroidSocketDataEvent = {
+ data: Binary,
+};
+export type AndroidSocketCloseEvent = {};
+export type AndroidSocketWriteParams = {
+ data: Binary,
+};
+export type AndroidSocketWriteOptions = {
+
+};
+export type AndroidSocketWriteResult = void;
+export type AndroidSocketCloseParams = {};
+export type AndroidSocketCloseOptions = {};
+export type AndroidSocketCloseResult = void;
+
+export interface AndroidSocketEvents {
+ 'data': AndroidSocketDataEvent;
+ 'close': AndroidSocketCloseEvent;
+}
+
+// ----------- AndroidDevice -----------
+export type AndroidDeviceInitializer = {
+ model: string,
+ serial: string,
+};
+export interface AndroidDeviceEventTarget {
+ _dispatchEvent(event: 'close', params?: AndroidDeviceCloseEvent): void;
+ _dispatchEvent(event: 'webViewAdded', params?: AndroidDeviceWebViewAddedEvent): void;
+ _dispatchEvent(event: 'webViewRemoved', params?: AndroidDeviceWebViewRemovedEvent): void;
+}
+export interface AndroidDeviceChannel extends AndroidDeviceEventTarget, Channel {
+ _type_AndroidDevice: boolean;
+ wait(params: AndroidDeviceWaitParams, progress: Progress): Promise<AndroidDeviceWaitResult>;
+ fill(params: AndroidDeviceFillParams, progress: Progress): Promise<AndroidDeviceFillResult>;
+ tap(params: AndroidDeviceTapParams, progress: Progress): Promise<AndroidDeviceTapResult>;
+ drag(params: AndroidDeviceDragParams, progress: Progress): Promise<AndroidDeviceDragResult>;
+ fling(params: AndroidDeviceFlingParams, progress: Progress): Promise<AndroidDeviceFlingResult>;
+ longTap(params: AndroidDeviceLongTapParams, progress: Progress): Promise<AndroidDeviceLongTapResult>;
+ pinchClose(params: AndroidDevicePinchCloseParams, progress: Progress): Promise<AndroidDevicePinchCloseResult>;
+ pinchOpen(params: AndroidDevicePinchOpenParams, progress: Progress): Promise<AndroidDevicePinchOpenResult>;
+ scroll(params: AndroidDeviceScrollParams, progress: Progress): Promise<AndroidDeviceScrollResult>;
+ swipe(params: AndroidDeviceSwipeParams, progress: Progress): Promise<AndroidDeviceSwipeResult>;
+ info(params: AndroidDeviceInfoParams, progress: Progress): Promise<AndroidDeviceInfoResult>;
+ screenshot(params: AndroidDeviceScreenshotParams, progress: Progress): Promise<AndroidDeviceScreenshotResult>;
+ inputType(params: AndroidDeviceInputTypeParams, progress: Progress): Promise<AndroidDeviceInputTypeResult>;
+ inputPress(params: AndroidDeviceInputPressParams, progress: Progress): Promise<AndroidDeviceInputPressResult>;
+ inputTap(params: AndroidDeviceInputTapParams, progress: Progress): Promise<AndroidDeviceInputTapResult>;
+ inputSwipe(params: AndroidDeviceInputSwipeParams, progress: Progress): Promise<AndroidDeviceInputSwipeResult>;
+ inputDrag(params: AndroidDeviceInputDragParams, progress: Progress): Promise<AndroidDeviceInputDragResult>;
+ launchBrowser(params: AndroidDeviceLaunchBrowserParams, progress: Progress): Promise<AndroidDeviceLaunchBrowserResult>;
+ open(params: AndroidDeviceOpenParams, progress: Progress): Promise<AndroidDeviceOpenResult>;
+ shell(params: AndroidDeviceShellParams, progress: Progress): Promise<AndroidDeviceShellResult>;
+ installApk(params: AndroidDeviceInstallApkParams, progress: Progress): Promise<AndroidDeviceInstallApkResult>;
+ push(params: AndroidDevicePushParams, progress: Progress): Promise<AndroidDevicePushResult>;
+ connectToWebView(params: AndroidDeviceConnectToWebViewParams, progress: Progress): Promise<AndroidDeviceConnectToWebViewResult>;
+ close(params: AndroidDeviceCloseParams, progress: Progress): Promise<AndroidDeviceCloseResult>;
+}
+export type AndroidDeviceCloseEvent = {};
+export type AndroidDeviceWebViewAddedEvent = {
+ webView: AndroidWebView,
+};
+export type AndroidDeviceWebViewRemovedEvent = {
+ socketName: string,
+};
+export type AndroidDeviceWaitParams = {
+ androidSelector: AndroidSelector,
+ state?: 'gone',
+ timeout: number,
+};
+export type AndroidDeviceWaitOptions = {
+ state?: 'gone',
+};
+export type AndroidDeviceWaitResult = void;
+export type AndroidDeviceFillParams = {
+ androidSelector: AndroidSelector,
+ text: string,
+ timeout: number,
+};
+export type AndroidDeviceFillOptions = {
+
+};
+export type AndroidDeviceFillResult = void;
+export type AndroidDeviceTapParams = {
+ androidSelector: AndroidSelector,
+ duration?: number,
+ timeout: number,
+};
+export type AndroidDeviceTapOptions = {
+ duration?: number,
+};
+export type AndroidDeviceTapResult = void;
+export type AndroidDeviceDragParams = {
+ androidSelector: AndroidSelector,
+ dest: Point,
+ speed?: number,
+ timeout: number,
+};
+export type AndroidDeviceDragOptions = {
+ speed?: number,
+};
+export type AndroidDeviceDragResult = void;
+export type AndroidDeviceFlingParams = {
+ androidSelector: AndroidSelector,
+ direction: 'up' | 'down' | 'left' | 'right',
+ speed?: number,
+ timeout: number,
+};
+export type AndroidDeviceFlingOptions = {
+ speed?: number,
+};
+export type AndroidDeviceFlingResult = void;
+export type AndroidDeviceLongTapParams = {
+ androidSelector: AndroidSelector,
+ timeout: number,
+};
+export type AndroidDeviceLongTapOptions = {
+
+};
+export type AndroidDeviceLongTapResult = void;
+export type AndroidDevicePinchCloseParams = {
+ androidSelector: AndroidSelector,
+ percent: number,
+ speed?: number,
+ timeout: number,
+};
+export type AndroidDevicePinchCloseOptions = {
+ speed?: number,
+};
+export type AndroidDevicePinchCloseResult = void;
+export type AndroidDevicePinchOpenParams = {
+ androidSelector: AndroidSelector,
+ percent: number,
+ speed?: number,
+ timeout: number,
+};
+export type AndroidDevicePinchOpenOptions = {
+ speed?: number,
+};
+export type AndroidDevicePinchOpenResult = void;
+export type AndroidDeviceScrollParams = {
+ androidSelector: AndroidSelector,
+ direction: 'up' | 'down' | 'left' | 'right',
+ percent: number,
+ speed?: number,
+ timeout: number,
+};
+export type AndroidDeviceScrollOptions = {
+ speed?: number,
+};
+export type AndroidDeviceScrollResult = void;
+export type AndroidDeviceSwipeParams = {
+ androidSelector: AndroidSelector,
+ direction: 'up' | 'down' | 'left' | 'right',
+ percent: number,
+ speed?: number,
+ timeout: number,
+};
+export type AndroidDeviceSwipeOptions = {
+ speed?: number,
+};
+export type AndroidDeviceSwipeResult = void;
+export type AndroidDeviceInfoParams = {
+ androidSelector: AndroidSelector,
+};
+export type AndroidDeviceInfoOptions = {
+
+};
+export type AndroidDeviceInfoResult = {
+ info: AndroidElementInfo,
+};
+export type AndroidDeviceScreenshotParams = {};
+export type AndroidDeviceScreenshotOptions = {};
+export type AndroidDeviceScreenshotResult = {
+ binary: Binary,
+};
+export type AndroidDeviceInputTypeParams = {
+ text: string,
+};
+export type AndroidDeviceInputTypeOptions = {
+
+};
+export type AndroidDeviceInputTypeResult = void;
+export type AndroidDeviceInputPressParams = {
+ key: string,
+};
+export type AndroidDeviceInputPressOptions = {
+
+};
+export type AndroidDeviceInputPressResult = void;
+export type AndroidDeviceInputTapParams = {
+ point: Point,
+};
+export type AndroidDeviceInputTapOptions = {
+
+};
+export type AndroidDeviceInputTapResult = void;
+export type AndroidDeviceInputSwipeParams = {
+ segments: Point[],
+ steps: number,
+};
+export type AndroidDeviceInputSwipeOptions = {
+
+};
+export type AndroidDeviceInputSwipeResult = void;
+export type AndroidDeviceInputDragParams = {
+ from: Point,
+ to: Point,
+ steps: number,
+};
+export type AndroidDeviceInputDragOptions = {
+
+};
+export type AndroidDeviceInputDragResult = void;
+export type AndroidDeviceLaunchBrowserParams = {
+ noDefaultViewport?: boolean,
+ viewport?: {
+ width: number,
+ height: number,
+ },
+ screen?: {
+ width: number,
+ height: number,
+ },
+ ignoreHTTPSErrors?: boolean,
+ clientCertificates?: {
+ origin: string,
+ cert?: Binary,
+ key?: Binary,
+ passphrase?: string,
+ pfx?: Binary,
+ }[],
+ javaScriptEnabled?: boolean,
+ bypassCSP?: boolean,
+ userAgent?: string,
+ locale?: string,
+ timezoneId?: string,
+ geolocation?: {
+ longitude: number,
+ latitude: number,
+ accuracy?: number,
+ },
+ permissions?: string[],
+ extraHTTPHeaders?: NameValue[],
+ offline?: boolean,
+ httpCredentials?: {
+ username: string,
+ password: string,
+ origin?: string,
+ send?: 'always' | 'unauthorized',
+ },
+ deviceScaleFactor?: number,
+ isMobile?: boolean,
+ hasTouch?: boolean,
+ colorScheme?: 'dark' | 'light' | 'no-preference' | 'no-override',
+ reducedMotion?: 'reduce' | 'no-preference' | 'no-override',
+ forcedColors?: 'active' | 'none' | 'no-override',
+ acceptDownloads?: 'accept' | 'deny' | 'internal-browser-default',
+ contrast?: 'no-preference' | 'more' | 'no-override',
+ baseURL?: string,
+ recordVideo?: {
+ dir?: string,
+ size?: {
+ width: number,
+ height: number,
+ },
+ showActions?: {
+ duration?: number,
+ position?: 'top-left' | 'top' | 'top-right' | 'bottom-left' | 'bottom' | 'bottom-right',
+ fontSize?: number,
+ cursor?: 'none' | 'pointer',
+ },
+ },
+ strictSelectors?: boolean,
+ serviceWorkers?: 'allow' | 'block',
+ selectorEngines?: SelectorEngine[],
+ testIdAttributeName?: string,
+ pkg?: string,
+ args?: string[],
+ proxy?: {
+ server: string,
+ bypass?: string,
+ username?: string,
+ password?: string,
+ },
+};
+export type AndroidDeviceLaunchBrowserOptions = {
+ noDefaultViewport?: boolean,
+ viewport?: {
+ width: number,
+ height: number,
+ },
+ screen?: {
+ width: number,
+ height: number,
+ },
+ ignoreHTTPSErrors?: boolean,
+ clientCertificates?: {
+ origin: string,
+ cert?: Binary,
+ key?: Binary,
+ passphrase?: string,
+ pfx?: Binary,
+ }[],
+ javaScriptEnabled?: boolean,
+ bypassCSP?: boolean,
+ userAgent?: string,
+ locale?: string,
+ timezoneId?: string,
+ geolocation?: {
+ longitude: number,
+ latitude: number,
+ accuracy?: number,
+ },
+ permissions?: string[],
+ extraHTTPHeaders?: NameValue[],
+ offline?: boolean,
+ httpCredentials?: {
+ username: string,
+ password: string,
+ origin?: string,
+ send?: 'always' | 'unauthorized',
+ },
+ deviceScaleFactor?: number,
+ isMobile?: boolean,
+ hasTouch?: boolean,
+ colorScheme?: 'dark' | 'light' | 'no-preference' | 'no-override',
+ reducedMotion?: 'reduce' | 'no-preference' | 'no-override',
+ forcedColors?: 'active' | 'none' | 'no-override',
+ acceptDownloads?: 'accept' | 'deny' | 'internal-browser-default',
+ contrast?: 'no-preference' | 'more' | 'no-override',
+ baseURL?: string,
+ recordVideo?: {
+ dir?: string,
+ size?: {
+ width: number,
+ height: number,
+ },
+ showActions?: {
+ duration?: number,
+ position?: 'top-left' | 'top' | 'top-right' | 'bottom-left' | 'bottom' | 'bottom-right',
+ fontSize?: number,
+ cursor?: 'none' | 'pointer',
+ },
+ },
+ strictSelectors?: boolean,
+ serviceWorkers?: 'allow' | 'block',
+ selectorEngines?: SelectorEngine[],
+ testIdAttributeName?: string,
+ pkg?: string,
+ args?: string[],
+ proxy?: {
+ server: string,
+ bypass?: string,
+ username?: string,
+ password?: string,
+ },
+};
+export type AndroidDeviceLaunchBrowserResult = {
+ context: BrowserContextChannel,
+};
+export type AndroidDeviceOpenParams = {
+ command: string,
+};
+export type AndroidDeviceOpenOptions = {
+
+};
+export type AndroidDeviceOpenResult = {
+ socket: AndroidSocketChannel,
+};
+export type AndroidDeviceShellParams = {
+ command: string,
+};
+export type AndroidDeviceShellOptions = {
+
+};
+export type AndroidDeviceShellResult = {
+ result: Binary,
+};
+export type AndroidDeviceInstallApkParams = {
+ file: Binary,
+ args?: string[],
+};
+export type AndroidDeviceInstallApkOptions = {
+ args?: string[],
+};
+export type AndroidDeviceInstallApkResult = void;
+export type AndroidDevicePushParams = {
+ file: Binary,
+ path: string,
+ mode?: number,
+};
+export type AndroidDevicePushOptions = {
+ mode?: number,
+};
+export type AndroidDevicePushResult = void;
+export type AndroidDeviceConnectToWebViewParams = {
+ socketName: string,
+};
+export type AndroidDeviceConnectToWebViewOptions = {
+
+};
+export type AndroidDeviceConnectToWebViewResult = {
+ context: BrowserContextChannel,
+};
+export type AndroidDeviceCloseParams = {};
+export type AndroidDeviceCloseOptions = {};
+export type AndroidDeviceCloseResult = void;
+
+export interface AndroidDeviceEvents {
+ 'close': AndroidDeviceCloseEvent;
+ 'webViewAdded': AndroidDeviceWebViewAddedEvent;
+ 'webViewRemoved': AndroidDeviceWebViewRemovedEvent;
+}
+
+export type AndroidWebView = {
+ pid: number,
+ pkg: string,
+ socketName: string,
+};
+
+export type AndroidSelector = {
+ checkable?: boolean,
+ checked?: boolean,
+ clazz?: string,
+ clickable?: boolean,
+ depth?: number,
+ desc?: string,
+ enabled?: boolean,
+ focusable?: boolean,
+ focused?: boolean,
+ hasChild?: {
+ androidSelector: AndroidSelector,
+ },
+ hasDescendant?: {
+ androidSelector: AndroidSelector,
+ maxDepth?: number,
+ },
+ longClickable?: boolean,
+ pkg?: string,
+ res?: string,
+ scrollable?: boolean,
+ selected?: boolean,
+ text?: string,
+};
+
+export type AndroidElementInfo = {
+ children?: AndroidElementInfo[],
+ clazz: string,
+ desc: string,
+ res: string,
+ pkg: string,
+ text: string,
+ bounds: Rect,
+ checkable: boolean,
+ checked: boolean,
+ clickable: boolean,
+ enabled: boolean,
+ focusable: boolean,
+ focused: boolean,
+ longClickable: boolean,
+ scrollable: boolean,
+ selected: boolean,
+};
+
+// ----------- APIRequestContext -----------
+export type APIRequestContextInitializer = {
+ tracing: TracingChannel,
+};
+export interface APIRequestContextEventTarget {
+}
+export interface APIRequestContextChannel extends APIRequestContextEventTarget, Channel {
+ _type_APIRequestContext: boolean;
+ fetch(params: APIRequestContextFetchParams, progress: Progress): Promise<APIRequestContextFetchResult>;
+ fetchResponseBody(params: APIRequestContextFetchResponseBodyParams, progress: Progress): Promise<APIRequestContextFetchResponseBodyResult>;
+ fetchLog(params: APIRequestContextFetchLogParams, progress: Progress): Promise<APIRequestContextFetchLogResult>;
+ storageState(params: APIRequestContextStorageStateParams, progress: Progress): Promise<APIRequestContextStorageStateResult>;
+ disposeAPIResponse(params: APIRequestContextDisposeAPIResponseParams, progress: Progress): Promise<APIRequestContextDisposeAPIResponseResult>;
+ dispose(params: APIRequestContextDisposeParams, progress: Progress): Promise<APIRequestContextDisposeResult>;
+}
+export type APIRequestContextFetchParams = {
+ url: string,
+ encodedParams?: string,
+ params?: NameValue[],
+ method?: string,
+ headers?: NameValue[],
+ postData?: Binary,
+ jsonData?: string,
+ formData?: NameValue[],
+ multipartData?: FormField[],
+ timeout: number,
+ failOnStatusCode?: boolean,
+ ignoreHTTPSErrors?: boolean,
+ maxRedirects?: number,
+ maxRetries?: number,
+};
+export type APIRequestContextFetchOptions = {
+ encodedParams?: string,
+ params?: NameValue[],
+ method?: string,
+ headers?: NameValue[],
+ postData?: Binary,
+ jsonData?: string,
+ formData?: NameValue[],
+ multipartData?: FormField[],
+ failOnStatusCode?: boolean,
+ ignoreHTTPSErrors?: boolean,
+ maxRedirects?: number,
+ maxRetries?: number,
+};
+export type APIRequestContextFetchResult = {
+ response: APIResponse,
+};
+export type APIRequestContextFetchResponseBodyParams = {
+ fetchUid: string,
+};
+export type APIRequestContextFetchResponseBodyOptions = {
+
+};
+export type APIRequestContextFetchResponseBodyResult = {
+ binary?: Binary,
+};
+export type APIRequestContextFetchLogParams = {
+ fetchUid: string,
+};
+export type APIRequestContextFetchLogOptions = {
+
+};
+export type APIRequestContextFetchLogResult = {
+ log: string[],
+};
+export type APIRequestContextStorageStateParams = {
+ indexedDB?: boolean,
+};
+export type APIRequestContextStorageStateOptions = {
+ indexedDB?: boolean,
+};
+export type APIRequestContextStorageStateResult = {
+ cookies: NetworkCookie[],
+ origins: OriginStorage[],
+};
+export type APIRequestContextDisposeAPIResponseParams = {
+ fetchUid: string,
+};
+export type APIRequestContextDisposeAPIResponseOptions = {
+
+};
+export type APIRequestContextDisposeAPIResponseResult = void;
+export type APIRequestContextDisposeParams = {
+ reason?: string,
+};
+export type APIRequestContextDisposeOptions = {
+ reason?: string,
+};
+export type APIRequestContextDisposeResult = void;
+
+export interface APIRequestContextEvents {
+}
+
+export type APIResponse = {
+ fetchUid: string,
+ url: string,
+ status: number,
+ statusText: string,
+ headers: NameValue[],
+ securityDetails?: SecurityDetails,
+ serverAddr?: RemoteAddr,
+};
+
+// ----------- Artifact -----------
+export type ArtifactInitializer = {
+ absolutePath: string,
+};
+export interface ArtifactEventTarget {
+}
+export interface ArtifactChannel extends ArtifactEventTarget, Channel {
+ _type_Artifact: boolean;
+ pathAfterFinished(params: ArtifactPathAfterFinishedParams, progress: Progress): Promise<ArtifactPathAfterFinishedResult>;
+ saveAs(params: ArtifactSaveAsParams, progress: Progress): Promise<ArtifactSaveAsResult>;
+ saveAsStream(params: ArtifactSaveAsStreamParams, progress: Progress): Promise<ArtifactSaveAsStreamResult>;
+ failure(params: ArtifactFailureParams, progress: Progress): Promise<ArtifactFailureResult>;
+ stream(params: ArtifactStreamParams, progress: Progress): Promise<ArtifactStreamResult>;
+ cancel(params: ArtifactCancelParams, progress: Progress): Promise<ArtifactCancelResult>;
+ delete(params: ArtifactDeleteParams, progress: Progress): Promise<ArtifactDeleteResult>;
+}
+export type ArtifactPathAfterFinishedParams = {};
+export type ArtifactPathAfterFinishedOptions = {};
+export type ArtifactPathAfterFinishedResult = {
+ value: string,
+};
+export type ArtifactSaveAsParams = {
+ path: string,
+};
+export type ArtifactSaveAsOptions = {
+
+};
+export type ArtifactSaveAsResult = void;
+export type ArtifactSaveAsStreamParams = {};
+export type ArtifactSaveAsStreamOptions = {};
+export type ArtifactSaveAsStreamResult = {
+ stream: StreamChannel,
+};
+export type ArtifactFailureParams = {};
+export type ArtifactFailureOptions = {};
+export type ArtifactFailureResult = {
+ error?: string,
+};
+export type ArtifactStreamParams = {};
+export type ArtifactStreamOptions = {};
+export type ArtifactStreamResult = {
+ stream: StreamChannel,
+};
+export type ArtifactCancelParams = {};
+export type ArtifactCancelOptions = {};
+export type ArtifactCancelResult = void;
+export type ArtifactDeleteParams = {};
+export type ArtifactDeleteOptions = {};
+export type ArtifactDeleteResult = void;
+
+export interface ArtifactEvents {
+}
+
+// ----------- Stream -----------
+export type StreamInitializer = {};
+export interface StreamEventTarget {
+}
+export interface StreamChannel extends StreamEventTarget, Channel {
+ _type_Stream: boolean;
+ read(params: StreamReadParams, progress: Progress): Promise<StreamReadResult>;
+ close(params: StreamCloseParams, progress: Progress): Promise<StreamCloseResult>;
+}
+export type StreamReadParams = {
+ size?: number,
+};
+export type StreamReadOptions = {
+ size?: number,
+};
+export type StreamReadResult = {
+ binary: Binary,
+};
+export type StreamCloseParams = {};
+export type StreamCloseOptions = {};
+export type StreamCloseResult = void;
+
+export interface StreamEvents {
+}
+
+// ----------- WritableStream -----------
+export type WritableStreamInitializer = {};
+export interface WritableStreamEventTarget {
+}
+export interface WritableStreamChannel extends WritableStreamEventTarget, Channel {
+ _type_WritableStream: boolean;
+ write(params: WritableStreamWriteParams, progress: Progress): Promise<WritableStreamWriteResult>;
+ close(params: WritableStreamCloseParams, progress: Progress): Promise<WritableStreamCloseResult>;
+}
+export type WritableStreamWriteParams = {
+ binary: Binary,
+};
+export type WritableStreamWriteOptions = {
+
+};
+export type WritableStreamWriteResult = void;
+export type WritableStreamCloseParams = {};
+export type WritableStreamCloseOptions = {};
+export type WritableStreamCloseResult = void;
+
+export interface WritableStreamEvents {
+}
+
+// ----------- Browser -----------
+export type BrowserInitializer = {
+ version: string,
+ name: string,
+ browserName: 'chromium' | 'firefox' | 'webkit',
+};
+export interface BrowserEventTarget {
+ _dispatchEvent(event: 'context', params?: BrowserContextEvent): void;
+ _dispatchEvent(event: 'close', params?: BrowserCloseEvent): void;
+}
+export interface BrowserChannel extends BrowserEventTarget, Channel {
+ _type_Browser: boolean;
+ startServer(params: BrowserStartServerParams, progress: Progress): Promise<BrowserStartServerResult>;
+ stopServer(params: BrowserStopServerParams, progress: Progress): Promise<BrowserStopServerResult>;
+ close(params: BrowserCloseParams, progress: Progress): Promise<BrowserCloseResult>;
+ killForTests(params: BrowserKillForTestsParams, progress: Progress): Promise<BrowserKillForTestsResult>;
+ defaultUserAgentForTest(params: BrowserDefaultUserAgentForTestParams, progress: Progress): Promise<BrowserDefaultUserAgentForTestResult>;
+ newContext(params: BrowserNewContextParams, progress: Progress): Promise<BrowserNewContextResult>;
+ newContextForReuse(params: BrowserNewContextForReuseParams, progress: Progress): Promise<BrowserNewContextForReuseResult>;
+ disconnectFromReusedContext(params: BrowserDisconnectFromReusedContextParams, progress: Progress): Promise<BrowserDisconnectFromReusedContextResult>;
+ newBrowserCDPSession(params: BrowserNewBrowserCDPSessionParams, progress: Progress): Promise<BrowserNewBrowserCDPSessionResult>;
+ startTracing(params: BrowserStartTracingParams, progress: Progress): Promise<BrowserStartTracingResult>;
+ stopTracing(params: BrowserStopTracingParams, progress: Progress): Promise<BrowserStopTracingResult>;
+}
+export type BrowserContextEvent = {
+ context: BrowserContextChannel,
+};
+export type BrowserCloseEvent = {};
+export type BrowserStartServerParams = {
+ title: string,
+ workspaceDir?: string,
+ metadata?: any,
+ host?: string,
+ port?: number,
+};
+export type BrowserStartServerOptions = {
+ workspaceDir?: string,
+ metadata?: any,
+ host?: string,
+ port?: number,
+};
+export type BrowserStartServerResult = {
+ endpoint: string,
+};
+export type BrowserStopServerParams = {};
+export type BrowserStopServerOptions = {};
+export type BrowserStopServerResult = void;
+export type BrowserCloseParams = {
+ reason?: string,
+};
+export type BrowserCloseOptions = {
+ reason?: string,
+};
+export type BrowserCloseResult = void;
+export type BrowserKillForTestsParams = {};
+export type BrowserKillForTestsOptions = {};
+export type BrowserKillForTestsResult = void;
+export type BrowserDefaultUserAgentForTestParams = {};
+export type BrowserDefaultUserAgentForTestOptions = {};
+export type BrowserDefaultUserAgentForTestResult = {
+ userAgent: string,
+};
+export type BrowserNewContextParams = {
+ noDefaultViewport?: boolean,
+ viewport?: {
+ width: number,
+ height: number,
+ },
+ screen?: {
+ width: number,
+ height: number,
+ },
+ ignoreHTTPSErrors?: boolean,
+ clientCertificates?: {
+ origin: string,
+ cert?: Binary,
+ key?: Binary,
+ passphrase?: string,
+ pfx?: Binary,
+ }[],
+ javaScriptEnabled?: boolean,
+ bypassCSP?: boolean,
+ userAgent?: string,
+ locale?: string,
+ timezoneId?: string,
+ geolocation?: {
+ longitude: number,
+ latitude: number,
+ accuracy?: number,
+ },
+ permissions?: string[],
+ extraHTTPHeaders?: NameValue[],
+ offline?: boolean,
+ httpCredentials?: {
+ username: string,
+ password: string,
+ origin?: string,
+ send?: 'always' | 'unauthorized',
+ },
+ deviceScaleFactor?: number,
+ isMobile?: boolean,
+ hasTouch?: boolean,
+ colorScheme?: 'dark' | 'light' | 'no-preference' | 'no-override',
+ reducedMotion?: 'reduce' | 'no-preference' | 'no-override',
+ forcedColors?: 'active' | 'none' | 'no-override',
+ acceptDownloads?: 'accept' | 'deny' | 'internal-browser-default',
+ contrast?: 'no-preference' | 'more' | 'no-override',
+ baseURL?: string,
+ recordVideo?: {
+ dir?: string,
+ size?: {
+ width: number,
+ height: number,
+ },
+ showActions?: {
+ duration?: number,
+ position?: 'top-left' | 'top' | 'top-right' | 'bottom-left' | 'bottom' | 'bottom-right',
+ fontSize?: number,
+ cursor?: 'none' | 'pointer',
+ },
+ },
+ strictSelectors?: boolean,
+ serviceWorkers?: 'allow' | 'block',
+ selectorEngines?: SelectorEngine[],
+ testIdAttributeName?: string,
+ proxy?: {
+ server: string,
+ bypass?: string,
+ username?: string,
+ password?: string,
+ },
+ storageState?: {
+ cookies?: SetNetworkCookie[],
+ origins?: SetOriginStorage[],
+ },
+};
+export type BrowserNewContextOptions = {
+ noDefaultViewport?: boolean,
+ viewport?: {
+ width: number,
+ height: number,
+ },
+ screen?: {
+ width: number,
+ height: number,
+ },
+ ignoreHTTPSErrors?: boolean,
+ clientCertificates?: {
+ origin: string,
+ cert?: Binary,
+ key?: Binary,
+ passphrase?: string,
+ pfx?: Binary,
+ }[],
+ javaScriptEnabled?: boolean,
+ bypassCSP?: boolean,
+ userAgent?: string,
+ locale?: string,
+ timezoneId?: string,
+ geolocation?: {
+ longitude: number,
+ latitude: number,
+ accuracy?: number,
+ },
+ permissions?: string[],
+ extraHTTPHeaders?: NameValue[],
+ offline?: boolean,
+ httpCredentials?: {
+ username: string,
+ password: string,
+ origin?: string,
+ send?: 'always' | 'unauthorized',
+ },
+ deviceScaleFactor?: number,
+ isMobile?: boolean,
+ hasTouch?: boolean,
+ colorScheme?: 'dark' | 'light' | 'no-preference' | 'no-override',
+ reducedMotion?: 'reduce' | 'no-preference' | 'no-override',
+ forcedColors?: 'active' | 'none' | 'no-override',
+ acceptDownloads?: 'accept' | 'deny' | 'internal-browser-default',
+ contrast?: 'no-preference' | 'more' | 'no-override',
+ baseURL?: string,
+ recordVideo?: {
+ dir?: string,
+ size?: {
+ width: number,
+ height: number,
+ },
+ showActions?: {
+ duration?: number,
+ position?: 'top-left' | 'top' | 'top-right' | 'bottom-left' | 'bottom' | 'bottom-right',
+ fontSize?: number,
+ cursor?: 'none' | 'pointer',
+ },
+ },
+ strictSelectors?: boolean,
+ serviceWorkers?: 'allow' | 'block',
+ selectorEngines?: SelectorEngine[],
+ testIdAttributeName?: string,
+ proxy?: {
+ server: string,
+ bypass?: string,
+ username?: string,
+ password?: string,
+ },
+ storageState?: {
+ cookies?: SetNetworkCookie[],
+ origins?: SetOriginStorage[],
+ },
+};
+export type BrowserNewContextResult = {
+ context: BrowserContextChannel,
+};
+export type BrowserNewContextForReuseParams = {
+ noDefaultViewport?: boolean,
+ viewport?: {
+ width: number,
+ height: number,
+ },
+ screen?: {
+ width: number,
+ height: number,
+ },
+ ignoreHTTPSErrors?: boolean,
+ clientCertificates?: {
+ origin: string,
+ cert?: Binary,
+ key?: Binary,
+ passphrase?: string,
+ pfx?: Binary,
+ }[],
+ javaScriptEnabled?: boolean,
+ bypassCSP?: boolean,
+ userAgent?: string,
+ locale?: string,
+ timezoneId?: string,
+ geolocation?: {
+ longitude: number,
+ latitude: number,
+ accuracy?: number,
+ },
+ permissions?: string[],
+ extraHTTPHeaders?: NameValue[],
+ offline?: boolean,
+ httpCredentials?: {
+ username: string,
+ password: string,
+ origin?: string,
+ send?: 'always' | 'unauthorized',
+ },
+ deviceScaleFactor?: number,
+ isMobile?: boolean,
+ hasTouch?: boolean,
+ colorScheme?: 'dark' | 'light' | 'no-preference' | 'no-override',
+ reducedMotion?: 'reduce' | 'no-preference' | 'no-override',
+ forcedColors?: 'active' | 'none' | 'no-override',
+ acceptDownloads?: 'accept' | 'deny' | 'internal-browser-default',
+ contrast?: 'no-preference' | 'more' | 'no-override',
+ baseURL?: string,
+ recordVideo?: {
+ dir?: string,
+ size?: {
+ width: number,
+ height: number,
+ },
+ showActions?: {
+ duration?: number,
+ position?: 'top-left' | 'top' | 'top-right' | 'bottom-left' | 'bottom' | 'bottom-right',
+ fontSize?: number,
+ cursor?: 'none' | 'pointer',
+ },
+ },
+ strictSelectors?: boolean,
+ serviceWorkers?: 'allow' | 'block',
+ selectorEngines?: SelectorEngine[],
+ testIdAttributeName?: string,
+ proxy?: {
+ server: string,
+ bypass?: string,
+ username?: string,
+ password?: string,
+ },
+ storageState?: {
+ cookies?: SetNetworkCookie[],
+ origins?: SetOriginStorage[],
+ },
+};
+export type BrowserNewContextForReuseOptions = {
+ noDefaultViewport?: boolean,
+ viewport?: {
+ width: number,
+ height: number,
+ },
+ screen?: {
+ width: number,
+ height: number,
+ },
+ ignoreHTTPSErrors?: boolean,
+ clientCertificates?: {
+ origin: string,
+ cert?: Binary,
+ key?: Binary,
+ passphrase?: string,
+ pfx?: Binary,
+ }[],
+ javaScriptEnabled?: boolean,
+ bypassCSP?: boolean,
+ userAgent?: string,
+ locale?: string,
+ timezoneId?: string,
+ geolocation?: {
+ longitude: number,
+ latitude: number,
+ accuracy?: number,
+ },
+ permissions?: string[],
+ extraHTTPHeaders?: NameValue[],
+ offline?: boolean,
+ httpCredentials?: {
+ username: string,
+ password: string,
+ origin?: string,
+ send?: 'always' | 'unauthorized',
+ },
+ deviceScaleFactor?: number,
+ isMobile?: boolean,
+ hasTouch?: boolean,
+ colorScheme?: 'dark' | 'light' | 'no-preference' | 'no-override',
+ reducedMotion?: 'reduce' | 'no-preference' | 'no-override',
+ forcedColors?: 'active' | 'none' | 'no-override',
+ acceptDownloads?: 'accept' | 'deny' | 'internal-browser-default',
+ contrast?: 'no-preference' | 'more' | 'no-override',
+ baseURL?: string,
+ recordVideo?: {
+ dir?: string,
+ size?: {
+ width: number,
+ height: number,
+ },
+ showActions?: {
+ duration?: number,
+ position?: 'top-left' | 'top' | 'top-right' | 'bottom-left' | 'bottom' | 'bottom-right',
+ fontSize?: number,
+ cursor?: 'none' | 'pointer',
+ },
+ },
+ strictSelectors?: boolean,
+ serviceWorkers?: 'allow' | 'block',
+ selectorEngines?: SelectorEngine[],
+ testIdAttributeName?: string,
+ proxy?: {
+ server: string,
+ bypass?: string,
+ username?: string,
+ password?: string,
+ },
+ storageState?: {
+ cookies?: SetNetworkCookie[],
+ origins?: SetOriginStorage[],
+ },
+};
+export type BrowserNewContextForReuseResult = {
+ context: BrowserContextChannel,
+};
+export type BrowserDisconnectFromReusedContextParams = {
+ reason: string,
+};
+export type BrowserDisconnectFromReusedContextOptions = {
+
+};
+export type BrowserDisconnectFromReusedContextResult = void;
+export type BrowserNewBrowserCDPSessionParams = {};
+export type BrowserNewBrowserCDPSessionOptions = {};
+export type BrowserNewBrowserCDPSessionResult = {
+ session: CDPSessionChannel,
+};
+export type BrowserStartTracingParams = {
+ page?: PageChannel,
+ screenshots?: boolean,
+ categories?: string[],
+};
+export type BrowserStartTracingOptions = {
+ page?: PageChannel,
+ screenshots?: boolean,
+ categories?: string[],
+};
+export type BrowserStartTracingResult = void;
+export type BrowserStopTracingParams = {};
+export type BrowserStopTracingOptions = {};
+export type BrowserStopTracingResult = {
+ artifact: ArtifactChannel,
+};
+
+export interface BrowserEvents {
+ 'context': BrowserContextEvent;
+ 'close': BrowserCloseEvent;
+}
+
+// ----------- BrowserContext -----------
+export type BrowserContextInitializer = {
+ debugger: DebuggerChannel,
+ requestContext: APIRequestContextChannel,
+ tracing: TracingChannel,
+ options: {
+ noDefaultViewport?: boolean,
+ viewport?: {
+ width: number,
+ height: number,
+ },
+ screen?: {
+ width: number,
+ height: number,
+ },
+ ignoreHTTPSErrors?: boolean,
+ clientCertificates?: {
+ origin: string,
+ cert?: Binary,
+ key?: Binary,
+ passphrase?: string,
+ pfx?: Binary,
+ }[],
+ javaScriptEnabled?: boolean,
+ bypassCSP?: boolean,
+ userAgent?: string,
+ locale?: string,
+ timezoneId?: string,
+ geolocation?: {
+ longitude: number,
+ latitude: number,
+ accuracy?: number,
+ },
+ permissions?: string[],
+ extraHTTPHeaders?: NameValue[],
+ offline?: boolean,
+ httpCredentials?: {
+ username: string,
+ password: string,
+ origin?: string,
+ send?: 'always' | 'unauthorized',
+ },
+ deviceScaleFactor?: number,
+ isMobile?: boolean,
+ hasTouch?: boolean,
+ colorScheme?: 'dark' | 'light' | 'no-preference' | 'no-override',
+ reducedMotion?: 'reduce' | 'no-preference' | 'no-override',
+ forcedColors?: 'active' | 'none' | 'no-override',
+ acceptDownloads?: 'accept' | 'deny' | 'internal-browser-default',
+ contrast?: 'no-preference' | 'more' | 'no-override',
+ baseURL?: string,
+ recordVideo?: {
+ dir?: string,
+ size?: {
+ width: number,
+ height: number,
+ },
+ showActions?: {
+ duration?: number,
+ position?: 'top-left' | 'top' | 'top-right' | 'bottom-left' | 'bottom' | 'bottom-right',
+ fontSize?: number,
+ cursor?: 'none' | 'pointer',
+ },
+ },
+ strictSelectors?: boolean,
+ serviceWorkers?: 'allow' | 'block',
+ selectorEngines?: SelectorEngine[],
+ testIdAttributeName?: string,
+ },
+};
+export interface BrowserContextEventTarget {
+ _dispatchEvent(event: 'bindingCall', params?: BrowserContextBindingCallEvent): void;
+ _dispatchEvent(event: 'console', params?: BrowserContextConsoleEvent): void;
+ _dispatchEvent(event: 'close', params?: BrowserContextCloseEvent): void;
+ _dispatchEvent(event: 'dialog', params?: BrowserContextDialogEvent): void;
+ _dispatchEvent(event: 'page', params?: BrowserContextPageEvent): void;
+ _dispatchEvent(event: 'pageError', params?: BrowserContextPageErrorEvent): void;
+ _dispatchEvent(event: 'route', params?: BrowserContextRouteEvent): void;
+ _dispatchEvent(event: 'webSocketRoute', params?: BrowserContextWebSocketRouteEvent): void;
+ _dispatchEvent(event: 'serviceWorker', params?: BrowserContextServiceWorkerEvent): void;
+ _dispatchEvent(event: 'request', params?: BrowserContextRequestEvent): void;
+ _dispatchEvent(event: 'requestFailed', params?: BrowserContextRequestFailedEvent): void;
+ _dispatchEvent(event: 'requestFinished', params?: BrowserContextRequestFinishedEvent): void;
+ _dispatchEvent(event: 'response', params?: BrowserContextResponseEvent): void;
+ _dispatchEvent(event: 'recorderEvent', params?: BrowserContextRecorderEventEvent): void;
+}
+export interface BrowserContextChannel extends BrowserContextEventTarget, Channel {
+ _type_BrowserContext: boolean;
+ addCookies(params: BrowserContextAddCookiesParams, progress: Progress): Promise<BrowserContextAddCookiesResult>;
+ addInitScript(params: BrowserContextAddInitScriptParams, progress: Progress): Promise<BrowserContextAddInitScriptResult>;
+ clearCookies(params: BrowserContextClearCookiesParams, progress: Progress): Promise<BrowserContextClearCookiesResult>;
+ clearPermissions(params: BrowserContextClearPermissionsParams, progress: Progress): Promise<BrowserContextClearPermissionsResult>;
+ close(params: BrowserContextCloseParams, progress: Progress): Promise<BrowserContextCloseResult>;
+ cookies(params: BrowserContextCookiesParams, progress: Progress): Promise<BrowserContextCookiesResult>;
+ exposeBinding(params: BrowserContextExposeBindingParams, progress: Progress): Promise<BrowserContextExposeBindingResult>;
+ grantPermissions(params: BrowserContextGrantPermissionsParams, progress: Progress): Promise<BrowserContextGrantPermissionsResult>;
+ newPage(params: BrowserContextNewPageParams, progress: Progress): Promise<BrowserContextNewPageResult>;
+ registerSelectorEngine(params: BrowserContextRegisterSelectorEngineParams, progress: Progress): Promise<BrowserContextRegisterSelectorEngineResult>;
+ setTestIdAttributeName(params: BrowserContextSetTestIdAttributeNameParams, progress: Progress): Promise<BrowserContextSetTestIdAttributeNameResult>;
+ setExtraHTTPHeaders(params: BrowserContextSetExtraHTTPHeadersParams, progress: Progress): Promise<BrowserContextSetExtraHTTPHeadersResult>;
+ setGeolocation(params: BrowserContextSetGeolocationParams, progress: Progress): Promise<BrowserContextSetGeolocationResult>;
+ setHTTPCredentials(params: BrowserContextSetHTTPCredentialsParams, progress: Progress): Promise<BrowserContextSetHTTPCredentialsResult>;
+ setNetworkInterceptionPatterns(params: BrowserContextSetNetworkInterceptionPatternsParams, progress: Progress): Promise<BrowserContextSetNetworkInterceptionPatternsResult>;
+ setWebSocketInterceptionPatterns(params: BrowserContextSetWebSocketInterceptionPatternsParams, progress: Progress): Promise<BrowserContextSetWebSocketInterceptionPatternsResult>;
+ setOffline(params: BrowserContextSetOfflineParams, progress: Progress): Promise<BrowserContextSetOfflineResult>;
+ storageState(params: BrowserContextStorageStateParams, progress: Progress): Promise<BrowserContextStorageStateResult>;
+ setStorageState(params: BrowserContextSetStorageStateParams, progress: Progress): Promise<BrowserContextSetStorageStateResult>;
+ pause(params: BrowserContextPauseParams, progress: Progress): Promise<BrowserContextPauseResult>;
+ enableRecorder(params: BrowserContextEnableRecorderParams, progress: Progress): Promise<BrowserContextEnableRecorderResult>;
+ disableRecorder(params: BrowserContextDisableRecorderParams, progress: Progress): Promise<BrowserContextDisableRecorderResult>;
+ exposeConsoleApi(params: BrowserContextExposeConsoleApiParams, progress: Progress): Promise<BrowserContextExposeConsoleApiResult>;
+ newCDPSession(params: BrowserContextNewCDPSessionParams, progress: Progress): Promise<BrowserContextNewCDPSessionResult>;
+ createTempFiles(params: BrowserContextCreateTempFilesParams, progress: Progress): Promise<BrowserContextCreateTempFilesResult>;
+ updateSubscription(params: BrowserContextUpdateSubscriptionParams, progress: Progress): Promise<BrowserContextUpdateSubscriptionResult>;
+ clockFastForward(params: BrowserContextClockFastForwardParams, progress: Progress): Promise<BrowserContextClockFastForwardResult>;
+ clockInstall(params: BrowserContextClockInstallParams, progress: Progress): Promise<BrowserContextClockInstallResult>;
+ clockPauseAt(params: BrowserContextClockPauseAtParams, progress: Progress): Promise<BrowserContextClockPauseAtResult>;
+ clockResume(params: BrowserContextClockResumeParams, progress: Progress): Promise<BrowserContextClockResumeResult>;
+ clockRunFor(params: BrowserContextClockRunForParams, progress: Progress): Promise<BrowserContextClockRunForResult>;
+ clockSetFixedTime(params: BrowserContextClockSetFixedTimeParams, progress: Progress): Promise<BrowserContextClockSetFixedTimeResult>;
+ clockSetSystemTime(params: BrowserContextClockSetSystemTimeParams, progress: Progress): Promise<BrowserContextClockSetSystemTimeResult>;
+ credentialsInstall(params: BrowserContextCredentialsInstallParams, progress: Progress): Promise<BrowserContextCredentialsInstallResult>;
+ credentialsCreate(params: BrowserContextCredentialsCreateParams, progress: Progress): Promise<BrowserContextCredentialsCreateResult>;
+ credentialsGet(params: BrowserContextCredentialsGetParams, progress: Progress): Promise<BrowserContextCredentialsGetResult>;
+ credentialsDelete(params: BrowserContextCredentialsDeleteParams, progress: Progress): Promise<BrowserContextCredentialsDeleteResult>;
+}
+export type BrowserContextBindingCallEvent = {
+ binding: BindingCallChannel,
+};
+export type BrowserContextConsoleEvent = {
+ type: string,
+ text: string,
+ args: JSHandleChannel[],
+ location: {
+ url: string,
+ lineNumber: number,
+ columnNumber: number,
+ },
+ timestamp: number,
+ page?: PageChannel,
+ worker?: WorkerChannel,
+};
+export type BrowserContextCloseEvent = {};
+export type BrowserContextDialogEvent = {
+ dialog: DialogChannel,
+};
+export type BrowserContextPageEvent = {
+ page: PageChannel,
+};
+export type BrowserContextPageErrorEvent = {
+ error: SerializedError,
+ page: PageChannel,
+ location: {
+ url: string,
+ line: number,
+ column: number,
+ },
+};
+export type BrowserContextRouteEvent = {
+ route: RouteChannel,
+};
+export type BrowserContextWebSocketRouteEvent = {
+ webSocketRoute: WebSocketRouteChannel,
+};
+export type BrowserContextServiceWorkerEvent = {
+ worker: WorkerChannel,
+};
+export type BrowserContextRequestEvent = {
+ request: RequestChannel,
+ page?: PageChannel,
+};
+export type BrowserContextRequestFailedEvent = {
+ request: RequestChannel,
+ failureText?: string,
+ responseEndTiming: number,
+ page?: PageChannel,
+};
+export type BrowserContextRequestFinishedEvent = {
+ request: RequestChannel,
+ response?: ResponseChannel,
+ responseEndTiming: number,
+ page?: PageChannel,
+};
+export type BrowserContextResponseEvent = {
+ response: ResponseChannel,
+ page?: PageChannel,
+};
+export type BrowserContextRecorderEventEvent = {
+ event: 'actionAdded' | 'actionUpdated' | 'signalAdded',
+ data: any,
+ page: PageChannel,
+ code: string,
+};
+export type BrowserContextAddCookiesParams = {
+ cookies: SetNetworkCookie[],
+};
+export type BrowserContextAddCookiesOptions = {
+
+};
+export type BrowserContextAddCookiesResult = void;
+export type BrowserContextAddInitScriptParams = {
+ source: string,
+};
+export type BrowserContextAddInitScriptOptions = {
+
+};
+export type BrowserContextAddInitScriptResult = {
+ disposable: DisposableChannel,
+};
+export type BrowserContextClearCookiesParams = {
+ name?: string,
+ nameRegexSource?: string,
+ nameRegexFlags?: string,
+ domain?: string,
+ domainRegexSource?: string,
+ domainRegexFlags?: string,
+ path?: string,
+ pathRegexSource?: string,
+ pathRegexFlags?: string,
+};
+export type BrowserContextClearCookiesOptions = {
+ name?: string,
+ nameRegexSource?: string,
+ nameRegexFlags?: string,
+ domain?: string,
+ domainRegexSource?: string,
+ domainRegexFlags?: string,
+ path?: string,
+ pathRegexSource?: string,
+ pathRegexFlags?: string,
+};
+export type BrowserContextClearCookiesResult = void;
+export type BrowserContextClearPermissionsParams = {};
+export type BrowserContextClearPermissionsOptions = {};
+export type BrowserContextClearPermissionsResult = void;
+export type BrowserContextCloseParams = {
+ reason?: string,
+};
+export type BrowserContextCloseOptions = {
+ reason?: string,
+};
+export type BrowserContextCloseResult = void;
+export type BrowserContextCookiesParams = {
+ urls: string[],
+};
+export type BrowserContextCookiesOptions = {
+
+};
+export type BrowserContextCookiesResult = {
+ cookies: NetworkCookie[],
+};
+export type BrowserContextExposeBindingParams = {
+ name: string,
+};
+export type BrowserContextExposeBindingOptions = {
+
+};
+export type BrowserContextExposeBindingResult = {
+ disposable: DisposableChannel,
+};
+export type BrowserContextGrantPermissionsParams = {
+ permissions: string[],
+ origin?: string,
+};
+export type BrowserContextGrantPermissionsOptions = {
+ origin?: string,
+};
+export type BrowserContextGrantPermissionsResult = void;
+export type BrowserContextNewPageParams = {};
+export type BrowserContextNewPageOptions = {};
+export type BrowserContextNewPageResult = {
+ page: PageChannel,
+};
+export type BrowserContextRegisterSelectorEngineParams = {
+ selectorEngine: SelectorEngine,
+};
+export type BrowserContextRegisterSelectorEngineOptions = {
+
+};
+export type BrowserContextRegisterSelectorEngineResult = void;
+export type BrowserContextSetTestIdAttributeNameParams = {
+ testIdAttributeName: string,
+};
+export type BrowserContextSetTestIdAttributeNameOptions = {
+
+};
+export type BrowserContextSetTestIdAttributeNameResult = void;
+export type BrowserContextSetExtraHTTPHeadersParams = {
+ headers: NameValue[],
+};
+export type BrowserContextSetExtraHTTPHeadersOptions = {
+
+};
+export type BrowserContextSetExtraHTTPHeadersResult = void;
+export type BrowserContextSetGeolocationParams = {
+ geolocation?: {
+ longitude: number,
+ latitude: number,
+ accuracy?: number,
+ },
+};
+export type BrowserContextSetGeolocationOptions = {
+ geolocation?: {
+ longitude: number,
+ latitude: number,
+ accuracy?: number,
+ },
+};
+export type BrowserContextSetGeolocationResult = void;
+export type BrowserContextSetHTTPCredentialsParams = {
+ httpCredentials?: {
+ username: string,
+ password: string,
+ origin?: string,
+ },
+};
+export type BrowserContextSetHTTPCredentialsOptions = {
+ httpCredentials?: {
+ username: string,
+ password: string,
+ origin?: string,
+ },
+};
+export type BrowserContextSetHTTPCredentialsResult = void;
+export type BrowserContextSetNetworkInterceptionPatternsParams = {
+ patterns: {
+ glob?: string,
+ regexSource?: string,
+ regexFlags?: string,
+ urlPattern?: URLPattern,
+ }[],
+};
+export type BrowserContextSetNetworkInterceptionPatternsOptions = {
+
+};
+export type BrowserContextSetNetworkInterceptionPatternsResult = void;
+export type BrowserContextSetWebSocketInterceptionPatternsParams = {
+ patterns: {
+ glob?: string,
+ regexSource?: string,
+ regexFlags?: string,
+ urlPattern?: URLPattern,
+ }[],
+};
+export type BrowserContextSetWebSocketInterceptionPatternsOptions = {
+
+};
+export type BrowserContextSetWebSocketInterceptionPatternsResult = void;
+export type BrowserContextSetOfflineParams = {
+ offline: boolean,
+};
+export type BrowserContextSetOfflineOptions = {
+
+};
+export type BrowserContextSetOfflineResult = void;
+export type BrowserContextStorageStateParams = {
+ indexedDB?: boolean,
+};
+export type BrowserContextStorageStateOptions = {
+ indexedDB?: boolean,
+};
+export type BrowserContextStorageStateResult = {
+ cookies: NetworkCookie[],
+ origins: OriginStorage[],
+};
+export type BrowserContextSetStorageStateParams = {
+ storageState?: {
+ cookies?: SetNetworkCookie[],
+ origins?: SetOriginStorage[],
+ },
+};
+export type BrowserContextSetStorageStateOptions = {
+ storageState?: {
+ cookies?: SetNetworkCookie[],
+ origins?: SetOriginStorage[],
+ },
+};
+export type BrowserContextSetStorageStateResult = void;
+export type BrowserContextPauseParams = {};
+export type BrowserContextPauseOptions = {};
+export type BrowserContextPauseResult = void;
+export type BrowserContextEnableRecorderParams = {
+ language?: string,
+ mode?: 'inspecting' | 'recording',
+ recorderMode?: 'default' | 'api',
+ pauseOnNextStatement?: boolean,
+ testIdAttributeName?: string,
+ launchOptions?: any,
+ contextOptions?: any,
+ device?: string,
+ saveStorage?: string,
+ outputFile?: string,
+ handleSIGINT?: boolean,
+ omitCallTracking?: boolean,
+};
+export type BrowserContextEnableRecorderOptions = {
+ language?: string,
+ mode?: 'inspecting' | 'recording',
+ recorderMode?: 'default' | 'api',
+ pauseOnNextStatement?: boolean,
+ testIdAttributeName?: string,
+ launchOptions?: any,
+ contextOptions?: any,
+ device?: string,
+ saveStorage?: string,
+ outputFile?: string,
+ handleSIGINT?: boolean,
+ omitCallTracking?: boolean,
+};
+export type BrowserContextEnableRecorderResult = void;
+export type BrowserContextDisableRecorderParams = {};
+export type BrowserContextDisableRecorderOptions = {};
+export type BrowserContextDisableRecorderResult = void;
+export type BrowserContextExposeConsoleApiParams = {};
+export type BrowserContextExposeConsoleApiOptions = {};
+export type BrowserContextExposeConsoleApiResult = void;
+export type BrowserContextNewCDPSessionParams = {
+ page?: PageChannel,
+ frame?: FrameChannel,
+};
+export type BrowserContextNewCDPSessionOptions = {
+ page?: PageChannel,
+ frame?: FrameChannel,
+};
+export type BrowserContextNewCDPSessionResult = {
+ session: CDPSessionChannel,
+};
+export type BrowserContextCreateTempFilesParams = {
+ rootDirName?: string,
+ items: {
+ name: string,
+ lastModifiedMs?: number,
+ }[],
+};
+export type BrowserContextCreateTempFilesOptions = {
+ rootDirName?: string,
+};
+export type BrowserContextCreateTempFilesResult = {
+ rootDir?: WritableStreamChannel,
+ writableStreams: WritableStreamChannel[],
+};
+export type BrowserContextUpdateSubscriptionParams = {
+ event: 'console' | 'dialog' | 'request' | 'response' | 'requestFinished' | 'requestFailed',
+ enabled: boolean,
+};
+export type BrowserContextUpdateSubscriptionOptions = {
+
+};
+export type BrowserContextUpdateSubscriptionResult = void;
+export type BrowserContextClockFastForwardParams = {
+ ticksNumber?: number,
+ ticksString?: string,
+};
+export type BrowserContextClockFastForwardOptions = {
+ ticksNumber?: number,
+ ticksString?: string,
+};
+export type BrowserContextClockFastForwardResult = void;
+export type BrowserContextClockInstallParams = {
+ timeNumber?: number,
+ timeString?: string,
+};
+export type BrowserContextClockInstallOptions = {
+ timeNumber?: number,
+ timeString?: string,
+};
+export type BrowserContextClockInstallResult = void;
+export type BrowserContextClockPauseAtParams = {
+ timeNumber?: number,
+ timeString?: string,
+};
+export type BrowserContextClockPauseAtOptions = {
+ timeNumber?: number,
+ timeString?: string,
+};
+export type BrowserContextClockPauseAtResult = void;
+export type BrowserContextClockResumeParams = {};
+export type BrowserContextClockResumeOptions = {};
+export type BrowserContextClockResumeResult = void;
+export type BrowserContextClockRunForParams = {
+ ticksNumber?: number,
+ ticksString?: string,
+};
+export type BrowserContextClockRunForOptions = {
+ ticksNumber?: number,
+ ticksString?: string,
+};
+export type BrowserContextClockRunForResult = void;
+export type BrowserContextClockSetFixedTimeParams = {
+ timeNumber?: number,
+ timeString?: string,
+};
+export type BrowserContextClockSetFixedTimeOptions = {
+ timeNumber?: number,
+ timeString?: string,
+};
+export type BrowserContextClockSetFixedTimeResult = void;
+export type BrowserContextClockSetSystemTimeParams = {
+ timeNumber?: number,
+ timeString?: string,
+};
+export type BrowserContextClockSetSystemTimeOptions = {
+ timeNumber?: number,
+ timeString?: string,
+};
+export type BrowserContextClockSetSystemTimeResult = void;
+export type BrowserContextCredentialsInstallParams = {};
+export type BrowserContextCredentialsInstallOptions = {};
+export type BrowserContextCredentialsInstallResult = void;
+export type BrowserContextCredentialsCreateParams = {
+ rpId: string,
+ id?: string,
+ userHandle?: string,
+ privateKey?: string,
+ publicKey?: string,
+};
+export type BrowserContextCredentialsCreateOptions = {
+ id?: string,
+ userHandle?: string,
+ privateKey?: string,
+ publicKey?: string,
+};
+export type BrowserContextCredentialsCreateResult = {
+ credential: VirtualCredential,
+};
+export type BrowserContextCredentialsGetParams = {
+ rpId?: string,
+ id?: string,
+};
+export type BrowserContextCredentialsGetOptions = {
+ rpId?: string,
+ id?: string,
+};
+export type BrowserContextCredentialsGetResult = {
+ credentials: VirtualCredential[],
+};
+export type BrowserContextCredentialsDeleteParams = {
+ id: string,
+};
+export type BrowserContextCredentialsDeleteOptions = {
+
+};
+export type BrowserContextCredentialsDeleteResult = void;
+
+export interface BrowserContextEvents {
+ 'bindingCall': BrowserContextBindingCallEvent;
+ 'console': BrowserContextConsoleEvent;
+ 'close': BrowserContextCloseEvent;
+ 'dialog': BrowserContextDialogEvent;
+ 'page': BrowserContextPageEvent;
+ 'pageError': BrowserContextPageErrorEvent;
+ 'route': BrowserContextRouteEvent;
+ 'webSocketRoute': BrowserContextWebSocketRouteEvent;
+ 'serviceWorker': BrowserContextServiceWorkerEvent;
+ 'request': BrowserContextRequestEvent;
+ 'requestFailed': BrowserContextRequestFailedEvent;
+ 'requestFinished': BrowserContextRequestFinishedEvent;
+ 'response': BrowserContextResponseEvent;
+ 'recorderEvent': BrowserContextRecorderEventEvent;
+}
+
+// ----------- BrowserType -----------
+export type BrowserTypeInitializer = {
+ executablePath: string,
+ name: string,
+};
+export interface BrowserTypeEventTarget {
+}
+export interface BrowserTypeChannel extends BrowserTypeEventTarget, Channel {
+ _type_BrowserType: boolean;
+ launch(params: BrowserTypeLaunchParams, progress: Progress): Promise<BrowserTypeLaunchResult>;
+ launchPersistentContext(params: BrowserTypeLaunchPersistentContextParams, progress: Progress): Promise<BrowserTypeLaunchPersistentContextResult>;
+ connectOverCDP(params: BrowserTypeConnectOverCDPParams, progress: Progress): Promise<BrowserTypeConnectOverCDPResult>;
+ connectToWorker(params: BrowserTypeConnectToWorkerParams, progress: Progress): Promise<BrowserTypeConnectToWorkerResult>;
+}
+export type BrowserTypeLaunchParams = {
+ channel?: string,
+ executablePath?: string,
+ args?: string[],
+ ignoreAllDefaultArgs?: boolean,
+ ignoreDefaultArgs?: string[],
+ handleSIGINT?: boolean,
+ handleSIGTERM?: boolean,
+ handleSIGHUP?: boolean,
+ timeout: number,
+ env?: NameValue[],
+ headless?: boolean,
+ proxy?: {
+ server: string,
+ bypass?: string,
+ username?: string,
+ password?: string,
+ },
+ downloadsPath?: string,
+ tracesDir?: string,
+ artifactsDir?: string,
+ chromiumSandbox?: boolean,
+ firefoxUserPrefs?: any,
+ cdpPort?: number,
+ slowMo?: number,
+};
+export type BrowserTypeLaunchOptions = {
+ channel?: string,
+ executablePath?: string,
+ args?: string[],
+ ignoreAllDefaultArgs?: boolean,
+ ignoreDefaultArgs?: string[],
+ handleSIGINT?: boolean,
+ handleSIGTERM?: boolean,
+ handleSIGHUP?: boolean,
+ env?: NameValue[],
+ headless?: boolean,
+ proxy?: {
+ server: string,
+ bypass?: string,
+ username?: string,
+ password?: string,
+ },
+ downloadsPath?: string,
+ tracesDir?: string,
+ artifactsDir?: string,
+ chromiumSandbox?: boolean,
+ firefoxUserPrefs?: any,
+ cdpPort?: number,
+ slowMo?: number,
+};
+export type BrowserTypeLaunchResult = {
+ browser: BrowserChannel,
+};
+export type BrowserTypeLaunchPersistentContextParams = {
+ channel?: string,
+ executablePath?: string,
+ args?: string[],
+ ignoreAllDefaultArgs?: boolean,
+ ignoreDefaultArgs?: string[],
+ handleSIGINT?: boolean,
+ handleSIGTERM?: boolean,
+ handleSIGHUP?: boolean,
+ timeout: number,
+ env?: NameValue[],
+ headless?: boolean,
+ proxy?: {
+ server: string,
+ bypass?: string,
+ username?: string,
+ password?: string,
+ },
+ downloadsPath?: string,
+ tracesDir?: string,
+ artifactsDir?: string,
+ chromiumSandbox?: boolean,
+ firefoxUserPrefs?: any,
+ cdpPort?: number,
+ noDefaultViewport?: boolean,
+ viewport?: {
+ width: number,
+ height: number,
+ },
+ screen?: {
+ width: number,
+ height: number,
+ },
+ ignoreHTTPSErrors?: boolean,
+ clientCertificates?: {
+ origin: string,
+ cert?: Binary,
+ key?: Binary,
+ passphrase?: string,
+ pfx?: Binary,
+ }[],
+ javaScriptEnabled?: boolean,
+ bypassCSP?: boolean,
+ userAgent?: string,
+ locale?: string,
+ timezoneId?: string,
+ geolocation?: {
+ longitude: number,
+ latitude: number,
+ accuracy?: number,
+ },
+ permissions?: string[],
+ extraHTTPHeaders?: NameValue[],
+ offline?: boolean,
+ httpCredentials?: {
+ username: string,
+ password: string,
+ origin?: string,
+ send?: 'always' | 'unauthorized',
+ },
+ deviceScaleFactor?: number,
+ isMobile?: boolean,
+ hasTouch?: boolean,
+ colorScheme?: 'dark' | 'light' | 'no-preference' | 'no-override',
+ reducedMotion?: 'reduce' | 'no-preference' | 'no-override',
+ forcedColors?: 'active' | 'none' | 'no-override',
+ acceptDownloads?: 'accept' | 'deny' | 'internal-browser-default',
+ contrast?: 'no-preference' | 'more' | 'no-override',
+ baseURL?: string,
+ recordVideo?: {
+ dir?: string,
+ size?: {
+ width: number,
+ height: number,
+ },
+ showActions?: {
+ duration?: number,
+ position?: 'top-left' | 'top' | 'top-right' | 'bottom-left' | 'bottom' | 'bottom-right',
+ fontSize?: number,
+ cursor?: 'none' | 'pointer',
+ },
+ },
+ strictSelectors?: boolean,
+ serviceWorkers?: 'allow' | 'block',
+ selectorEngines?: SelectorEngine[],
+ testIdAttributeName?: string,
+ userDataDir: string,
+ slowMo?: number,
+};
+export type BrowserTypeLaunchPersistentContextOptions = {
+ channel?: string,
+ executablePath?: string,
+ args?: string[],
+ ignoreAllDefaultArgs?: boolean,
+ ignoreDefaultArgs?: string[],
+ handleSIGINT?: boolean,
+ handleSIGTERM?: boolean,
+ handleSIGHUP?: boolean,
+ env?: NameValue[],
+ headless?: boolean,
+ proxy?: {
+ server: string,
+ bypass?: string,
+ username?: string,
+ password?: string,
+ },
+ downloadsPath?: string,
+ tracesDir?: string,
+ artifactsDir?: string,
+ chromiumSandbox?: boolean,
+ firefoxUserPrefs?: any,
+ cdpPort?: number,
+ noDefaultViewport?: boolean,
+ viewport?: {
+ width: number,
+ height: number,
+ },
+ screen?: {
+ width: number,
+ height: number,
+ },
+ ignoreHTTPSErrors?: boolean,
+ clientCertificates?: {
+ origin: string,
+ cert?: Binary,
+ key?: Binary,
+ passphrase?: string,
+ pfx?: Binary,
+ }[],
+ javaScriptEnabled?: boolean,
+ bypassCSP?: boolean,
+ userAgent?: string,
+ locale?: string,
+ timezoneId?: string,
+ geolocation?: {
+ longitude: number,
+ latitude: number,
+ accuracy?: number,
+ },
+ permissions?: string[],
+ extraHTTPHeaders?: NameValue[],
+ offline?: boolean,
+ httpCredentials?: {
+ username: string,
+ password: string,
+ origin?: string,
+ send?: 'always' | 'unauthorized',
+ },
+ deviceScaleFactor?: number,
+ isMobile?: boolean,
+ hasTouch?: boolean,
+ colorScheme?: 'dark' | 'light' | 'no-preference' | 'no-override',
+ reducedMotion?: 'reduce' | 'no-preference' | 'no-override',
+ forcedColors?: 'active' | 'none' | 'no-override',
+ acceptDownloads?: 'accept' | 'deny' | 'internal-browser-default',
+ contrast?: 'no-preference' | 'more' | 'no-override',
+ baseURL?: string,
+ recordVideo?: {
+ dir?: string,
+ size?: {
+ width: number,
+ height: number,
+ },
+ showActions?: {
+ duration?: number,
+ position?: 'top-left' | 'top' | 'top-right' | 'bottom-left' | 'bottom' | 'bottom-right',
+ fontSize?: number,
+ cursor?: 'none' | 'pointer',
+ },
+ },
+ strictSelectors?: boolean,
+ serviceWorkers?: 'allow' | 'block',
+ selectorEngines?: SelectorEngine[],
+ testIdAttributeName?: string,
+ slowMo?: number,
+};
+export type BrowserTypeLaunchPersistentContextResult = {
+ browser: BrowserChannel,
+ context: BrowserContextChannel,
+};
+export type BrowserTypeConnectOverCDPParams = {
+ endpointURL?: string,
+ headers?: NameValue[],
+ slowMo?: number,
+ timeout: number,
+ isLocal?: boolean,
+ noDefaults?: boolean,
+ artifactsDir?: string,
+ transport?: Binary,
+};
+export type BrowserTypeConnectOverCDPOptions = {
+ endpointURL?: string,
+ headers?: NameValue[],
+ slowMo?: number,
+ isLocal?: boolean,
+ noDefaults?: boolean,
+ artifactsDir?: string,
+ transport?: Binary,
+};
+export type BrowserTypeConnectOverCDPResult = {
+ browser: BrowserChannel,
+ defaultContext?: BrowserContextChannel,
+};
+export type BrowserTypeConnectToWorkerParams = {
+ endpoint: string,
+ timeout: number,
+};
+export type BrowserTypeConnectToWorkerOptions = {
+
+};
+export type BrowserTypeConnectToWorkerResult = {
+ worker: WorkerChannel,
+};
+
+export interface BrowserTypeEvents {
+}
+
+export type Metadata = {
+ location?: {
+ file: string,
+ line?: number,
+ column?: number,
+ },
+ title?: string,
+ internal?: boolean,
+ stepId?: string,
+};
+
+export type ClientSideCallMetadata = {
+ id: number,
+ stack?: StackFrame[],
+};
+
+export type SDKLanguage = 'javascript' | 'python' | 'java' | 'csharp';
+// ----------- Disposable -----------
+export type DisposableInitializer = {};
+export interface DisposableEventTarget {
+}
+export interface DisposableChannel extends DisposableEventTarget, Channel {
+ _type_Disposable: boolean;
+ dispose(params: DisposableDisposeParams, progress: Progress): Promise<DisposableDisposeResult>;
+}
+export type DisposableDisposeParams = {};
+export type DisposableDisposeOptions = {};
+export type DisposableDisposeResult = void;
+
+export interface DisposableEvents {
+}
+
+export type WaitInfo = {
+ waitId: string,
+ phase: 'before' | 'after' | 'log',
+ event?: string,
+ message?: string,
+ error?: string,
+};
+
+// ----------- Electron -----------
+export type ElectronInitializer = {};
+export interface ElectronEventTarget {
+}
+export interface ElectronChannel extends ElectronEventTarget, Channel {
+ _type_Electron: boolean;
+ launch(params: ElectronLaunchParams, progress: Progress): Promise<ElectronLaunchResult>;
+}
+export type ElectronLaunchParams = {
+ executablePath?: string,
+ args?: string[],
+ chromiumSandbox?: boolean,
+ cwd?: string,
+ env?: NameValue[],
+ timeout: number,
+ acceptDownloads?: 'accept' | 'deny' | 'internal-browser-default',
+ bypassCSP?: boolean,
+ colorScheme?: 'dark' | 'light' | 'no-preference' | 'no-override',
+ extraHTTPHeaders?: NameValue[],
+ geolocation?: {
+ longitude: number,
+ latitude: number,
+ accuracy?: number,
+ },
+ httpCredentials?: {
+ username: string,
+ password: string,
+ origin?: string,
+ },
+ ignoreHTTPSErrors?: boolean,
+ locale?: string,
+ offline?: boolean,
+ recordVideo?: {
+ dir?: string,
+ size?: {
+ width: number,
+ height: number,
+ },
+ showActions?: {
+ duration?: number,
+ position?: 'top-left' | 'top' | 'top-right' | 'bottom-left' | 'bottom' | 'bottom-right',
+ fontSize?: number,
+ cursor?: 'none' | 'pointer',
+ },
+ },
+ strictSelectors?: boolean,
+ timezoneId?: string,
+ tracesDir?: string,
+ artifactsDir?: string,
+ selectorEngines?: SelectorEngine[],
+ testIdAttributeName?: string,
+};
+export type ElectronLaunchOptions = {
+ executablePath?: string,
+ args?: string[],
+ chromiumSandbox?: boolean,
+ cwd?: string,
+ env?: NameValue[],
+ acceptDownloads?: 'accept' | 'deny' | 'internal-browser-default',
+ bypassCSP?: boolean,
+ colorScheme?: 'dark' | 'light' | 'no-preference' | 'no-override',
+ extraHTTPHeaders?: NameValue[],
+ geolocation?: {
+ longitude: number,
+ latitude: number,
+ accuracy?: number,
+ },
+ httpCredentials?: {
+ username: string,
+ password: string,
+ origin?: string,
+ },
+ ignoreHTTPSErrors?: boolean,
+ locale?: string,
+ offline?: boolean,
+ recordVideo?: {
+ dir?: string,
+ size?: {
+ width: number,
+ height: number,
+ },
+ showActions?: {
+ duration?: number,
+ position?: 'top-left' | 'top' | 'top-right' | 'bottom-left' | 'bottom' | 'bottom-right',
+ fontSize?: number,
+ cursor?: 'none' | 'pointer',
+ },
+ },
+ strictSelectors?: boolean,
+ timezoneId?: string,
+ tracesDir?: string,
+ artifactsDir?: string,
+ selectorEngines?: SelectorEngine[],
+ testIdAttributeName?: string,
+};
+export type ElectronLaunchResult = {
+ electronApplication: ElectronApplicationChannel,
+};
+
+export interface ElectronEvents {
+}
+
+// ----------- ElectronApplication -----------
+export type ElectronApplicationInitializer = {
+ context: BrowserContextChannel,
+};
+export interface ElectronApplicationEventTarget {
+ _dispatchEvent(event: 'close', params?: ElectronApplicationCloseEvent): void;
+ _dispatchEvent(event: 'console', params?: ElectronApplicationConsoleEvent): void;
+}
+export interface ElectronApplicationChannel extends ElectronApplicationEventTarget, Channel {
+ _type_ElectronApplication: boolean;
+ browserWindow(params: ElectronApplicationBrowserWindowParams, progress: Progress): Promise<ElectronApplicationBrowserWindowResult>;
+ evaluateExpression(params: ElectronApplicationEvaluateExpressionParams, progress: Progress): Promise<ElectronApplicationEvaluateExpressionResult>;
+ evaluateExpressionHandle(params: ElectronApplicationEvaluateExpressionHandleParams, progress: Progress): Promise<ElectronApplicationEvaluateExpressionHandleResult>;
+ updateSubscription(params: ElectronApplicationUpdateSubscriptionParams, progress: Progress): Promise<ElectronApplicationUpdateSubscriptionResult>;
+}
+export type ElectronApplicationCloseEvent = {};
+export type ElectronApplicationConsoleEvent = {
+ type: string,
+ text: string,
+ args: JSHandleChannel[],
+ location: {
+ url: string,
+ lineNumber: number,
+ columnNumber: number,
+ },
+ timestamp: number,
+};
+export type ElectronApplicationBrowserWindowParams = {
+ page: PageChannel,
+};
+export type ElectronApplicationBrowserWindowOptions = {
+
+};
+export type ElectronApplicationBrowserWindowResult = {
+ handle: JSHandleChannel,
+};
+export type ElectronApplicationEvaluateExpressionParams = {
+ expression: string,
+ isFunction?: boolean,
+ arg: SerializedArgument,
+};
+export type ElectronApplicationEvaluateExpressionOptions = {
+ isFunction?: boolean,
+};
+export type ElectronApplicationEvaluateExpressionResult = {
+ value: SerializedValue,
+};
+export type ElectronApplicationEvaluateExpressionHandleParams = {
+ expression: string,
+ isFunction?: boolean,
+ arg: SerializedArgument,
+};
+export type ElectronApplicationEvaluateExpressionHandleOptions = {
+ isFunction?: boolean,
+};
+export type ElectronApplicationEvaluateExpressionHandleResult = {
+ handle: JSHandleChannel,
+};
+export type ElectronApplicationUpdateSubscriptionParams = {
+ event: 'console',
+ enabled: boolean,
+};
+export type ElectronApplicationUpdateSubscriptionOptions = {
+
+};
+export type ElectronApplicationUpdateSubscriptionResult = void;
+
+export interface ElectronApplicationEvents {
+ 'close': ElectronApplicationCloseEvent;
+ 'console': ElectronApplicationConsoleEvent;
+}
+
+// ----------- Frame -----------
+export type FrameInitializer = {
+ url: string,
+ name: string,
+ parentFrame?: FrameChannel,
+ loadStates: LifecycleEvent[],
+};
+export interface FrameEventTarget {
+ _dispatchEvent(event: 'loadstate', params?: FrameLoadstateEvent): void;
+ _dispatchEvent(event: 'navigated', params?: FrameNavigatedEvent): void;
+}
+export interface FrameChannel extends FrameEventTarget, Channel {
+ _type_Frame: boolean;
+ evalOnSelector(params: FrameEvalOnSelectorParams, progress: Progress): Promise<FrameEvalOnSelectorResult>;
+ evalOnSelectorAll(params: FrameEvalOnSelectorAllParams, progress: Progress): Promise<FrameEvalOnSelectorAllResult>;
+ addScriptTag(params: FrameAddScriptTagParams, progress: Progress): Promise<FrameAddScriptTagResult>;
+ addStyleTag(params: FrameAddStyleTagParams, progress: Progress): Promise<FrameAddStyleTagResult>;
+ ariaSnapshot(params: FrameAriaSnapshotParams, progress: Progress): Promise<FrameAriaSnapshotResult>;
+ blur(params: FrameBlurParams, progress: Progress): Promise<FrameBlurResult>;
+ check(params: FrameCheckParams, progress: Progress): Promise<FrameCheckResult>;
+ click(params: FrameClickParams, progress: Progress): Promise<FrameClickResult>;
+ content(params: FrameContentParams, progress: Progress): Promise<FrameContentResult>;
+ dragAndDrop(params: FrameDragAndDropParams, progress: Progress): Promise<FrameDragAndDropResult>;
+ drop(params: FrameDropParams, progress: Progress): Promise<FrameDropResult>;
+ dblclick(params: FrameDblclickParams, progress: Progress): Promise<FrameDblclickResult>;
+ dispatchEvent(params: FrameDispatchEventParams, progress: Progress): Promise<FrameDispatchEventResult>;
+ evaluateExpression(params: FrameEvaluateExpressionParams, progress: Progress): Promise<FrameEvaluateExpressionResult>;
+ evaluateExpressionHandle(params: FrameEvaluateExpressionHandleParams, progress: Progress): Promise<FrameEvaluateExpressionHandleResult>;
+ fill(params: FrameFillParams, progress: Progress): Promise<FrameFillResult>;
+ focus(params: FrameFocusParams, progress: Progress): Promise<FrameFocusResult>;
+ frameElement(params: FrameFrameElementParams, progress: Progress): Promise<FrameFrameElementResult>;
+ resolveSelector(params: FrameResolveSelectorParams, progress: Progress): Promise<FrameResolveSelectorResult>;
+ highlight(params: FrameHighlightParams, progress: Progress): Promise<FrameHighlightResult>;
+ hideHighlight(params: FrameHideHighlightParams, progress: Progress): Promise<FrameHideHighlightResult>;
+ getAttribute(params: FrameGetAttributeParams, progress: Progress): Promise<FrameGetAttributeResult>;
+ goto(params: FrameGotoParams, progress: Progress): Promise<FrameGotoResult>;
+ hover(params: FrameHoverParams, progress: Progress): Promise<FrameHoverResult>;
+ innerHTML(params: FrameInnerHTMLParams, progress: Progress): Promise<FrameInnerHTMLResult>;
+ innerText(params: FrameInnerTextParams, progress: Progress): Promise<FrameInnerTextResult>;
+ inputValue(params: FrameInputValueParams, progress: Progress): Promise<FrameInputValueResult>;
+ isChecked(params: FrameIsCheckedParams, progress: Progress): Promise<FrameIsCheckedResult>;
+ isDisabled(params: FrameIsDisabledParams, progress: Progress): Promise<FrameIsDisabledResult>;
+ isEnabled(params: FrameIsEnabledParams, progress: Progress): Promise<FrameIsEnabledResult>;
+ isHidden(params: FrameIsHiddenParams, progress: Progress): Promise<FrameIsHiddenResult>;
+ isVisible(params: FrameIsVisibleParams, progress: Progress): Promise<FrameIsVisibleResult>;
+ isEditable(params: FrameIsEditableParams, progress: Progress): Promise<FrameIsEditableResult>;
+ press(params: FramePressParams, progress: Progress): Promise<FramePressResult>;
+ querySelector(params: FrameQuerySelectorParams, progress: Progress): Promise<FrameQuerySelectorResult>;
+ querySelectorAll(params: FrameQuerySelectorAllParams, progress: Progress): Promise<FrameQuerySelectorAllResult>;
+ queryCount(params: FrameQueryCountParams, progress: Progress): Promise<FrameQueryCountResult>;
+ selectOption(params: FrameSelectOptionParams, progress: Progress): Promise<FrameSelectOptionResult>;
+ setContent(params: FrameSetContentParams, progress: Progress): Promise<FrameSetContentResult>;
+ setInputFiles(params: FrameSetInputFilesParams, progress: Progress): Promise<FrameSetInputFilesResult>;
+ tap(params: FrameTapParams, progress: Progress): Promise<FrameTapResult>;
+ textContent(params: FrameTextContentParams, progress: Progress): Promise<FrameTextContentResult>;
+ title(params: FrameTitleParams, progress: Progress): Promise<FrameTitleResult>;
+ type(params: FrameTypeParams, progress: Progress): Promise<FrameTypeResult>;
+ uncheck(params: FrameUncheckParams, progress: Progress): Promise<FrameUncheckResult>;
+ waitForTimeout(params: FrameWaitForTimeoutParams, progress: Progress): Promise<FrameWaitForTimeoutResult>;
+ waitForFunction(params: FrameWaitForFunctionParams, progress: Progress): Promise<FrameWaitForFunctionResult>;
+ waitForSelector(params: FrameWaitForSelectorParams, progress: Progress): Promise<FrameWaitForSelectorResult>;
+ expect(params: FrameExpectParams, progress: Progress): Promise<FrameExpectResult>;
+}
+export type FrameLoadstateEvent = {
+ add?: LifecycleEvent,
+ remove?: LifecycleEvent,
+};
+export type FrameNavigatedEvent = {
+ url: string,
+ name: string,
+ newDocument?: {
+ request?: RequestChannel,
+ },
+ error?: string,
+};
+export type FrameEvalOnSelectorParams = {
+ selector: string,
+ strict?: boolean,
+ expression: string,
+ isFunction?: boolean,
+ arg: SerializedArgument,
+};
+export type FrameEvalOnSelectorOptions = {
+ strict?: boolean,
+ isFunction?: boolean,
+};
+export type FrameEvalOnSelectorResult = {
+ value: SerializedValue,
+};
+export type FrameEvalOnSelectorAllParams = {
+ selector: string,
+ expression: string,
+ isFunction?: boolean,
+ arg: SerializedArgument,
+};
+export type FrameEvalOnSelectorAllOptions = {
+ isFunction?: boolean,
+};
+export type FrameEvalOnSelectorAllResult = {
+ value: SerializedValue,
+};
+export type FrameAddScriptTagParams = {
+ url?: string,
+ content?: string,
+ type?: string,
+};
+export type FrameAddScriptTagOptions = {
+ url?: string,
+ content?: string,
+ type?: string,
+};
+export type FrameAddScriptTagResult = {
+ element: ElementHandleChannel,
+};
+export type FrameAddStyleTagParams = {
+ url?: string,
+ content?: string,
+};
+export type FrameAddStyleTagOptions = {
+ url?: string,
+ content?: string,
+};
+export type FrameAddStyleTagResult = {
+ element: ElementHandleChannel,
+};
+export type FrameAriaSnapshotParams = {
+ mode?: 'ai' | 'default',
+ track?: string,
+ selector?: string,
+ depth?: number,
+ boxes?: boolean,
+ timeout: number,
+};
+export type FrameAriaSnapshotOptions = {
+ mode?: 'ai' | 'default',
+ track?: string,
+ selector?: string,
+ depth?: number,
+ boxes?: boolean,
+};
+export type FrameAriaSnapshotResult = {
+ snapshot: string,
+};
+export type FrameBlurParams = {
+ selector: string,
+ strict?: boolean,
+ timeout: number,
+};
+export type FrameBlurOptions = {
+ strict?: boolean,
+};
+export type FrameBlurResult = void;
+export type FrameCheckParams = {
+ selector: string,
+ strict?: boolean,
+ force?: boolean,
+ position?: Point,
+ timeout: number,
+ trial?: boolean,
+};
+export type FrameCheckOptions = {
+ strict?: boolean,
+ force?: boolean,
+ position?: Point,
+ trial?: boolean,
+};
+export type FrameCheckResult = void;
+export type FrameClickParams = {
+ selector: string,
+ strict?: boolean,
+ force?: boolean,
+ noWaitAfter?: boolean,
+ modifiers?: ('Alt' | 'Control' | 'ControlOrMeta' | 'Meta' | 'Shift')[],
+ position?: Point,
+ delay?: number,
+ button?: 'left' | 'right' | 'middle',
+ clickCount?: number,
+ timeout: number,
+ trial?: boolean,
+ steps?: number,
+};
+export type FrameClickOptions = {
+ strict?: boolean,
+ force?: boolean,
+ noWaitAfter?: boolean,
+ modifiers?: ('Alt' | 'Control' | 'ControlOrMeta' | 'Meta' | 'Shift')[],
+ position?: Point,
+ delay?: number,
+ button?: 'left' | 'right' | 'middle',
+ clickCount?: number,
+ trial?: boolean,
+ steps?: number,
+};
+export type FrameClickResult = void;
+export type FrameContentParams = {};
+export type FrameContentOptions = {};
+export type FrameContentResult = {
+ value: string,
+};
+export type FrameDragAndDropParams = {
+ source: string,
+ target: string,
+ force?: boolean,
+ timeout: number,
+ trial?: boolean,
+ sourcePosition?: Point,
+ targetPosition?: Point,
+ strict?: boolean,
+ steps?: number,
+};
+export type FrameDragAndDropOptions = {
+ force?: boolean,
+ trial?: boolean,
+ sourcePosition?: Point,
+ targetPosition?: Point,
+ strict?: boolean,
+ steps?: number,
+};
+export type FrameDragAndDropResult = void;
+export type FrameDropParams = {
+ selector: string,
+ strict?: boolean,
+ position?: Point,
+ payloads?: {
+ name: string,
+ mimeType?: string,
+ buffer: Binary,
+ }[],
+ localPaths?: string[],
+ streams?: WritableStreamChannel[],
+ data?: {
+ mimeType: string,
+ value: string,
+ }[],
+ timeout: number,
+};
+export type FrameDropOptions = {
+ strict?: boolean,
+ position?: Point,
+ payloads?: {
+ name: string,
+ mimeType?: string,
+ buffer: Binary,
+ }[],
+ localPaths?: string[],
+ streams?: WritableStreamChannel[],
+ data?: {
+ mimeType: string,
+ value: string,
+ }[],
+};
+export type FrameDropResult = void;
+export type FrameDblclickParams = {
+ selector: string,
+ strict?: boolean,
+ force?: boolean,
+ modifiers?: ('Alt' | 'Control' | 'ControlOrMeta' | 'Meta' | 'Shift')[],
+ position?: Point,
+ delay?: number,
+ button?: 'left' | 'right' | 'middle',
+ timeout: number,
+ trial?: boolean,
+ steps?: number,
+};
+export type FrameDblclickOptions = {
+ strict?: boolean,
+ force?: boolean,
+ modifiers?: ('Alt' | 'Control' | 'ControlOrMeta' | 'Meta' | 'Shift')[],
+ position?: Point,
+ delay?: number,
+ button?: 'left' | 'right' | 'middle',
+ trial?: boolean,
+ steps?: number,
+};
+export type FrameDblclickResult = void;
+export type FrameDispatchEventParams = {
+ selector: string,
+ strict?: boolean,
+ type: string,
+ eventInit: SerializedArgument,
+ timeout: number,
+};
+export type FrameDispatchEventOptions = {
+ strict?: boolean,
+};
+export type FrameDispatchEventResult = void;
+export type FrameEvaluateExpressionParams = {
+ expression: string,
+ isFunction?: boolean,
+ arg: SerializedArgument,
+};
+export type FrameEvaluateExpressionOptions = {
+ isFunction?: boolean,
+};
+export type FrameEvaluateExpressionResult = {
+ value: SerializedValue,
+};
+export type FrameEvaluateExpressionHandleParams = {
+ expression: string,
+ isFunction?: boolean,
+ arg: SerializedArgument,
+};
+export type FrameEvaluateExpressionHandleOptions = {
+ isFunction?: boolean,
+};
+export type FrameEvaluateExpressionHandleResult = {
+ handle: JSHandleChannel,
+};
+export type FrameFillParams = {
+ selector: string,
+ strict?: boolean,
+ value: string,
+ force?: boolean,
+ timeout: number,
+};
+export type FrameFillOptions = {
+ strict?: boolean,
+ force?: boolean,
+};
+export type FrameFillResult = void;
+export type FrameFocusParams = {
+ selector: string,
+ strict?: boolean,
+ timeout: number,
+};
+export type FrameFocusOptions = {
+ strict?: boolean,
+};
+export type FrameFocusResult = void;
+export type FrameFrameElementParams = {};
+export type FrameFrameElementOptions = {};
+export type FrameFrameElementResult = {
+ element: ElementHandleChannel,
+};
+export type FrameResolveSelectorParams = {
+ selector: string,
+};
+export type FrameResolveSelectorOptions = {
+
+};
+export type FrameResolveSelectorResult = {
+ resolvedSelector: string,
+};
+export type FrameHighlightParams = {
+ selector: string,
+ style?: string,
+};
+export type FrameHighlightOptions = {
+ style?: string,
+};
+export type FrameHighlightResult = void;
+export type FrameHideHighlightParams = {
+ selector: string,
+};
+export type FrameHideHighlightOptions = {
+
+};
+export type FrameHideHighlightResult = void;
+export type FrameGetAttributeParams = {
+ selector: string,
+ strict?: boolean,
+ name: string,
+ timeout: number,
+};
+export type FrameGetAttributeOptions = {
+ strict?: boolean,
+};
+export type FrameGetAttributeResult = {
+ value?: string,
+};
+export type FrameGotoParams = {
+ url: string,
+ timeout: number,
+ waitUntil?: LifecycleEvent,
+ referer?: string,
+};
+export type FrameGotoOptions = {
+ waitUntil?: LifecycleEvent,
+ referer?: string,
+};
+export type FrameGotoResult = {
+ response?: ResponseChannel,
+};
+export type FrameHoverParams = {
+ selector: string,
+ strict?: boolean,
+ force?: boolean,
+ modifiers?: ('Alt' | 'Control' | 'ControlOrMeta' | 'Meta' | 'Shift')[],
+ position?: Point,
+ timeout: number,
+ trial?: boolean,
+};
+export type FrameHoverOptions = {
+ strict?: boolean,
+ force?: boolean,
+ modifiers?: ('Alt' | 'Control' | 'ControlOrMeta' | 'Meta' | 'Shift')[],
+ position?: Point,
+ trial?: boolean,
+};
+export type FrameHoverResult = void;
+export type FrameInnerHTMLParams = {
+ selector: string,
+ strict?: boolean,
+ timeout: number,
+};
+export type FrameInnerHTMLOptions = {
+ strict?: boolean,
+};
+export type FrameInnerHTMLResult = {
+ value: string,
+};
+export type FrameInnerTextParams = {
+ selector: string,
+ strict?: boolean,
+ timeout: number,
+};
+export type FrameInnerTextOptions = {
+ strict?: boolean,
+};
+export type FrameInnerTextResult = {
+ value: string,
+};
+export type FrameInputValueParams = {
+ selector: string,
+ strict?: boolean,
+ timeout: number,
+};
+export type FrameInputValueOptions = {
+ strict?: boolean,
+};
+export type FrameInputValueResult = {
+ value: string,
+};
+export type FrameIsCheckedParams = {
+ selector: string,
+ strict?: boolean,
+ timeout: number,
+};
+export type FrameIsCheckedOptions = {
+ strict?: boolean,
+};
+export type FrameIsCheckedResult = {
+ value: boolean,
+};
+export type FrameIsDisabledParams = {
+ selector: string,
+ strict?: boolean,
+ timeout: number,
+};
+export type FrameIsDisabledOptions = {
+ strict?: boolean,
+};
+export type FrameIsDisabledResult = {
+ value: boolean,
+};
+export type FrameIsEnabledParams = {
+ selector: string,
+ strict?: boolean,
+ timeout: number,
+};
+export type FrameIsEnabledOptions = {
+ strict?: boolean,
+};
+export type FrameIsEnabledResult = {
+ value: boolean,
+};
+export type FrameIsHiddenParams = {
+ selector: string,
+ strict?: boolean,
+};
+export type FrameIsHiddenOptions = {
+ strict?: boolean,
+};
+export type FrameIsHiddenResult = {
+ value: boolean,
+};
+export type FrameIsVisibleParams = {
+ selector: string,
+ strict?: boolean,
+};
+export type FrameIsVisibleOptions = {
+ strict?: boolean,
+};
+export type FrameIsVisibleResult = {
+ value: boolean,
+};
+export type FrameIsEditableParams = {
+ selector: string,
+ strict?: boolean,
+ timeout: number,
+};
+export type FrameIsEditableOptions = {
+ strict?: boolean,
+};
+export type FrameIsEditableResult = {
+ value: boolean,
+};
+export type FramePressParams = {
+ selector: string,
+ strict?: boolean,
+ key: string,
+ delay?: number,
+ noWaitAfter?: boolean,
+ timeout: number,
+};
+export type FramePressOptions = {
+ strict?: boolean,
+ delay?: number,
+ noWaitAfter?: boolean,
+};
+export type FramePressResult = void;
+export type FrameQuerySelectorParams = {
+ selector: string,
+ strict?: boolean,
+};
+export type FrameQuerySelectorOptions = {
+ strict?: boolean,
+};
+export type FrameQuerySelectorResult = {
+ element?: ElementHandleChannel,
+};
+export type FrameQuerySelectorAllParams = {
+ selector: string,
+};
+export type FrameQuerySelectorAllOptions = {
+
+};
+export type FrameQuerySelectorAllResult = {
+ elements: ElementHandleChannel[],
+};
+export type FrameQueryCountParams = {
+ selector: string,
+};
+export type FrameQueryCountOptions = {
+
+};
+export type FrameQueryCountResult = {
+ value: number,
+};
+export type FrameSelectOptionParams = {
+ selector: string,
+ strict?: boolean,
+ elements?: ElementHandleChannel[],
+ options?: {
+ valueOrLabel?: string,
+ value?: string,
+ label?: string,
+ index?: number,
+ }[],
+ force?: boolean,
+ timeout: number,
+};
+export type FrameSelectOptionOptions = {
+ strict?: boolean,
+ elements?: ElementHandleChannel[],
+ options?: {
+ valueOrLabel?: string,
+ value?: string,
+ label?: string,
+ index?: number,
+ }[],
+ force?: boolean,
+};
+export type FrameSelectOptionResult = {
+ values: string[],
+};
+export type FrameSetContentParams = {
+ html: string,
+ timeout: number,
+ waitUntil?: LifecycleEvent,
+};
+export type FrameSetContentOptions = {
+ waitUntil?: LifecycleEvent,
+};
+export type FrameSetContentResult = void;
+export type FrameSetInputFilesParams = {
+ selector: string,
+ strict?: boolean,
+ payloads?: {
+ name: string,
+ mimeType?: string,
+ buffer: Binary,
+ }[],
+ localDirectory?: string,
+ directoryStream?: WritableStreamChannel,
+ localPaths?: string[],
+ streams?: WritableStreamChannel[],
+ timeout: number,
+};
+export type FrameSetInputFilesOptions = {
+ strict?: boolean,
+ payloads?: {
+ name: string,
+ mimeType?: string,
+ buffer: Binary,
+ }[],
+ localDirectory?: string,
+ directoryStream?: WritableStreamChannel,
+ localPaths?: string[],
+ streams?: WritableStreamChannel[],
+};
+export type FrameSetInputFilesResult = void;
+export type FrameTapParams = {
+ selector: string,
+ strict?: boolean,
+ force?: boolean,
+ modifiers?: ('Alt' | 'Control' | 'ControlOrMeta' | 'Meta' | 'Shift')[],
+ position?: Point,
+ timeout: number,
+ trial?: boolean,
+};
+export type FrameTapOptions = {
+ strict?: boolean,
+ force?: boolean,
+ modifiers?: ('Alt' | 'Control' | 'ControlOrMeta' | 'Meta' | 'Shift')[],
+ position?: Point,
+ trial?: boolean,
+};
+export type FrameTapResult = void;
+export type FrameTextContentParams = {
+ selector: string,
+ strict?: boolean,
+ timeout: number,
+};
+export type FrameTextContentOptions = {
+ strict?: boolean,
+};
+export type FrameTextContentResult = {
+ value?: string,
+};
+export type FrameTitleParams = {};
+export type FrameTitleOptions = {};
+export type FrameTitleResult = {
+ value: string,
+};
+export type FrameTypeParams = {
+ selector: string,
+ strict?: boolean,
+ text: string,
+ delay?: number,
+ timeout: number,
+};
+export type FrameTypeOptions = {
+ strict?: boolean,
+ delay?: number,
+};
+export type FrameTypeResult = void;
+export type FrameUncheckParams = {
+ selector: string,
+ strict?: boolean,
+ force?: boolean,
+ position?: Point,
+ timeout: number,
+ trial?: boolean,
+};
+export type FrameUncheckOptions = {
+ strict?: boolean,
+ force?: boolean,
+ position?: Point,
+ trial?: boolean,
+};
+export type FrameUncheckResult = void;
+export type FrameWaitForTimeoutParams = {
+ waitTimeout: number,
+};
+export type FrameWaitForTimeoutOptions = {
+
+};
+export type FrameWaitForTimeoutResult = void;
+export type FrameWaitForFunctionParams = {
+ expression: string,
+ isFunction?: boolean,
+ arg: SerializedArgument,
+ timeout: number,
+ pollingInterval?: number,
+};
+export type FrameWaitForFunctionOptions = {
+ isFunction?: boolean,
+ pollingInterval?: number,
+};
+export type FrameWaitForFunctionResult = {
+ handle: JSHandleChannel,
+};
+export type FrameWaitForSelectorParams = {
+ selector: string,
+ strict?: boolean,
+ timeout: number,
+ state?: 'attached' | 'detached' | 'visible' | 'hidden',
+ omitReturnValue?: boolean,
+};
+export type FrameWaitForSelectorOptions = {
+ strict?: boolean,
+ state?: 'attached' | 'detached' | 'visible' | 'hidden',
+ omitReturnValue?: boolean,
+};
+export type FrameWaitForSelectorResult = {
+ element?: ElementHandleChannel,
+};
+export type FrameExpectParams = {
+ selector?: string,
+ expression: string,
+ expressionArg?: any,
+ pseudo?: 'before' | 'after',
+ expectedText?: ExpectedTextValue[],
+ expectedNumber?: number,
+ expectedValue?: SerializedArgument,
+ useInnerText?: boolean,
+ isNot: boolean,
+ timeout: number,
+};
+export type FrameExpectOptions = {
+ selector?: string,
+ expressionArg?: any,
+ pseudo?: 'before' | 'after',
+ expectedText?: ExpectedTextValue[],
+ expectedNumber?: number,
+ expectedValue?: SerializedArgument,
+ useInnerText?: boolean,
+};
+export type FrameExpectResult = void;
+export type FrameExpectErrorDetails = {
+ received?: {
+ value?: SerializedValue,
+ ariaSnapshot?: string,
+ },
+ timedOut?: boolean,
+ customErrorMessage?: string,
+};
+
+export interface FrameEvents {
+ 'loadstate': FrameLoadstateEvent;
+ 'navigated': FrameNavigatedEvent;
+}
+
+// ----------- JSHandle -----------
+export type JSHandleInitializer = {
+ preview: string,
+};
+export interface JSHandleEventTarget {
+ _dispatchEvent(event: 'previewUpdated', params?: JSHandlePreviewUpdatedEvent): void;
+}
+export interface JSHandleChannel extends JSHandleEventTarget, Channel {
+ _type_JSHandle: boolean;
+ dispose(params: JSHandleDisposeParams, progress: Progress): Promise<JSHandleDisposeResult>;
+ evaluateExpression(params: JSHandleEvaluateExpressionParams, progress: Progress): Promise<JSHandleEvaluateExpressionResult>;
+ evaluateExpressionHandle(params: JSHandleEvaluateExpressionHandleParams, progress: Progress): Promise<JSHandleEvaluateExpressionHandleResult>;
+ getPropertyList(params: JSHandleGetPropertyListParams, progress: Progress): Promise<JSHandleGetPropertyListResult>;
+ getProperty(params: JSHandleGetPropertyParams, progress: Progress): Promise<JSHandleGetPropertyResult>;
+ jsonValue(params: JSHandleJsonValueParams, progress: Progress): Promise<JSHandleJsonValueResult>;
+}
+export type JSHandlePreviewUpdatedEvent = {
+ preview: string,
+};
+export type JSHandleDisposeParams = {};
+export type JSHandleDisposeOptions = {};
+export type JSHandleDisposeResult = void;
+export type JSHandleEvaluateExpressionParams = {
+ expression: string,
+ isFunction?: boolean,
+ arg: SerializedArgument,
+};
+export type JSHandleEvaluateExpressionOptions = {
+ isFunction?: boolean,
+};
+export type JSHandleEvaluateExpressionResult = {
+ value: SerializedValue,
+};
+export type JSHandleEvaluateExpressionHandleParams = {
+ expression: string,
+ isFunction?: boolean,
+ arg: SerializedArgument,
+};
+export type JSHandleEvaluateExpressionHandleOptions = {
+ isFunction?: boolean,
+};
+export type JSHandleEvaluateExpressionHandleResult = {
+ handle: JSHandleChannel,
+};
+export type JSHandleGetPropertyListParams = {};
+export type JSHandleGetPropertyListOptions = {};
+export type JSHandleGetPropertyListResult = {
+ properties: {
+ name: string,
+ value: JSHandleChannel,
+ }[],
+};
+export type JSHandleGetPropertyParams = {
+ name: string,
+};
+export type JSHandleGetPropertyOptions = {
+
+};
+export type JSHandleGetPropertyResult = {
+ handle: JSHandleChannel,
+};
+export type JSHandleJsonValueParams = {};
+export type JSHandleJsonValueOptions = {};
+export type JSHandleJsonValueResult = {
+ value: SerializedValue,
+};
+
+export interface JSHandleEvents {
+ 'previewUpdated': JSHandlePreviewUpdatedEvent;
+}
+
+// ----------- ElementHandle -----------
+export type ElementHandleInitializer = {};
+export interface ElementHandleEventTarget {
+}
+export interface ElementHandleChannel extends ElementHandleEventTarget, JSHandleChannel {
+ _type_ElementHandle: boolean;
+ evalOnSelector(params: ElementHandleEvalOnSelectorParams, progress: Progress): Promise<ElementHandleEvalOnSelectorResult>;
+ evalOnSelectorAll(params: ElementHandleEvalOnSelectorAllParams, progress: Progress): Promise<ElementHandleEvalOnSelectorAllResult>;
+ boundingBox(params: ElementHandleBoundingBoxParams, progress: Progress): Promise<ElementHandleBoundingBoxResult>;
+ check(params: ElementHandleCheckParams, progress: Progress): Promise<ElementHandleCheckResult>;
+ click(params: ElementHandleClickParams, progress: Progress): Promise<ElementHandleClickResult>;
+ contentFrame(params: ElementHandleContentFrameParams, progress: Progress): Promise<ElementHandleContentFrameResult>;
+ dblclick(params: ElementHandleDblclickParams, progress: Progress): Promise<ElementHandleDblclickResult>;
+ dispatchEvent(params: ElementHandleDispatchEventParams, progress: Progress): Promise<ElementHandleDispatchEventResult>;
+ fill(params: ElementHandleFillParams, progress: Progress): Promise<ElementHandleFillResult>;
+ focus(params: ElementHandleFocusParams, progress: Progress): Promise<ElementHandleFocusResult>;
+ getAttribute(params: ElementHandleGetAttributeParams, progress: Progress): Promise<ElementHandleGetAttributeResult>;
+ hover(params: ElementHandleHoverParams, progress: Progress): Promise<ElementHandleHoverResult>;
+ innerHTML(params: ElementHandleInnerHTMLParams, progress: Progress): Promise<ElementHandleInnerHTMLResult>;
+ innerText(params: ElementHandleInnerTextParams, progress: Progress): Promise<ElementHandleInnerTextResult>;
+ inputValue(params: ElementHandleInputValueParams, progress: Progress): Promise<ElementHandleInputValueResult>;
+ isChecked(params: ElementHandleIsCheckedParams, progress: Progress): Promise<ElementHandleIsCheckedResult>;
+ isDisabled(params: ElementHandleIsDisabledParams, progress: Progress): Promise<ElementHandleIsDisabledResult>;
+ isEditable(params: ElementHandleIsEditableParams, progress: Progress): Promise<ElementHandleIsEditableResult>;
+ isEnabled(params: ElementHandleIsEnabledParams, progress: Progress): Promise<ElementHandleIsEnabledResult>;
+ isHidden(params: ElementHandleIsHiddenParams, progress: Progress): Promise<ElementHandleIsHiddenResult>;
+ isVisible(params: ElementHandleIsVisibleParams, progress: Progress): Promise<ElementHandleIsVisibleResult>;
+ ownerFrame(params: ElementHandleOwnerFrameParams, progress: Progress): Promise<ElementHandleOwnerFrameResult>;
+ press(params: ElementHandlePressParams, progress: Progress): Promise<ElementHandlePressResult>;
+ querySelector(params: ElementHandleQuerySelectorParams, progress: Progress): Promise<ElementHandleQuerySelectorResult>;
+ querySelectorAll(params: ElementHandleQuerySelectorAllParams, progress: Progress): Promise<ElementHandleQuerySelectorAllResult>;
+ screenshot(params: ElementHandleScreenshotParams, progress: Progress): Promise<ElementHandleScreenshotResult>;
+ scrollIntoViewIfNeeded(params: ElementHandleScrollIntoViewIfNeededParams, progress: Progress): Promise<ElementHandleScrollIntoViewIfNeededResult>;
+ selectOption(params: ElementHandleSelectOptionParams, progress: Progress): Promise<ElementHandleSelectOptionResult>;
+ selectText(params: ElementHandleSelectTextParams, progress: Progress): Promise<ElementHandleSelectTextResult>;
+ setInputFiles(params: ElementHandleSetInputFilesParams, progress: Progress): Promise<ElementHandleSetInputFilesResult>;
+ tap(params: ElementHandleTapParams, progress: Progress): Promise<ElementHandleTapResult>;
+ textContent(params: ElementHandleTextContentParams, progress: Progress): Promise<ElementHandleTextContentResult>;
+ type(params: ElementHandleTypeParams, progress: Progress): Promise<ElementHandleTypeResult>;
+ uncheck(params: ElementHandleUncheckParams, progress: Progress): Promise<ElementHandleUncheckResult>;
+ waitForElementState(params: ElementHandleWaitForElementStateParams, progress: Progress): Promise<ElementHandleWaitForElementStateResult>;
+ waitForSelector(params: ElementHandleWaitForSelectorParams, progress: Progress): Promise<ElementHandleWaitForSelectorResult>;
+}
+export type ElementHandleEvalOnSelectorParams = {
+ selector: string,
+ strict?: boolean,
+ expression: string,
+ isFunction?: boolean,
+ arg: SerializedArgument,
+};
+export type ElementHandleEvalOnSelectorOptions = {
+ strict?: boolean,
+ isFunction?: boolean,
+};
+export type ElementHandleEvalOnSelectorResult = {
+ value: SerializedValue,
+};
+export type ElementHandleEvalOnSelectorAllParams = {
+ selector: string,
+ expression: string,
+ isFunction?: boolean,
+ arg: SerializedArgument,
+};
+export type ElementHandleEvalOnSelectorAllOptions = {
+ isFunction?: boolean,
+};
+export type ElementHandleEvalOnSelectorAllResult = {
+ value: SerializedValue,
+};
+export type ElementHandleBoundingBoxParams = {};
+export type ElementHandleBoundingBoxOptions = {};
+export type ElementHandleBoundingBoxResult = {
+ value?: Rect,
+};
+export type ElementHandleCheckParams = {
+ force?: boolean,
+ position?: Point,
+ timeout: number,
+ trial?: boolean,
+};
+export type ElementHandleCheckOptions = {
+ force?: boolean,
+ position?: Point,
+ trial?: boolean,
+};
+export type ElementHandleCheckResult = void;
+export type ElementHandleClickParams = {
+ force?: boolean,
+ noWaitAfter?: boolean,
+ modifiers?: ('Alt' | 'Control' | 'ControlOrMeta' | 'Meta' | 'Shift')[],
+ position?: Point,
+ delay?: number,
+ button?: 'left' | 'right' | 'middle',
+ clickCount?: number,
+ timeout: number,
+ trial?: boolean,
+ steps?: number,
+};
+export type ElementHandleClickOptions = {
+ force?: boolean,
+ noWaitAfter?: boolean,
+ modifiers?: ('Alt' | 'Control' | 'ControlOrMeta' | 'Meta' | 'Shift')[],
+ position?: Point,
+ delay?: number,
+ button?: 'left' | 'right' | 'middle',
+ clickCount?: number,
+ trial?: boolean,
+ steps?: number,
+};
+export type ElementHandleClickResult = void;
+export type ElementHandleContentFrameParams = {};
+export type ElementHandleContentFrameOptions = {};
+export type ElementHandleContentFrameResult = {
+ frame?: FrameChannel,
+};
+export type ElementHandleDblclickParams = {
+ force?: boolean,
+ modifiers?: ('Alt' | 'Control' | 'ControlOrMeta' | 'Meta' | 'Shift')[],
+ position?: Point,
+ delay?: number,
+ button?: 'left' | 'right' | 'middle',
+ timeout: number,
+ trial?: boolean,
+ steps?: number,
+};
+export type ElementHandleDblclickOptions = {
+ force?: boolean,
+ modifiers?: ('Alt' | 'Control' | 'ControlOrMeta' | 'Meta' | 'Shift')[],
+ position?: Point,
+ delay?: number,
+ button?: 'left' | 'right' | 'middle',
+ trial?: boolean,
+ steps?: number,
+};
+export type ElementHandleDblclickResult = void;
+export type ElementHandleDispatchEventParams = {
+ type: string,
+ eventInit: SerializedArgument,
+};
+export type ElementHandleDispatchEventOptions = {
+
+};
+export type ElementHandleDispatchEventResult = void;
+export type ElementHandleFillParams = {
+ value: string,
+ force?: boolean,
+ timeout: number,
+};
+export type ElementHandleFillOptions = {
+ force?: boolean,
+};
+export type ElementHandleFillResult = void;
+export type ElementHandleFocusParams = {};
+export type ElementHandleFocusOptions = {};
+export type ElementHandleFocusResult = void;
+export type ElementHandleGetAttributeParams = {
+ name: string,
+};
+export type ElementHandleGetAttributeOptions = {
+
+};
+export type ElementHandleGetAttributeResult = {
+ value?: string,
+};
+export type ElementHandleHoverParams = {
+ force?: boolean,
+ modifiers?: ('Alt' | 'Control' | 'ControlOrMeta' | 'Meta' | 'Shift')[],
+ position?: Point,
+ timeout: number,
+ trial?: boolean,
+};
+export type ElementHandleHoverOptions = {
+ force?: boolean,
+ modifiers?: ('Alt' | 'Control' | 'ControlOrMeta' | 'Meta' | 'Shift')[],
+ position?: Point,
+ trial?: boolean,
+};
+export type ElementHandleHoverResult = void;
+export type ElementHandleInnerHTMLParams = {};
+export type ElementHandleInnerHTMLOptions = {};
+export type ElementHandleInnerHTMLResult = {
+ value: string,
+};
+export type ElementHandleInnerTextParams = {};
+export type ElementHandleInnerTextOptions = {};
+export type ElementHandleInnerTextResult = {
+ value: string,
+};
+export type ElementHandleInputValueParams = {};
+export type ElementHandleInputValueOptions = {};
+export type ElementHandleInputValueResult = {
+ value: string,
+};
+export type ElementHandleIsCheckedParams = {};
+export type ElementHandleIsCheckedOptions = {};
+export type ElementHandleIsCheckedResult = {
+ value: boolean,
+};
+export type ElementHandleIsDisabledParams = {};
+export type ElementHandleIsDisabledOptions = {};
+export type ElementHandleIsDisabledResult = {
+ value: boolean,
+};
+export type ElementHandleIsEditableParams = {};
+export type ElementHandleIsEditableOptions = {};
+export type ElementHandleIsEditableResult = {
+ value: boolean,
+};
+export type ElementHandleIsEnabledParams = {};
+export type ElementHandleIsEnabledOptions = {};
+export type ElementHandleIsEnabledResult = {
+ value: boolean,
+};
+export type ElementHandleIsHiddenParams = {};
+export type ElementHandleIsHiddenOptions = {};
+export type ElementHandleIsHiddenResult = {
+ value: boolean,
+};
+export type ElementHandleIsVisibleParams = {};
+export type ElementHandleIsVisibleOptions = {};
+export type ElementHandleIsVisibleResult = {
+ value: boolean,
+};
+export type ElementHandleOwnerFrameParams = {};
+export type ElementHandleOwnerFrameOptions = {};
+export type ElementHandleOwnerFrameResult = {
+ frame?: FrameChannel,
+};
+export type ElementHandlePressParams = {
+ key: string,
+ delay?: number,
+ timeout: number,
+ noWaitAfter?: boolean,
+};
+export type ElementHandlePressOptions = {
+ delay?: number,
+ noWaitAfter?: boolean,
+};
+export type ElementHandlePressResult = void;
+export type ElementHandleQuerySelectorParams = {
+ selector: string,
+ strict?: boolean,
+};
+export type ElementHandleQuerySelectorOptions = {
+ strict?: boolean,
+};
+export type ElementHandleQuerySelectorResult = {
+ element?: ElementHandleChannel,
+};
+export type ElementHandleQuerySelectorAllParams = {
+ selector: string,
+};
+export type ElementHandleQuerySelectorAllOptions = {
+
+};
+export type ElementHandleQuerySelectorAllResult = {
+ elements: ElementHandleChannel[],
+};
+export type ElementHandleScreenshotParams = {
+ timeout: number,
+ type?: 'png' | 'jpeg',
+ quality?: number,
+ omitBackground?: boolean,
+ caret?: 'hide' | 'initial',
+ animations?: 'disabled' | 'allow',
+ scale?: 'css' | 'device',
+ mask?: {
+ frame: FrameChannel,
+ selector: string,
+ }[],
+ maskColor?: string,
+ style?: string,
+};
+export type ElementHandleScreenshotOptions = {
+ type?: 'png' | 'jpeg',
+ quality?: number,
+ omitBackground?: boolean,
+ caret?: 'hide' | 'initial',
+ animations?: 'disabled' | 'allow',
+ scale?: 'css' | 'device',
+ mask?: {
+ frame: FrameChannel,
+ selector: string,
+ }[],
+ maskColor?: string,
+ style?: string,
+};
+export type ElementHandleScreenshotResult = {
+ binary: Binary,
+};
+export type ElementHandleScrollIntoViewIfNeededParams = {
+ timeout: number,
+};
+export type ElementHandleScrollIntoViewIfNeededOptions = {
+
+};
+export type ElementHandleScrollIntoViewIfNeededResult = void;
+export type ElementHandleSelectOptionParams = {
+ elements?: ElementHandleChannel[],
+ options?: {
+ valueOrLabel?: string,
+ value?: string,
+ label?: string,
+ index?: number,
+ }[],
+ force?: boolean,
+ timeout: number,
+};
+export type ElementHandleSelectOptionOptions = {
+ elements?: ElementHandleChannel[],
+ options?: {
+ valueOrLabel?: string,
+ value?: string,
+ label?: string,
+ index?: number,
+ }[],
+ force?: boolean,
+};
+export type ElementHandleSelectOptionResult = {
+ values: string[],
+};
+export type ElementHandleSelectTextParams = {
+ force?: boolean,
+ timeout: number,
+};
+export type ElementHandleSelectTextOptions = {
+ force?: boolean,
+};
+export type ElementHandleSelectTextResult = void;
+export type ElementHandleSetInputFilesParams = {
+ payloads?: {
+ name: string,
+ mimeType?: string,
+ buffer: Binary,
+ }[],
+ localDirectory?: string,
+ directoryStream?: WritableStreamChannel,
+ localPaths?: string[],
+ streams?: WritableStreamChannel[],
+ timeout: number,
+};
+export type ElementHandleSetInputFilesOptions = {
+ payloads?: {
+ name: string,
+ mimeType?: string,
+ buffer: Binary,
+ }[],
+ localDirectory?: string,
+ directoryStream?: WritableStreamChannel,
+ localPaths?: string[],
+ streams?: WritableStreamChannel[],
+};
+export type ElementHandleSetInputFilesResult = void;
+export type ElementHandleTapParams = {
+ force?: boolean,
+ modifiers?: ('Alt' | 'Control' | 'ControlOrMeta' | 'Meta' | 'Shift')[],
+ position?: Point,
+ timeout: number,
+ trial?: boolean,
+};
+export type ElementHandleTapOptions = {
+ force?: boolean,
+ modifiers?: ('Alt' | 'Control' | 'ControlOrMeta' | 'Meta' | 'Shift')[],
+ position?: Point,
+ trial?: boolean,
+};
+export type ElementHandleTapResult = void;
+export type ElementHandleTextContentParams = {};
+export type ElementHandleTextContentOptions = {};
+export type ElementHandleTextContentResult = {
+ value?: string,
+};
+export type ElementHandleTypeParams = {
+ text: string,
+ delay?: number,
+ timeout: number,
+};
+export type ElementHandleTypeOptions = {
+ delay?: number,
+};
+export type ElementHandleTypeResult = void;
+export type ElementHandleUncheckParams = {
+ force?: boolean,
+ position?: Point,
+ timeout: number,
+ trial?: boolean,
+};
+export type ElementHandleUncheckOptions = {
+ force?: boolean,
+ position?: Point,
+ trial?: boolean,
+};
+export type ElementHandleUncheckResult = void;
+export type ElementHandleWaitForElementStateParams = {
+ state: 'visible' | 'hidden' | 'stable' | 'enabled' | 'disabled' | 'editable',
+ timeout: number,
+};
+export type ElementHandleWaitForElementStateOptions = {
+
+};
+export type ElementHandleWaitForElementStateResult = void;
+export type ElementHandleWaitForSelectorParams = {
+ selector: string,
+ strict?: boolean,
+ timeout: number,
+ state?: 'attached' | 'detached' | 'visible' | 'hidden',
+};
+export type ElementHandleWaitForSelectorOptions = {
+ strict?: boolean,
+ state?: 'attached' | 'detached' | 'visible' | 'hidden',
+};
+export type ElementHandleWaitForSelectorResult = {
+ element?: ElementHandleChannel,
+};
+
+export interface ElementHandleEvents {
+}
+
+// ----------- LocalUtils -----------
+export type LocalUtilsInitializer = {
+ deviceDescriptors: {
+ name: string,
+ descriptor: {
+ userAgent: string,
+ viewport: {
+ width: number,
+ height: number,
+ },
+ screen?: {
+ width: number,
+ height: number,
+ },
+ deviceScaleFactor: number,
+ isMobile: boolean,
+ hasTouch: boolean,
+ defaultBrowserType: 'chromium' | 'firefox' | 'webkit',
+ },
+ }[],
+};
+export interface LocalUtilsEventTarget {
+}
+export interface LocalUtilsChannel extends LocalUtilsEventTarget, Channel {
+ _type_LocalUtils: boolean;
+ zip(params: LocalUtilsZipParams, progress: Progress): Promise<LocalUtilsZipResult>;
+ harOpen(params: LocalUtilsHarOpenParams, progress: Progress): Promise<LocalUtilsHarOpenResult>;
+ harLookup(params: LocalUtilsHarLookupParams, progress: Progress): Promise<LocalUtilsHarLookupResult>;
+ harClose(params: LocalUtilsHarCloseParams, progress: Progress): Promise<LocalUtilsHarCloseResult>;
+ harUnzip(params: LocalUtilsHarUnzipParams, progress: Progress): Promise<LocalUtilsHarUnzipResult>;
+ connect(params: LocalUtilsConnectParams, progress: Progress): Promise<LocalUtilsConnectResult>;
+ tracingStarted(params: LocalUtilsTracingStartedParams, progress: Progress): Promise<LocalUtilsTracingStartedResult>;
+ addStackToTracingNoReply(params: LocalUtilsAddStackToTracingNoReplyParams, progress: Progress): Promise<LocalUtilsAddStackToTracingNoReplyResult>;
+ traceDiscarded(params: LocalUtilsTraceDiscardedParams, progress: Progress): Promise<LocalUtilsTraceDiscardedResult>;
+ globToRegex(params: LocalUtilsGlobToRegexParams, progress: Progress): Promise<LocalUtilsGlobToRegexResult>;
+}
+export type LocalUtilsZipParams = {
+ zipFile: string,
+ entries: NameValue[],
+ stacksId?: string,
+ mode: 'write' | 'append',
+ includeSources: boolean,
+ additionalSources?: string[],
+};
+export type LocalUtilsZipOptions = {
+ stacksId?: string,
+ additionalSources?: string[],
+};
+export type LocalUtilsZipResult = void;
+export type LocalUtilsHarOpenParams = {
+ file: string,
+};
+export type LocalUtilsHarOpenOptions = {
+
+};
+export type LocalUtilsHarOpenResult = {
+ harId?: string,
+ error?: string,
+};
+export type LocalUtilsHarLookupParams = {
+ harId: string,
+ url: string,
+ method: string,
+ headers: NameValue[],
+ postData?: Binary,
+ isNavigationRequest: boolean,
+};
+export type LocalUtilsHarLookupOptions = {
+ postData?: Binary,
+};
+export type LocalUtilsHarLookupResult = {
+ action: 'error' | 'redirect' | 'fulfill' | 'noentry',
+ message?: string,
+ redirectURL?: string,
+ status?: number,
+ headers?: NameValue[],
+ body?: Binary,
+};
+export type LocalUtilsHarCloseParams = {
+ harId: string,
+};
+export type LocalUtilsHarCloseOptions = {
+
+};
+export type LocalUtilsHarCloseResult = void;
+export type LocalUtilsHarUnzipParams = {
+ zipFile: string,
+ harFile: string,
+ resourcesDir?: string,
+};
+export type LocalUtilsHarUnzipOptions = {
+ resourcesDir?: string,
+};
+export type LocalUtilsHarUnzipResult = void;
+export type LocalUtilsConnectParams = {
+ endpoint: string,
+ headers?: any,
+ exposeNetwork?: string,
+ slowMo?: number,
+ timeout: number,
+ socksProxyRedirectPortForTest?: number,
+};
+export type LocalUtilsConnectOptions = {
+ headers?: any,
+ exposeNetwork?: string,
+ slowMo?: number,
+ socksProxyRedirectPortForTest?: number,
+};
+export type LocalUtilsConnectResult = {
+ pipe: JsonPipeChannel,
+ headers: NameValue[],
+};
+export type LocalUtilsTracingStartedParams = {
+ tracesDir?: string,
+ traceName: string,
+ live?: boolean,
+};
+export type LocalUtilsTracingStartedOptions = {
+ tracesDir?: string,
+ live?: boolean,
+};
+export type LocalUtilsTracingStartedResult = {
+ stacksId: string,
+};
+export type LocalUtilsAddStackToTracingNoReplyParams = {
+ callData: ClientSideCallMetadata,
+};
+export type LocalUtilsAddStackToTracingNoReplyOptions = {
+
+};
+export type LocalUtilsAddStackToTracingNoReplyResult = void;
+export type LocalUtilsTraceDiscardedParams = {
+ stacksId: string,
+};
+export type LocalUtilsTraceDiscardedOptions = {
+
+};
+export type LocalUtilsTraceDiscardedResult = void;
+export type LocalUtilsGlobToRegexParams = {
+ glob: string,
+ baseURL?: string,
+ webSocketUrl?: boolean,
+};
+export type LocalUtilsGlobToRegexOptions = {
+ baseURL?: string,
+ webSocketUrl?: boolean,
+};
+export type LocalUtilsGlobToRegexResult = {
+ regex: string,
+};
+
+export interface LocalUtilsEvents {
+}
+
+export type SetNetworkCookie = {
+ name: string,
+ value: string,
+ url?: string,
+ domain?: string,
+ path?: string,
+ expires?: number,
+ httpOnly?: boolean,
+ secure?: boolean,
+ sameSite?: 'Strict' | 'Lax' | 'None',
+ partitionKey?: string,
+ _crHasCrossSiteAncestor?: boolean,
+};
+
+export type NetworkCookie = {
+ name: string,
+ value: string,
+ domain: string,
+ path: string,
+ expires: number,
+ httpOnly: boolean,
+ secure: boolean,
+ sameSite: 'Strict' | 'Lax' | 'None',
+ partitionKey?: string,
+ _crHasCrossSiteAncestor?: boolean,
+};
+
+// ----------- Request -----------
+export type RequestInitializer = {
+ frame?: FrameChannel,
+ serviceWorker?: WorkerChannel,
+ url: string,
+ resourceType: string,
+ method: string,
+ postData?: Binary,
+ headers: NameValue[],
+ isNavigationRequest: boolean,
+ redirectedFrom?: RequestChannel,
+};
+export interface RequestEventTarget {
+}
+export interface RequestChannel extends RequestEventTarget, Channel {
+ _type_Request: boolean;
+ response(params: RequestResponseParams, progress: Progress): Promise<RequestResponseResult>;
+ rawRequestHeaders(params: RequestRawRequestHeadersParams, progress: Progress): Promise<RequestRawRequestHeadersResult>;
+}
+export type RequestResponseParams = {};
+export type RequestResponseOptions = {};
+export type RequestResponseResult = {
+ response?: ResponseChannel,
+};
+export type RequestRawRequestHeadersParams = {};
+export type RequestRawRequestHeadersOptions = {};
+export type RequestRawRequestHeadersResult = {
+ headers: NameValue[],
+};
+
+export interface RequestEvents {
+}
+
+// ----------- Route -----------
+export type RouteInitializer = {
+ request: RequestChannel,
+};
+export interface RouteEventTarget {
+}
+export interface RouteChannel extends RouteEventTarget, Channel {
+ _type_Route: boolean;
+ redirectNavigationRequest(params: RouteRedirectNavigationRequestParams, progress: Progress): Promise<RouteRedirectNavigationRequestResult>;
+ abort(params: RouteAbortParams, progress: Progress): Promise<RouteAbortResult>;
+ continue(params: RouteContinueParams, progress: Progress): Promise<RouteContinueResult>;
+ fulfill(params: RouteFulfillParams, progress: Progress): Promise<RouteFulfillResult>;
+}
+export type RouteRedirectNavigationRequestParams = {
+ url: string,
+};
+export type RouteRedirectNavigationRequestOptions = {
+
+};
+export type RouteRedirectNavigationRequestResult = void;
+export type RouteAbortParams = {
+ errorCode?: string,
+};
+export type RouteAbortOptions = {
+ errorCode?: string,
+};
+export type RouteAbortResult = void;
+export type RouteContinueParams = {
+ url?: string,
+ method?: string,
+ headers?: NameValue[],
+ postData?: Binary,
+ isFallback: boolean,
+};
+export type RouteContinueOptions = {
+ url?: string,
+ method?: string,
+ headers?: NameValue[],
+ postData?: Binary,
+};
+export type RouteContinueResult = void;
+export type RouteFulfillParams = {
+ status?: number,
+ headers?: NameValue[],
+ body?: string,
+ isBase64?: boolean,
+ fetchResponseUid?: string,
+};
+export type RouteFulfillOptions = {
+ status?: number,
+ headers?: NameValue[],
+ body?: string,
+ isBase64?: boolean,
+ fetchResponseUid?: string,
+};
+export type RouteFulfillResult = void;
+
+export interface RouteEvents {
+}
+
+// ----------- WebSocketRoute -----------
+export type WebSocketRouteInitializer = {
+ url: string,
+ protocols: string[],
+};
+export interface WebSocketRouteEventTarget {
+ _dispatchEvent(event: 'messageFromPage', params?: WebSocketRouteMessageFromPageEvent): void;
+ _dispatchEvent(event: 'messageFromServer', params?: WebSocketRouteMessageFromServerEvent): void;
+ _dispatchEvent(event: 'closePage', params?: WebSocketRouteClosePageEvent): void;
+ _dispatchEvent(event: 'closeServer', params?: WebSocketRouteCloseServerEvent): void;
+}
+export interface WebSocketRouteChannel extends WebSocketRouteEventTarget, Channel {
+ _type_WebSocketRoute: boolean;
+ connect(params: WebSocketRouteConnectParams, progress: Progress): Promise<WebSocketRouteConnectResult>;
+ ensureOpened(params: WebSocketRouteEnsureOpenedParams, progress: Progress): Promise<WebSocketRouteEnsureOpenedResult>;
+ sendToPage(params: WebSocketRouteSendToPageParams, progress: Progress): Promise<WebSocketRouteSendToPageResult>;
+ sendToServer(params: WebSocketRouteSendToServerParams, progress: Progress): Promise<WebSocketRouteSendToServerResult>;
+ closePage(params: WebSocketRouteClosePageParams, progress: Progress): Promise<WebSocketRouteClosePageResult>;
+ closeServer(params: WebSocketRouteCloseServerParams, progress: Progress): Promise<WebSocketRouteCloseServerResult>;
+}
+export type WebSocketRouteMessageFromPageEvent = {
+ message: string,
+ isBase64: boolean,
+};
+export type WebSocketRouteMessageFromServerEvent = {
+ message: string,
+ isBase64: boolean,
+};
+export type WebSocketRouteClosePageEvent = {
+ code?: number,
+ reason?: string,
+ wasClean: boolean,
+};
+export type WebSocketRouteCloseServerEvent = {
+ code?: number,
+ reason?: string,
+ wasClean: boolean,
+};
+export type WebSocketRouteConnectParams = {};
+export type WebSocketRouteConnectOptions = {};
+export type WebSocketRouteConnectResult = void;
+export type WebSocketRouteEnsureOpenedParams = {};
+export type WebSocketRouteEnsureOpenedOptions = {};
+export type WebSocketRouteEnsureOpenedResult = void;
+export type WebSocketRouteSendToPageParams = {
+ message: string,
+ isBase64: boolean,
+};
+export type WebSocketRouteSendToPageOptions = {
+
+};
+export type WebSocketRouteSendToPageResult = void;
+export type WebSocketRouteSendToServerParams = {
+ message: string,
+ isBase64: boolean,
+};
+export type WebSocketRouteSendToServerOptions = {
+
+};
+export type WebSocketRouteSendToServerResult = void;
+export type WebSocketRouteClosePageParams = {
+ code?: number,
+ reason?: string,
+ wasClean: boolean,
+};
+export type WebSocketRouteClosePageOptions = {
+ code?: number,
+ reason?: string,
+};
+export type WebSocketRouteClosePageResult = void;
+export type WebSocketRouteCloseServerParams = {
+ code?: number,
+ reason?: string,
+ wasClean: boolean,
+};
+export type WebSocketRouteCloseServerOptions = {
+ code?: number,
+ reason?: string,
+};
+export type WebSocketRouteCloseServerResult = void;
+
+export interface WebSocketRouteEvents {
+ 'messageFromPage': WebSocketRouteMessageFromPageEvent;
+ 'messageFromServer': WebSocketRouteMessageFromServerEvent;
+ 'closePage': WebSocketRouteClosePageEvent;
+ 'closeServer': WebSocketRouteCloseServerEvent;
+}
+
+export type ResourceTiming = {
+ startTime: number,
+ domainLookupStart: number,
+ domainLookupEnd: number,
+ connectStart: number,
+ secureConnectionStart: number,
+ connectEnd: number,
+ requestStart: number,
+ responseStart: number,
+};
+
+// ----------- Response -----------
+export type ResponseInitializer = {
+ request: RequestChannel,
+ url: string,
+ status: number,
+ statusText: string,
+ headers: NameValue[],
+ timing: ResourceTiming,
+ fromServiceWorker: boolean,
+};
+export interface ResponseEventTarget {
+}
+export interface ResponseChannel extends ResponseEventTarget, Channel {
+ _type_Response: boolean;
+ body(params: ResponseBodyParams, progress: Progress): Promise<ResponseBodyResult>;
+ securityDetails(params: ResponseSecurityDetailsParams, progress: Progress): Promise<ResponseSecurityDetailsResult>;
+ serverAddr(params: ResponseServerAddrParams, progress: Progress): Promise<ResponseServerAddrResult>;
+ rawResponseHeaders(params: ResponseRawResponseHeadersParams, progress: Progress): Promise<ResponseRawResponseHeadersResult>;
+ httpVersion(params: ResponseHttpVersionParams, progress: Progress): Promise<ResponseHttpVersionResult>;
+ sizes(params: ResponseSizesParams, progress: Progress): Promise<ResponseSizesResult>;
+}
+export type ResponseBodyParams = {};
+export type ResponseBodyOptions = {};
+export type ResponseBodyResult = {
+ binary: Binary,
+};
+export type ResponseSecurityDetailsParams = {};
+export type ResponseSecurityDetailsOptions = {};
+export type ResponseSecurityDetailsResult = {
+ value?: SecurityDetails,
+};
+export type ResponseServerAddrParams = {};
+export type ResponseServerAddrOptions = {};
+export type ResponseServerAddrResult = {
+ value?: RemoteAddr,
+};
+export type ResponseRawResponseHeadersParams = {};
+export type ResponseRawResponseHeadersOptions = {};
+export type ResponseRawResponseHeadersResult = {
+ headers: NameValue[],
+};
+export type ResponseHttpVersionParams = {};
+export type ResponseHttpVersionOptions = {};
+export type ResponseHttpVersionResult = {
+ value: string,
+};
+export type ResponseSizesParams = {};
+export type ResponseSizesOptions = {};
+export type ResponseSizesResult = {
+ sizes: RequestSizes,
+};
+
+export interface ResponseEvents {
+}
+
+export type SecurityDetails = {
+ issuer?: string,
+ protocol?: string,
+ subjectName?: string,
+ validFrom?: number,
+ validTo?: number,
+};
+
+export type RequestSizes = {
+ requestBodySize: number,
+ requestHeadersSize: number,
+ responseBodySize: number,
+ responseHeadersSize: number,
+};
+
+export type RemoteAddr = {
+ ipAddress: string,
+ port: number,
+};
+
+// ----------- WebSocket -----------
+export type WebSocketInitializer = {
+ url: string,
+};
+export interface WebSocketEventTarget {
+ _dispatchEvent(event: 'open', params?: WebSocketOpenEvent): void;
+ _dispatchEvent(event: 'frameSent', params?: WebSocketFrameSentEvent): void;
+ _dispatchEvent(event: 'frameReceived', params?: WebSocketFrameReceivedEvent): void;
+ _dispatchEvent(event: 'socketError', params?: WebSocketSocketErrorEvent): void;
+ _dispatchEvent(event: 'close', params?: WebSocketCloseEvent): void;
+}
+export interface WebSocketChannel extends WebSocketEventTarget, Channel {
+ _type_WebSocket: boolean;
+}
+export type WebSocketOpenEvent = {};
+export type WebSocketFrameSentEvent = {
+ opcode: number,
+ data: string,
+};
+export type WebSocketFrameReceivedEvent = {
+ opcode: number,
+ data: string,
+};
+export type WebSocketSocketErrorEvent = {
+ error: string,
+};
+export type WebSocketCloseEvent = {};
+
+export interface WebSocketEvents {
+ 'open': WebSocketOpenEvent;
+ 'frameSent': WebSocketFrameSentEvent;
+ 'frameReceived': WebSocketFrameReceivedEvent;
+ 'socketError': WebSocketSocketErrorEvent;
+ 'close': WebSocketCloseEvent;
+}
+
+// ----------- Page -----------
+export type PageInitializer = {
+ mainFrame: FrameChannel,
+ viewportSize?: {
+ width: number,
+ height: number,
+ },
+ isClosed: boolean,
+ opener?: PageChannel,
+ video?: ArtifactChannel,
+};
+export interface PageEventTarget {
+ _dispatchEvent(event: 'bindingCall', params?: PageBindingCallEvent): void;
+ _dispatchEvent(event: 'close', params?: PageCloseEvent): void;
+ _dispatchEvent(event: 'crash', params?: PageCrashEvent): void;
+ _dispatchEvent(event: 'download', params?: PageDownloadEvent): void;
+ _dispatchEvent(event: 'viewportSizeChanged', params?: PageViewportSizeChangedEvent): void;
+ _dispatchEvent(event: 'fileChooser', params?: PageFileChooserEvent): void;
+ _dispatchEvent(event: 'frameAttached', params?: PageFrameAttachedEvent): void;
+ _dispatchEvent(event: 'frameDetached', params?: PageFrameDetachedEvent): void;
+ _dispatchEvent(event: 'locatorHandlerTriggered', params?: PageLocatorHandlerTriggeredEvent): void;
+ _dispatchEvent(event: 'route', params?: PageRouteEvent): void;
+ _dispatchEvent(event: 'screencastFrame', params?: PageScreencastFrameEvent): void;
+ _dispatchEvent(event: 'webSocketRoute', params?: PageWebSocketRouteEvent): void;
+ _dispatchEvent(event: 'webSocket', params?: PageWebSocketEvent): void;
+ _dispatchEvent(event: 'worker', params?: PageWorkerEvent): void;
+}
+export interface PageChannel extends PageEventTarget, Channel {
+ _type_Page: boolean;
+ addInitScript(params: PageAddInitScriptParams, progress: Progress): Promise<PageAddInitScriptResult>;
+ close(params: PageCloseParams, progress: Progress): Promise<PageCloseResult>;
+ runBeforeUnload(params: PageRunBeforeUnloadParams, progress: Progress): Promise<PageRunBeforeUnloadResult>;
+ clearConsoleMessages(params: PageClearConsoleMessagesParams, progress: Progress): Promise<PageClearConsoleMessagesResult>;
+ consoleMessages(params: PageConsoleMessagesParams, progress: Progress): Promise<PageConsoleMessagesResult>;
+ emulateMedia(params: PageEmulateMediaParams, progress: Progress): Promise<PageEmulateMediaResult>;
+ exposeBinding(params: PageExposeBindingParams, progress: Progress): Promise<PageExposeBindingResult>;
+ goBack(params: PageGoBackParams, progress: Progress): Promise<PageGoBackResult>;
+ goForward(params: PageGoForwardParams, progress: Progress): Promise<PageGoForwardResult>;
+ requestGC(params: PageRequestGCParams, progress: Progress): Promise<PageRequestGCResult>;
+ registerLocatorHandler(params: PageRegisterLocatorHandlerParams, progress: Progress): Promise<PageRegisterLocatorHandlerResult>;
+ resolveLocatorHandlerNoReply(params: PageResolveLocatorHandlerNoReplyParams, progress: Progress): Promise<PageResolveLocatorHandlerNoReplyResult>;
+ unregisterLocatorHandler(params: PageUnregisterLocatorHandlerParams, progress: Progress): Promise<PageUnregisterLocatorHandlerResult>;
+ reload(params: PageReloadParams, progress: Progress): Promise<PageReloadResult>;
+ expectScreenshot(params: PageExpectScreenshotParams, progress: Progress): Promise<PageExpectScreenshotResult>;
+ screenshot(params: PageScreenshotParams, progress: Progress): Promise<PageScreenshotResult>;
+ setExtraHTTPHeaders(params: PageSetExtraHTTPHeadersParams, progress: Progress): Promise<PageSetExtraHTTPHeadersResult>;
+ setNetworkInterceptionPatterns(params: PageSetNetworkInterceptionPatternsParams, progress: Progress): Promise<PageSetNetworkInterceptionPatternsResult>;
+ setWebSocketInterceptionPatterns(params: PageSetWebSocketInterceptionPatternsParams, progress: Progress): Promise<PageSetWebSocketInterceptionPatternsResult>;
+ setViewportSize(params: PageSetViewportSizeParams, progress: Progress): Promise<PageSetViewportSizeResult>;
+ keyboardDown(params: PageKeyboardDownParams, progress: Progress): Promise<PageKeyboardDownResult>;
+ keyboardUp(params: PageKeyboardUpParams, progress: Progress): Promise<PageKeyboardUpResult>;
+ keyboardInsertText(params: PageKeyboardInsertTextParams, progress: Progress): Promise<PageKeyboardInsertTextResult>;
+ keyboardType(params: PageKeyboardTypeParams, progress: Progress): Promise<PageKeyboardTypeResult>;
+ keyboardPress(params: PageKeyboardPressParams, progress: Progress): Promise<PageKeyboardPressResult>;
+ mouseMove(params: PageMouseMoveParams, progress: Progress): Promise<PageMouseMoveResult>;
+ mouseDown(params: PageMouseDownParams, progress: Progress): Promise<PageMouseDownResult>;
+ mouseUp(params: PageMouseUpParams, progress: Progress): Promise<PageMouseUpResult>;
+ mouseClick(params: PageMouseClickParams, progress: Progress): Promise<PageMouseClickResult>;
+ mouseWheel(params: PageMouseWheelParams, progress: Progress): Promise<PageMouseWheelResult>;
+ touchscreenTap(params: PageTouchscreenTapParams, progress: Progress): Promise<PageTouchscreenTapResult>;
+ clearPageErrors(params: PageClearPageErrorsParams, progress: Progress): Promise<PageClearPageErrorsResult>;
+ pageErrors(params: PagePageErrorsParams, progress: Progress): Promise<PagePageErrorsResult>;
+ pdf(params: PagePdfParams, progress: Progress): Promise<PagePdfResult>;
+ requests(params: PageRequestsParams, progress: Progress): Promise<PageRequestsResult>;
+ startJSCoverage(params: PageStartJSCoverageParams, progress: Progress): Promise<PageStartJSCoverageResult>;
+ stopJSCoverage(params: PageStopJSCoverageParams, progress: Progress): Promise<PageStopJSCoverageResult>;
+ startCSSCoverage(params: PageStartCSSCoverageParams, progress: Progress): Promise<PageStartCSSCoverageResult>;
+ stopCSSCoverage(params: PageStopCSSCoverageParams, progress: Progress): Promise<PageStopCSSCoverageResult>;
+ bringToFront(params: PageBringToFrontParams, progress: Progress): Promise<PageBringToFrontResult>;
+ pickLocator(params: PagePickLocatorParams, progress: Progress): Promise<PagePickLocatorResult>;
+ cancelPickLocator(params: PageCancelPickLocatorParams, progress: Progress): Promise<PageCancelPickLocatorResult>;
+ hideHighlight(params: PageHideHighlightParams, progress: Progress): Promise<PageHideHighlightResult>;
+ screencastShowOverlay(params: PageScreencastShowOverlayParams, progress: Progress): Promise<PageScreencastShowOverlayResult>;
+ screencastRemoveOverlay(params: PageScreencastRemoveOverlayParams, progress: Progress): Promise<PageScreencastRemoveOverlayResult>;
+ screencastChapter(params: PageScreencastChapterParams, progress: Progress): Promise<PageScreencastChapterResult>;
+ screencastSetOverlayVisible(params: PageScreencastSetOverlayVisibleParams, progress: Progress): Promise<PageScreencastSetOverlayVisibleResult>;
+ screencastShowActions(params: PageScreencastShowActionsParams, progress: Progress): Promise<PageScreencastShowActionsResult>;
+ screencastHideActions(params: PageScreencastHideActionsParams, progress: Progress): Promise<PageScreencastHideActionsResult>;
+ screencastStart(params: PageScreencastStartParams, progress: Progress): Promise<PageScreencastStartResult>;
+ screencastStop(params: PageScreencastStopParams, progress: Progress): Promise<PageScreencastStopResult>;
+ updateSubscription(params: PageUpdateSubscriptionParams, progress: Progress): Promise<PageUpdateSubscriptionResult>;
+ setDockTile(params: PageSetDockTileParams, progress: Progress): Promise<PageSetDockTileResult>;
+ webStorageItems(params: PageWebStorageItemsParams, progress: Progress): Promise<PageWebStorageItemsResult>;
+ webStorageGetItem(params: PageWebStorageGetItemParams, progress: Progress): Promise<PageWebStorageGetItemResult>;
+ webStorageSetItem(params: PageWebStorageSetItemParams, progress: Progress): Promise<PageWebStorageSetItemResult>;
+ webStorageRemoveItem(params: PageWebStorageRemoveItemParams, progress: Progress): Promise<PageWebStorageRemoveItemResult>;
+ webStorageClear(params: PageWebStorageClearParams, progress: Progress): Promise<PageWebStorageClearResult>;
+}
+export type PageBindingCallEvent = {
+ binding: BindingCallChannel,
+};
+export type PageCloseEvent = {};
+export type PageCrashEvent = {};
+export type PageDownloadEvent = {
+ url: string,
+ suggestedFilename: string,
+ artifact: ArtifactChannel,
+};
+export type PageViewportSizeChangedEvent = {
+ viewportSize?: {
+ width: number,
+ height: number,
+ },
+};
+export type PageFileChooserEvent = {
+ element: ElementHandleChannel,
+ isMultiple: boolean,
+};
+export type PageFrameAttachedEvent = {
+ frame: FrameChannel,
+};
+export type PageFrameDetachedEvent = {
+ frame: FrameChannel,
+};
+export type PageLocatorHandlerTriggeredEvent = {
+ uid: number,
+};
+export type PageRouteEvent = {
+ route: RouteChannel,
+};
+export type PageScreencastFrameEvent = {
+ data: Binary,
+ timestamp: number,
+ viewportWidth: number,
+ viewportHeight: number,
+};
+export type PageWebSocketRouteEvent = {
+ webSocketRoute: WebSocketRouteChannel,
+};
+export type PageWebSocketEvent = {
+ webSocket: WebSocketChannel,
+};
+export type PageWorkerEvent = {
+ worker: WorkerChannel,
+};
+export type PageAddInitScriptParams = {
+ source: string,
+};
+export type PageAddInitScriptOptions = {
+
+};
+export type PageAddInitScriptResult = {
+ disposable: DisposableChannel,
+};
+export type PageCloseParams = {
+ reason?: string,
+};
+export type PageCloseOptions = {
+ reason?: string,
+};
+export type PageCloseResult = void;
+export type PageRunBeforeUnloadParams = {};
+export type PageRunBeforeUnloadOptions = {};
+export type PageRunBeforeUnloadResult = void;
+export type PageClearConsoleMessagesParams = {};
+export type PageClearConsoleMessagesOptions = {};
+export type PageClearConsoleMessagesResult = void;
+export type PageConsoleMessagesParams = {
+ filter?: ConsoleMessagesFilter,
+};
+export type PageConsoleMessagesOptions = {
+ filter?: ConsoleMessagesFilter,
+};
+export type PageConsoleMessagesResult = {
+ messages: {
+ type: string,
+ text: string,
+ args: JSHandleChannel[],
+ location: {
+ url: string,
+ lineNumber: number,
+ columnNumber: number,
+ },
+ timestamp: number,
+ }[],
+};
+export type PageEmulateMediaParams = {
+ media?: 'screen' | 'print' | 'no-override',
+ colorScheme?: 'dark' | 'light' | 'no-preference' | 'no-override',
+ reducedMotion?: 'reduce' | 'no-preference' | 'no-override',
+ forcedColors?: 'active' | 'none' | 'no-override',
+ contrast?: 'no-preference' | 'more' | 'no-override',
+};
+export type PageEmulateMediaOptions = {
+ media?: 'screen' | 'print' | 'no-override',
+ colorScheme?: 'dark' | 'light' | 'no-preference' | 'no-override',
+ reducedMotion?: 'reduce' | 'no-preference' | 'no-override',
+ forcedColors?: 'active' | 'none' | 'no-override',
+ contrast?: 'no-preference' | 'more' | 'no-override',
+};
+export type PageEmulateMediaResult = void;
+export type PageExposeBindingParams = {
+ name: string,
+};
+export type PageExposeBindingOptions = {
+
+};
+export type PageExposeBindingResult = {
+ disposable: DisposableChannel,
+};
+export type PageGoBackParams = {
+ timeout: number,
+ waitUntil?: LifecycleEvent,
+};
+export type PageGoBackOptions = {
+ waitUntil?: LifecycleEvent,
+};
+export type PageGoBackResult = {
+ response?: ResponseChannel,
+};
+export type PageGoForwardParams = {
+ timeout: number,
+ waitUntil?: LifecycleEvent,
+};
+export type PageGoForwardOptions = {
+ waitUntil?: LifecycleEvent,
+};
+export type PageGoForwardResult = {
+ response?: ResponseChannel,
+};
+export type PageRequestGCParams = {};
+export type PageRequestGCOptions = {};
+export type PageRequestGCResult = void;
+export type PageRegisterLocatorHandlerParams = {
+ selector: string,
+ noWaitAfter?: boolean,
+};
+export type PageRegisterLocatorHandlerOptions = {
+ noWaitAfter?: boolean,
+};
+export type PageRegisterLocatorHandlerResult = {
+ uid: number,
+};
+export type PageResolveLocatorHandlerNoReplyParams = {
+ uid: number,
+ remove?: boolean,
+};
+export type PageResolveLocatorHandlerNoReplyOptions = {
+ remove?: boolean,
+};
+export type PageResolveLocatorHandlerNoReplyResult = void;
+export type PageUnregisterLocatorHandlerParams = {
+ uid: number,
+};
+export type PageUnregisterLocatorHandlerOptions = {
+
+};
+export type PageUnregisterLocatorHandlerResult = void;
+export type PageReloadParams = {
+ timeout: number,
+ waitUntil?: LifecycleEvent,
+};
+export type PageReloadOptions = {
+ waitUntil?: LifecycleEvent,
+};
+export type PageReloadResult = {
+ response?: ResponseChannel,
+};
+export type PageExpectScreenshotParams = {
+ expected?: Binary,
+ timeout: number,
+ isNot: boolean,
+ locator?: {
+ frame: FrameChannel,
+ selector: string,
+ },
+ comparator?: string,
+ maxDiffPixels?: number,
+ maxDiffPixelRatio?: number,
+ threshold?: number,
+ fullPage?: boolean,
+ clip?: Rect,
+ omitBackground?: boolean,
+ caret?: 'hide' | 'initial',
+ animations?: 'disabled' | 'allow',
+ scale?: 'css' | 'device',
+ mask?: {
+ frame: FrameChannel,
+ selector: string,
+ }[],
+ maskColor?: string,
+ style?: string,
+};
+export type PageExpectScreenshotOptions = {
+ expected?: Binary,
+ locator?: {
+ frame: FrameChannel,
+ selector: string,
+ },
+ comparator?: string,
+ maxDiffPixels?: number,
+ maxDiffPixelRatio?: number,
+ threshold?: number,
+ fullPage?: boolean,
+ clip?: Rect,
+ omitBackground?: boolean,
+ caret?: 'hide' | 'initial',
+ animations?: 'disabled' | 'allow',
+ scale?: 'css' | 'device',
+ mask?: {
+ frame: FrameChannel,
+ selector: string,
+ }[],
+ maskColor?: string,
+ style?: string,
+};
+export type PageExpectScreenshotResult = {
+ actual?: Binary,
+};
+export type PageExpectScreenshotErrorDetails = {
+ diff?: Binary,
+ customErrorMessage?: string,
+ actual?: Binary,
+ previous?: Binary,
+ timedOut?: boolean,
+ log?: string[],
+};
+export type PageScreenshotParams = {
+ timeout: number,
+ type?: 'png' | 'jpeg',
+ quality?: number,
+ fullPage?: boolean,
+ clip?: Rect,
+ omitBackground?: boolean,
+ caret?: 'hide' | 'initial',
+ animations?: 'disabled' | 'allow',
+ scale?: 'css' | 'device',
+ mask?: {
+ frame: FrameChannel,
+ selector: string,
+ }[],
+ maskColor?: string,
+ style?: string,
+};
+export type PageScreenshotOptions = {
+ type?: 'png' | 'jpeg',
+ quality?: number,
+ fullPage?: boolean,
+ clip?: Rect,
+ omitBackground?: boolean,
+ caret?: 'hide' | 'initial',
+ animations?: 'disabled' | 'allow',
+ scale?: 'css' | 'device',
+ mask?: {
+ frame: FrameChannel,
+ selector: string,
+ }[],
+ maskColor?: string,
+ style?: string,
+};
+export type PageScreenshotResult = {
+ binary: Binary,
+};
+export type PageSetExtraHTTPHeadersParams = {
+ headers: NameValue[],
+};
+export type PageSetExtraHTTPHeadersOptions = {
+
+};
+export type PageSetExtraHTTPHeadersResult = void;
+export type PageSetNetworkInterceptionPatternsParams = {
+ patterns: {
+ glob?: string,
+ regexSource?: string,
+ regexFlags?: string,
+ urlPattern?: URLPattern,
+ }[],
+};
+export type PageSetNetworkInterceptionPatternsOptions = {
+
+};
+export type PageSetNetworkInterceptionPatternsResult = void;
+export type PageSetWebSocketInterceptionPatternsParams = {
+ patterns: {
+ glob?: string,
+ regexSource?: string,
+ regexFlags?: string,
+ urlPattern?: URLPattern,
+ }[],
+};
+export type PageSetWebSocketInterceptionPatternsOptions = {
+
+};
+export type PageSetWebSocketInterceptionPatternsResult = void;
+export type PageSetViewportSizeParams = {
+ viewportSize: {
+ width: number,
+ height: number,
+ },
+};
+export type PageSetViewportSizeOptions = {
+
+};
+export type PageSetViewportSizeResult = void;
+export type PageKeyboardDownParams = {
+ key: string,
+};
+export type PageKeyboardDownOptions = {
+
+};
+export type PageKeyboardDownResult = void;
+export type PageKeyboardUpParams = {
+ key: string,
+};
+export type PageKeyboardUpOptions = {
+
+};
+export type PageKeyboardUpResult = void;
+export type PageKeyboardInsertTextParams = {
+ text: string,
+};
+export type PageKeyboardInsertTextOptions = {
+
+};
+export type PageKeyboardInsertTextResult = void;
+export type PageKeyboardTypeParams = {
+ text: string,
+ delay?: number,
+};
+export type PageKeyboardTypeOptions = {
+ delay?: number,
+};
+export type PageKeyboardTypeResult = void;
+export type PageKeyboardPressParams = {
+ key: string,
+ delay?: number,
+};
+export type PageKeyboardPressOptions = {
+ delay?: number,
+};
+export type PageKeyboardPressResult = void;
+export type PageMouseMoveParams = {
+ x: number,
+ y: number,
+ steps?: number,
+};
+export type PageMouseMoveOptions = {
+ steps?: number,
+};
+export type PageMouseMoveResult = void;
+export type PageMouseDownParams = {
+ button?: 'left' | 'right' | 'middle',
+ clickCount?: number,
+};
+export type PageMouseDownOptions = {
+ button?: 'left' | 'right' | 'middle',
+ clickCount?: number,
+};
+export type PageMouseDownResult = void;
+export type PageMouseUpParams = {
+ button?: 'left' | 'right' | 'middle',
+ clickCount?: number,
+};
+export type PageMouseUpOptions = {
+ button?: 'left' | 'right' | 'middle',
+ clickCount?: number,
+};
+export type PageMouseUpResult = void;
+export type PageMouseClickParams = {
+ x: number,
+ y: number,
+ delay?: number,
+ button?: 'left' | 'right' | 'middle',
+ clickCount?: number,
+};
+export type PageMouseClickOptions = {
+ delay?: number,
+ button?: 'left' | 'right' | 'middle',
+ clickCount?: number,
+};
+export type PageMouseClickResult = void;
+export type PageMouseWheelParams = {
+ deltaX: number,
+ deltaY: number,
+};
+export type PageMouseWheelOptions = {
+
+};
+export type PageMouseWheelResult = void;
+export type PageTouchscreenTapParams = {
+ x: number,
+ y: number,
+};
+export type PageTouchscreenTapOptions = {
+
+};
+export type PageTouchscreenTapResult = void;
+export type PageClearPageErrorsParams = {};
+export type PageClearPageErrorsOptions = {};
+export type PageClearPageErrorsResult = void;
+export type PagePageErrorsParams = {
+ filter?: ConsoleMessagesFilter,
+};
+export type PagePageErrorsOptions = {
+ filter?: ConsoleMessagesFilter,
+};
+export type PagePageErrorsResult = {
+ errors: SerializedError[],
+};
+export type PagePdfParams = {
+ scale?: number,
+ displayHeaderFooter?: boolean,
+ headerTemplate?: string,
+ footerTemplate?: string,
+ printBackground?: boolean,
+ landscape?: boolean,
+ pageRanges?: string,
+ format?: string,
+ width?: string,
+ height?: string,
+ preferCSSPageSize?: boolean,
+ margin?: {
+ top?: string,
+ bottom?: string,
+ left?: string,
+ right?: string,
+ },
+ tagged?: boolean,
+ outline?: boolean,
+};
+export type PagePdfOptions = {
+ scale?: number,
+ displayHeaderFooter?: boolean,
+ headerTemplate?: string,
+ footerTemplate?: string,
+ printBackground?: boolean,
+ landscape?: boolean,
+ pageRanges?: string,
+ format?: string,
+ width?: string,
+ height?: string,
+ preferCSSPageSize?: boolean,
+ margin?: {
+ top?: string,
+ bottom?: string,
+ left?: string,
+ right?: string,
+ },
+ tagged?: boolean,
+ outline?: boolean,
+};
+export type PagePdfResult = {
+ pdf: Binary,
+};
+export type PageRequestsParams = {};
+export type PageRequestsOptions = {};
+export type PageRequestsResult = {
+ requests: RequestChannel[],
+};
+export type PageStartJSCoverageParams = {
+ resetOnNavigation?: boolean,
+ reportAnonymousScripts?: boolean,
+};
+export type PageStartJSCoverageOptions = {
+ resetOnNavigation?: boolean,
+ reportAnonymousScripts?: boolean,
+};
+export type PageStartJSCoverageResult = void;
+export type PageStopJSCoverageParams = {};
+export type PageStopJSCoverageOptions = {};
+export type PageStopJSCoverageResult = {
+ entries: {
+ url: string,
+ scriptId: string,
+ source?: string,
+ functions: {
+ functionName: string,
+ isBlockCoverage: boolean,
+ ranges: {
+ startOffset: number,
+ endOffset: number,
+ count: number,
+ }[],
+ }[],
+ }[],
+};
+export type PageStartCSSCoverageParams = {
+ resetOnNavigation?: boolean,
+};
+export type PageStartCSSCoverageOptions = {
+ resetOnNavigation?: boolean,
+};
+export type PageStartCSSCoverageResult = void;
+export type PageStopCSSCoverageParams = {};
+export type PageStopCSSCoverageOptions = {};
+export type PageStopCSSCoverageResult = {
+ entries: {
+ url: string,
+ text?: string,
+ ranges: {
+ start: number,
+ end: number,
+ }[],
+ }[],
+};
+export type PageBringToFrontParams = {};
+export type PageBringToFrontOptions = {};
+export type PageBringToFrontResult = void;
+export type PagePickLocatorParams = {};
+export type PagePickLocatorOptions = {};
+export type PagePickLocatorResult = {
+ selector: string,
+};
+export type PageCancelPickLocatorParams = {};
+export type PageCancelPickLocatorOptions = {};
+export type PageCancelPickLocatorResult = void;
+export type PageHideHighlightParams = {};
+export type PageHideHighlightOptions = {};
+export type PageHideHighlightResult = void;
+export type PageScreencastShowOverlayParams = {
+ html: string,
+ duration?: number,
+};
+export type PageScreencastShowOverlayOptions = {
+ duration?: number,
+};
+export type PageScreencastShowOverlayResult = {
+ id: string,
+};
+export type PageScreencastRemoveOverlayParams = {
+ id: string,
+};
+export type PageScreencastRemoveOverlayOptions = {
+
+};
+export type PageScreencastRemoveOverlayResult = void;
+export type PageScreencastChapterParams = {
+ title: string,
+ description?: string,
+ duration?: number,
+};
+export type PageScreencastChapterOptions = {
+ description?: string,
+ duration?: number,
+};
+export type PageScreencastChapterResult = void;
+export type PageScreencastSetOverlayVisibleParams = {
+ visible: boolean,
+};
+export type PageScreencastSetOverlayVisibleOptions = {
+
+};
+export type PageScreencastSetOverlayVisibleResult = void;
+export type PageScreencastShowActionsParams = {
+ duration?: number,
+ position?: 'top-left' | 'top' | 'top-right' | 'bottom-left' | 'bottom' | 'bottom-right',
+ fontSize?: number,
+ cursor?: 'none' | 'pointer',
+};
+export type PageScreencastShowActionsOptions = {
+ duration?: number,
+ position?: 'top-left' | 'top' | 'top-right' | 'bottom-left' | 'bottom' | 'bottom-right',
+ fontSize?: number,
+ cursor?: 'none' | 'pointer',
+};
+export type PageScreencastShowActionsResult = void;
+export type PageScreencastHideActionsParams = {};
+export type PageScreencastHideActionsOptions = {};
+export type PageScreencastHideActionsResult = void;
+export type PageScreencastStartParams = {
+ size?: {
+ width: number,
+ height: number,
+ },
+ quality?: number,
+ sendFrames?: boolean,
+ record?: boolean,
+};
+export type PageScreencastStartOptions = {
+ size?: {
+ width: number,
+ height: number,
+ },
+ quality?: number,
+ sendFrames?: boolean,
+ record?: boolean,
+};
+export type PageScreencastStartResult = {
+ artifact?: ArtifactChannel,
+};
+export type PageScreencastStopParams = {};
+export type PageScreencastStopOptions = {};
+export type PageScreencastStopResult = void;
+export type PageUpdateSubscriptionParams = {
+ event: 'console' | 'dialog' | 'fileChooser' | 'request' | 'response' | 'requestFinished' | 'requestFailed',
+ enabled: boolean,
+};
+export type PageUpdateSubscriptionOptions = {
+
+};
+export type PageUpdateSubscriptionResult = void;
+export type PageSetDockTileParams = {
+ image: Binary,
+};
+export type PageSetDockTileOptions = {
+
+};
+export type PageSetDockTileResult = void;
+export type PageWebStorageItemsParams = {
+ kind: 'local' | 'session',
+};
+export type PageWebStorageItemsOptions = {
+
+};
+export type PageWebStorageItemsResult = {
+ items: NameValue[],
+};
+export type PageWebStorageGetItemParams = {
+ kind: 'local' | 'session',
+ name: string,
+};
+export type PageWebStorageGetItemOptions = {
+
+};
+export type PageWebStorageGetItemResult = {
+ value?: string,
+};
+export type PageWebStorageSetItemParams = {
+ kind: 'local' | 'session',
+ name: string,
+ value: string,
+};
+export type PageWebStorageSetItemOptions = {
+
+};
+export type PageWebStorageSetItemResult = void;
+export type PageWebStorageRemoveItemParams = {
+ kind: 'local' | 'session',
+ name: string,
+};
+export type PageWebStorageRemoveItemOptions = {
+
+};
+export type PageWebStorageRemoveItemResult = void;
+export type PageWebStorageClearParams = {
+ kind: 'local' | 'session',
+};
+export type PageWebStorageClearOptions = {
+
+};
+export type PageWebStorageClearResult = void;
+
+export interface PageEvents {
+ 'bindingCall': PageBindingCallEvent;
+ 'close': PageCloseEvent;
+ 'crash': PageCrashEvent;
+ 'download': PageDownloadEvent;
+ 'viewportSizeChanged': PageViewportSizeChangedEvent;
+ 'fileChooser': PageFileChooserEvent;
+ 'frameAttached': PageFrameAttachedEvent;
+ 'frameDetached': PageFrameDetachedEvent;
+ 'locatorHandlerTriggered': PageLocatorHandlerTriggeredEvent;
+ 'route': PageRouteEvent;
+ 'screencastFrame': PageScreencastFrameEvent;
+ 'webSocketRoute': PageWebSocketRouteEvent;
+ 'webSocket': PageWebSocketEvent;
+ 'worker': PageWorkerEvent;
+}
+
+// ----------- Root -----------
+export type RootInitializer = {};
+export interface RootEventTarget {
+}
+export interface RootChannel extends RootEventTarget, Channel {
+ _type_Root: boolean;
+ initialize(params: RootInitializeParams, progress: Progress): Promise<RootInitializeResult>;
+}
+export type RootInitializeParams = {
+ sdkLanguage: SDKLanguage,
+};
+export type RootInitializeOptions = {
+
+};
+export type RootInitializeResult = {
+ playwright: PlaywrightChannel,
+};
+
+export interface RootEvents {
+}
+
+// ----------- Playwright -----------
+export type PlaywrightInitializer = {
+ chromium: BrowserTypeChannel,
+ firefox: BrowserTypeChannel,
+ webkit: BrowserTypeChannel,
+ android: AndroidChannel,
+ electron: ElectronChannel,
+ utils?: LocalUtilsChannel,
+ preLaunchedBrowser?: BrowserChannel,
+ preConnectedAndroidDevice?: AndroidDeviceChannel,
+ socksSupport?: SocksSupportChannel,
+};
+export interface PlaywrightEventTarget {
+}
+export interface PlaywrightChannel extends PlaywrightEventTarget, Channel {
+ _type_Playwright: boolean;
+ newRequest(params: PlaywrightNewRequestParams, progress: Progress): Promise<PlaywrightNewRequestResult>;
+}
+export type PlaywrightNewRequestParams = {
+ baseURL?: string,
+ userAgent?: string,
+ ignoreHTTPSErrors?: boolean,
+ extraHTTPHeaders?: NameValue[],
+ failOnStatusCode?: boolean,
+ clientCertificates?: {
+ origin: string,
+ cert?: Binary,
+ key?: Binary,
+ passphrase?: string,
+ pfx?: Binary,
+ }[],
+ maxRedirects?: number,
+ httpCredentials?: {
+ username: string,
+ password: string,
+ origin?: string,
+ send?: 'always' | 'unauthorized',
+ },
+ proxy?: {
+ server: string,
+ bypass?: string,
+ username?: string,
+ password?: string,
+ },
+ storageState?: {
+ cookies?: NetworkCookie[],
+ origins?: SetOriginStorage[],
+ },
+ tracesDir?: string,
+};
+export type PlaywrightNewRequestOptions = {
+ baseURL?: string,
+ userAgent?: string,
+ ignoreHTTPSErrors?: boolean,
+ extraHTTPHeaders?: NameValue[],
+ failOnStatusCode?: boolean,
+ clientCertificates?: {
+ origin: string,
+ cert?: Binary,
+ key?: Binary,
+ passphrase?: string,
+ pfx?: Binary,
+ }[],
+ maxRedirects?: number,
+ httpCredentials?: {
+ username: string,
+ password: string,
+ origin?: string,
+ send?: 'always' | 'unauthorized',
+ },
+ proxy?: {
+ server: string,
+ bypass?: string,
+ username?: string,
+ password?: string,
+ },
+ storageState?: {
+ cookies?: NetworkCookie[],
+ origins?: SetOriginStorage[],
+ },
+ tracesDir?: string,
+};
+export type PlaywrightNewRequestResult = {
+ request: APIRequestContextChannel,
+};
+
+export interface PlaywrightEvents {
+}
+
+// ----------- DebugController -----------
+export type DebugControllerInitializer = {};
+export interface DebugControllerEventTarget {
+ _dispatchEvent(event: 'inspectRequested', params?: DebugControllerInspectRequestedEvent): void;
+ _dispatchEvent(event: 'setModeRequested', params?: DebugControllerSetModeRequestedEvent): void;
+ _dispatchEvent(event: 'stateChanged', params?: DebugControllerStateChangedEvent): void;
+ _dispatchEvent(event: 'sourceChanged', params?: DebugControllerSourceChangedEvent): void;
+ _dispatchEvent(event: 'paused', params?: DebugControllerPausedEvent): void;
+}
+export interface DebugControllerChannel extends DebugControllerEventTarget, Channel {
+ _type_DebugController: boolean;
+ initialize(params: DebugControllerInitializeParams, progress: Progress): Promise<DebugControllerInitializeResult>;
+ setReportStateChanged(params: DebugControllerSetReportStateChangedParams, progress: Progress): Promise<DebugControllerSetReportStateChangedResult>;
+ setRecorderMode(params: DebugControllerSetRecorderModeParams, progress: Progress): Promise<DebugControllerSetRecorderModeResult>;
+ highlight(params: DebugControllerHighlightParams, progress: Progress): Promise<DebugControllerHighlightResult>;
+ hideHighlight(params: DebugControllerHideHighlightParams, progress: Progress): Promise<DebugControllerHideHighlightResult>;
+ resume(params: DebugControllerResumeParams, progress: Progress): Promise<DebugControllerResumeResult>;
+ kill(params: DebugControllerKillParams, progress: Progress): Promise<DebugControllerKillResult>;
+}
+export type DebugControllerInspectRequestedEvent = {
+ selector: string,
+ locator: string,
+ ariaSnapshot: string,
+};
+export type DebugControllerSetModeRequestedEvent = {
+ mode: string,
+};
+export type DebugControllerStateChangedEvent = {
+ pageCount: number,
+};
+export type DebugControllerSourceChangedEvent = {
+ text: string,
+ header?: string,
+ footer?: string,
+ actions?: string[],
+};
+export type DebugControllerPausedEvent = {
+ paused: boolean,
+};
+export type DebugControllerInitializeParams = {
+ codegenId: string,
+ sdkLanguage: SDKLanguage,
+};
+export type DebugControllerInitializeOptions = {
+
+};
+export type DebugControllerInitializeResult = void;
+export type DebugControllerSetReportStateChangedParams = {
+ enabled: boolean,
+};
+export type DebugControllerSetReportStateChangedOptions = {
+
+};
+export type DebugControllerSetReportStateChangedResult = void;
+export type DebugControllerSetRecorderModeParams = {
+ mode: 'inspecting' | 'recording' | 'none',
+ testIdAttributeName?: string,
+ generateAutoExpect?: boolean,
+};
+export type DebugControllerSetRecorderModeOptions = {
+ testIdAttributeName?: string,
+ generateAutoExpect?: boolean,
+};
+export type DebugControllerSetRecorderModeResult = void;
+export type DebugControllerHighlightParams = {
+ selector?: string,
+ ariaTemplate?: string,
+};
+export type DebugControllerHighlightOptions = {
+ selector?: string,
+ ariaTemplate?: string,
+};
+export type DebugControllerHighlightResult = void;
+export type DebugControllerHideHighlightParams = {};
+export type DebugControllerHideHighlightOptions = {};
+export type DebugControllerHideHighlightResult = void;
+export type DebugControllerResumeParams = {};
+export type DebugControllerResumeOptions = {};
+export type DebugControllerResumeResult = void;
+export type DebugControllerKillParams = {};
+export type DebugControllerKillOptions = {};
+export type DebugControllerKillResult = void;
+
+export interface DebugControllerEvents {
+ 'inspectRequested': DebugControllerInspectRequestedEvent;
+ 'setModeRequested': DebugControllerSetModeRequestedEvent;
+ 'stateChanged': DebugControllerStateChangedEvent;
+ 'sourceChanged': DebugControllerSourceChangedEvent;
+ 'paused': DebugControllerPausedEvent;
+}
+
+// ----------- SocksSupport -----------
+export type SocksSupportInitializer = {};
+export interface SocksSupportEventTarget {
+ _dispatchEvent(event: 'socksRequested', params?: SocksSupportSocksRequestedEvent): void;
+ _dispatchEvent(event: 'socksData', params?: SocksSupportSocksDataEvent): void;
+ _dispatchEvent(event: 'socksClosed', params?: SocksSupportSocksClosedEvent): void;
+}
+export interface SocksSupportChannel extends SocksSupportEventTarget, Channel {
+ _type_SocksSupport: boolean;
+ socksConnected(params: SocksSupportSocksConnectedParams, progress: Progress): Promise<SocksSupportSocksConnectedResult>;
+ socksFailed(params: SocksSupportSocksFailedParams, progress: Progress): Promise<SocksSupportSocksFailedResult>;
+ socksData(params: SocksSupportSocksDataParams, progress: Progress): Promise<SocksSupportSocksDataResult>;
+ socksError(params: SocksSupportSocksErrorParams, progress: Progress): Promise<SocksSupportSocksErrorResult>;
+ socksEnd(params: SocksSupportSocksEndParams, progress: Progress): Promise<SocksSupportSocksEndResult>;
+}
+export type SocksSupportSocksRequestedEvent = {
+ uid: string,
+ host: string,
+ port: number,
+};
+export type SocksSupportSocksDataEvent = {
+ uid: string,
+ data: Binary,
+};
+export type SocksSupportSocksClosedEvent = {
+ uid: string,
+};
+export type SocksSupportSocksConnectedParams = {
+ uid: string,
+ host: string,
+ port: number,
+};
+export type SocksSupportSocksConnectedOptions = {
+
+};
+export type SocksSupportSocksConnectedResult = void;
+export type SocksSupportSocksFailedParams = {
+ uid: string,
+ errorCode: string,
+};
+export type SocksSupportSocksFailedOptions = {
+
+};
+export type SocksSupportSocksFailedResult = void;
+export type SocksSupportSocksDataParams = {
+ uid: string,
+ data: Binary,
+};
+export type SocksSupportSocksDataOptions = {
+
+};
+export type SocksSupportSocksDataResult = void;
+export type SocksSupportSocksErrorParams = {
+ uid: string,
+ error: string,
+};
+export type SocksSupportSocksErrorOptions = {
+
+};
+export type SocksSupportSocksErrorResult = void;
+export type SocksSupportSocksEndParams = {
+ uid: string,
+};
+export type SocksSupportSocksEndOptions = {
+
+};
+export type SocksSupportSocksEndResult = void;
+
+export interface SocksSupportEvents {
+ 'socksRequested': SocksSupportSocksRequestedEvent;
+ 'socksData': SocksSupportSocksDataEvent;
+ 'socksClosed': SocksSupportSocksClosedEvent;
+}
+
+// ----------- JsonPipe -----------
+export type JsonPipeInitializer = {};
+export interface JsonPipeEventTarget {
+ _dispatchEvent(event: 'message', params?: JsonPipeMessageEvent): void;
+ _dispatchEvent(event: 'closed', params?: JsonPipeClosedEvent): void;
+}
+export interface JsonPipeChannel extends JsonPipeEventTarget, Channel {
+ _type_JsonPipe: boolean;
+ send(params: JsonPipeSendParams, progress: Progress): Promise<JsonPipeSendResult>;
+ close(params: JsonPipeCloseParams, progress: Progress): Promise<JsonPipeCloseResult>;
+}
+export type JsonPipeMessageEvent = {
+ message: any,
+};
+export type JsonPipeClosedEvent = {
+ reason?: string,
+};
+export type JsonPipeSendParams = {
+ message: any,
+};
+export type JsonPipeSendOptions = {
+
+};
+export type JsonPipeSendResult = void;
+export type JsonPipeCloseParams = {};
+export type JsonPipeCloseOptions = {};
+export type JsonPipeCloseResult = void;
+
+export interface JsonPipeEvents {
+ 'message': JsonPipeMessageEvent;
+ 'closed': JsonPipeClosedEvent;
+}
+
+export type ExpectedTextValue = {
+ string?: string,
+ regexSource?: string,
+ regexFlags?: string,
+ matchSubstring?: boolean,
+ ignoreCase?: boolean,
+ normalizeWhiteSpace?: boolean,
+};
+
+export type SelectorEngine = {
+ name: string,
+ source: string,
+ contentScript?: boolean,
+};
+
+export type FormField = {
+ name: string,
+ value?: string,
+ file?: {
+ name: string,
+ mimeType?: string,
+ buffer: Binary,
+ },
+};
+
+export type LifecycleEvent = 'load' | 'domcontentloaded' | 'networkidle' | 'commit';
+export type ConsoleMessagesFilter = 'all' | 'since-navigation';
+export type RecorderSource = {
+ isRecorded: boolean,
+ id: string,
+ label: string,
+ text: string,
+ language: string,
+ highlight: {
+ line: number,
+ type: string,
+ }[],
+ revealLine?: number,
+ group?: string,
+};
+
+export type IndexedDBDatabase = {
+ name: string,
+ version: number,
+ stores: {
+ name: string,
+ autoIncrement: boolean,
+ keyPath?: string,
+ keyPathArray?: string[],
+ records: {
+ key?: any,
+ keyEncoded?: any,
+ value?: any,
+ valueEncoded?: any,
+ }[],
+ indexes: {
+ name: string,
+ keyPath?: string,
+ keyPathArray?: string[],
+ multiEntry: boolean,
+ unique: boolean,
+ }[],
+ }[],
+};
+
+export type SetOriginStorage = {
+ origin: string,
+ localStorage: NameValue[],
+ indexedDB?: IndexedDBDatabase[],
+};
+
+export type OriginStorage = {
+ origin: string,
+ localStorage: NameValue[],
+ indexedDB?: IndexedDBDatabase[],
+};
+
+export type RecordHarOptions = {
+ content?: 'embed' | 'attach' | 'omit',
+ mode?: 'full' | 'minimal',
+ urlGlob?: string,
+ urlRegexSource?: string,
+ urlRegexFlags?: string,
+ harPath?: string,
+ resourcesDir?: string,
+};
+
+// ----------- CDPSession -----------
+export type CDPSessionInitializer = {};
+export interface CDPSessionEventTarget {
+ _dispatchEvent(event: 'event', params?: CDPSessionEventEvent): void;
+ _dispatchEvent(event: 'close', params?: CDPSessionCloseEvent): void;
+}
+export interface CDPSessionChannel extends CDPSessionEventTarget, Channel {
+ _type_CDPSession: boolean;
+ send(params: CDPSessionSendParams, progress: Progress): Promise<CDPSessionSendResult>;
+ detach(params: CDPSessionDetachParams, progress: Progress): Promise<CDPSessionDetachResult>;
+}
+export type CDPSessionEventEvent = {
+ method: string,
+ params?: any,
+};
+export type CDPSessionCloseEvent = {};
+export type CDPSessionSendParams = {
+ method: string,
+ params?: any,
+};
+export type CDPSessionSendOptions = {
+ params?: any,
+};
+export type CDPSessionSendResult = {
+ result: any,
+};
+export type CDPSessionDetachParams = {};
+export type CDPSessionDetachOptions = {};
+export type CDPSessionDetachResult = void;
+
+export interface CDPSessionEvents {
+ 'event': CDPSessionEventEvent;
+ 'close': CDPSessionCloseEvent;
+}
+
+// ----------- BindingCall -----------
+export type BindingCallInitializer = {
+ frame: FrameChannel,
+ name: string,
+ args: SerializedValue[],
+};
+export interface BindingCallEventTarget {
+}
+export interface BindingCallChannel extends BindingCallEventTarget, Channel {
+ _type_BindingCall: boolean;
+ reject(params: BindingCallRejectParams, progress: Progress): Promise<BindingCallRejectResult>;
+ resolve(params: BindingCallResolveParams, progress: Progress): Promise<BindingCallResolveResult>;
+}
+export type BindingCallRejectParams = {
+ error: SerializedError,
+};
+export type BindingCallRejectOptions = {
+
+};
+export type BindingCallRejectResult = void;
+export type BindingCallResolveParams = {
+ result: SerializedArgument,
+};
+export type BindingCallResolveOptions = {
+
+};
+export type BindingCallResolveResult = void;
+
+export interface BindingCallEvents {
+}
+
+// ----------- Debugger -----------
+export type DebuggerInitializer = {};
+export interface DebuggerEventTarget {
+ _dispatchEvent(event: 'pausedStateChanged', params?: DebuggerPausedStateChangedEvent): void;
+}
+export interface DebuggerChannel extends DebuggerEventTarget, Channel {
+ _type_Debugger: boolean;
+ requestPause(params: DebuggerRequestPauseParams, progress: Progress): Promise<DebuggerRequestPauseResult>;
+ resume(params: DebuggerResumeParams, progress: Progress): Promise<DebuggerResumeResult>;
+ next(params: DebuggerNextParams, progress: Progress): Promise<DebuggerNextResult>;
+ runTo(params: DebuggerRunToParams, progress: Progress): Promise<DebuggerRunToResult>;
+}
+export type DebuggerPausedStateChangedEvent = {
+ pausedDetails?: {
+ location: {
+ file: string,
+ line?: number,
+ column?: number,
+ },
+ title: string,
+ stack?: string,
+ },
+};
+export type DebuggerRequestPauseParams = {};
+export type DebuggerRequestPauseOptions = {};
+export type DebuggerRequestPauseResult = void;
+export type DebuggerResumeParams = {};
+export type DebuggerResumeOptions = {};
+export type DebuggerResumeResult = void;
+export type DebuggerNextParams = {};
+export type DebuggerNextOptions = {};
+export type DebuggerNextResult = void;
+export type DebuggerRunToParams = {
+ location: {
+ file: string,
+ line?: number,
+ column?: number,
+ },
+};
+export type DebuggerRunToOptions = {
+
+};
+export type DebuggerRunToResult = void;
+
+export interface DebuggerEvents {
+ 'pausedStateChanged': DebuggerPausedStateChangedEvent;
+}
+
+// ----------- Dialog -----------
+export type DialogInitializer = {
+ page?: PageChannel,
+ type: string,
+ message: string,
+ defaultValue: string,
+};
+export interface DialogEventTarget {
+}
+export interface DialogChannel extends DialogEventTarget, Channel {
+ _type_Dialog: boolean;
+ accept(params: DialogAcceptParams, progress: Progress): Promise<DialogAcceptResult>;
+ dismiss(params: DialogDismissParams, progress: Progress): Promise<DialogDismissResult>;
+}
+export type DialogAcceptParams = {
+ promptText?: string,
+};
+export type DialogAcceptOptions = {
+ promptText?: string,
+};
+export type DialogAcceptResult = void;
+export type DialogDismissParams = {};
+export type DialogDismissOptions = {};
+export type DialogDismissResult = void;
+
+export interface DialogEvents {
+}
+
+export type SerializedValue = {
+ n?: number,
+ b?: boolean,
+ s?: string,
+ v?: 'null' | 'undefined' | 'NaN' | 'Infinity' | '-Infinity' | '-0',
+ d?: string,
+ u?: string,
+ bi?: string,
+ ta?: {
+ b: Binary,
+ k: 'i8' | 'ui8' | 'ui8c' | 'i16' | 'ui16' | 'i32' | 'ui32' | 'f32' | 'f64' | 'bi64' | 'bui64',
+ },
+ e?: {
+ m: string,
+ n: string,
+ s: string,
+ },
+ r?: {
+ p: string,
+ f: string,
+ },
+ a?: SerializedValue[],
+ o?: {
+ k: string,
+ v: SerializedValue,
+ }[],
+ h?: number,
+ id?: number,
+ ref?: number,
+};
+
+export type SerializedArgument = {
+ value: SerializedValue,
+ handles: Channel[],
+};
+
+export type SerializedError = {
+ error?: {
+ message: string,
+ name: string,
+ stack?: string,
+ },
+ value?: SerializedValue,
+};
+
+export type StackFrame = {
+ file: string,
+ line: number,
+ column: number,
+ function?: string,
+};
+
+export type VirtualCredential = {
+ id: string,
+ rpId: string,
+ userHandle: string,
+ privateKey: string,
+ publicKey: string,
+};
+
+export type Point = {
+ x: number,
+ y: number,
+};
+
+export type Rect = {
+ x: number,
+ y: number,
+ width: number,
+ height: number,
+};
+
+export type URLPattern = {
+ hash: string,
+ hostname: string,
+ password: string,
+ pathname: string,
+ port: string,
+ protocol: string,
+ search: string,
+ username: string,
+};
+
+export type NameValue = {
+ name: string,
+ value: string,
+};
+
+// ----------- Tracing -----------
+export type TracingInitializer = {};
+export interface TracingEventTarget {
+}
+export interface TracingChannel extends TracingEventTarget, Channel {
+ _type_Tracing: boolean;
+ tracingStart(params: TracingTracingStartParams, progress: Progress): Promise<TracingTracingStartResult>;
+ tracingStartChunk(params: TracingTracingStartChunkParams, progress: Progress): Promise<TracingTracingStartChunkResult>;
+ tracingGroup(params: TracingTracingGroupParams, progress: Progress): Promise<TracingTracingGroupResult>;
+ tracingGroupEnd(params: TracingTracingGroupEndParams, progress: Progress): Promise<TracingTracingGroupEndResult>;
+ tracingStopChunk(params: TracingTracingStopChunkParams, progress: Progress): Promise<TracingTracingStopChunkResult>;
+ tracingStop(params: TracingTracingStopParams, progress: Progress): Promise<TracingTracingStopResult>;
+ harStart(params: TracingHarStartParams, progress: Progress): Promise<TracingHarStartResult>;
+ harExport(params: TracingHarExportParams, progress: Progress): Promise<TracingHarExportResult>;
+}
+export type TracingTracingStartParams = {
+ name?: string,
+ snapshots?: boolean,
+ screenshots?: boolean,
+ live?: boolean,
+};
+export type TracingTracingStartOptions = {
+ name?: string,
+ snapshots?: boolean,
+ screenshots?: boolean,
+ live?: boolean,
+};
+export type TracingTracingStartResult = void;
+export type TracingTracingStartChunkParams = {
+ name?: string,
+ title?: string,
+};
+export type TracingTracingStartChunkOptions = {
+ name?: string,
+ title?: string,
+};
+export type TracingTracingStartChunkResult = {
+ traceName: string,
+};
+export type TracingTracingGroupParams = {
+ name: string,
+ location?: {
+ file: string,
+ line?: number,
+ column?: number,
+ },
+};
+export type TracingTracingGroupOptions = {
+ location?: {
+ file: string,
+ line?: number,
+ column?: number,
+ },
+};
+export type TracingTracingGroupResult = void;
+export type TracingTracingGroupEndParams = {};
+export type TracingTracingGroupEndOptions = {};
+export type TracingTracingGroupEndResult = void;
+export type TracingTracingStopChunkParams = {
+ mode: 'archive' | 'discard' | 'entries',
+};
+export type TracingTracingStopChunkOptions = {
+
+};
+export type TracingTracingStopChunkResult = {
+ artifact?: ArtifactChannel,
+ entries?: NameValue[],
+};
+export type TracingTracingStopParams = {};
+export type TracingTracingStopOptions = {};
+export type TracingTracingStopResult = void;
+export type TracingHarStartParams = {
+ page?: PageChannel,
+ options: RecordHarOptions,
+};
+export type TracingHarStartOptions = {
+ page?: PageChannel,
+};
+export type TracingHarStartResult = {
+ harId: string,
+};
+export type TracingHarExportParams = {
+ harId?: string,
+ mode: 'archive' | 'entries',
+};
+export type TracingHarExportOptions = {
+ harId?: string,
+};
+export type TracingHarExportResult = {
+ artifact?: ArtifactChannel,
+ entries?: NameValue[],
+};
+
+export interface TracingEvents {
+}
+
+// ----------- Worker -----------
+export type WorkerInitializer = {
+ url: string,
+};
+export interface WorkerEventTarget {
+ _dispatchEvent(event: 'console', params?: WorkerConsoleEvent): void;
+ _dispatchEvent(event: 'close', params?: WorkerCloseEvent): void;
+}
+export interface WorkerChannel extends WorkerEventTarget, Channel {
+ _type_Worker: boolean;
+ disconnect(params: WorkerDisconnectParams, progress: Progress): Promise<WorkerDisconnectResult>;
+ evaluateExpression(params: WorkerEvaluateExpressionParams, progress: Progress): Promise<WorkerEvaluateExpressionResult>;
+ evaluateExpressionHandle(params: WorkerEvaluateExpressionHandleParams, progress: Progress): Promise<WorkerEvaluateExpressionHandleResult>;
+ updateSubscription(params: WorkerUpdateSubscriptionParams, progress: Progress): Promise<WorkerUpdateSubscriptionResult>;
+}
+export type WorkerConsoleEvent = {
+ type: string,
+ text: string,
+ args: JSHandleChannel[],
+ location: {
+ url: string,
+ lineNumber: number,
+ columnNumber: number,
+ },
+ timestamp: number,
+};
+export type WorkerCloseEvent = {};
+export type WorkerDisconnectParams = {
+ reason?: string,
+};
+export type WorkerDisconnectOptions = {
+ reason?: string,
+};
+export type WorkerDisconnectResult = void;
+export type WorkerEvaluateExpressionParams = {
+ expression: string,
+ isFunction?: boolean,
+ arg: SerializedArgument,
+};
+export type WorkerEvaluateExpressionOptions = {
+ isFunction?: boolean,
+};
+export type WorkerEvaluateExpressionResult = {
+ value: SerializedValue,
+};
+export type WorkerEvaluateExpressionHandleParams = {
+ expression: string,
+ isFunction?: boolean,
+ arg: SerializedArgument,
+};
+export type WorkerEvaluateExpressionHandleOptions = {
+ isFunction?: boolean,
+};
+export type WorkerEvaluateExpressionHandleResult = {
+ handle: JSHandleChannel,
+};
+export type WorkerUpdateSubscriptionParams = {
+ event: 'console',
+ enabled: boolean,
+};
+export type WorkerUpdateSubscriptionOptions = {
+
+};
+export type WorkerUpdateSubscriptionResult = void;
+
+export interface WorkerEvents {
+ 'console': WorkerConsoleEvent;
+ 'close': WorkerCloseEvent;
+}
+
diff --git a/packages/playwright-core/src/server/chromium/chromium.ts b/packages/playwright-core/src/server/chromium/chromium.ts
index d9f1c9da72..68d0a9096e 100644
--- a/packages/playwright-core/src/server/chromium/chromium.ts
+++ b/packages/playwright-core/src/server/chromium/chromium.ts
@@ -51,7 +51,7 @@ import type { Progress } from '../progress';
import type { ConnectionTransport, ProtocolRequest } from '../transport';
import type { BrowserContext } from '../browserContext';
import type * as types from '../types';
-import type * as channels from '@protocol/channels';
+import type * as channels from '../channels';
import type http from 'http';
import type stream from 'stream';
diff --git a/packages/playwright-core/src/server/chromium/crBrowser.ts b/packages/playwright-core/src/server/chromium/crBrowser.ts
index 27a3409fb5..e4d95a6843 100644
--- a/packages/playwright-core/src/server/chromium/crBrowser.ts
+++ b/packages/playwright-core/src/server/chromium/crBrowser.ts
@@ -38,7 +38,7 @@ import type { CRDevTools } from './crDevTools';
import type { Protocol } from './protocol';
import type { BrowserOptions } from '../browser';
import type { SdkObject } from '../instrumentation';
-import type * as channels from '@protocol/channels';
+import type * as channels from '../channels';
export class CRBrowser extends Browser {
readonly _connection: CRConnection;
diff --git a/packages/playwright-core/src/server/chromium/crConnection.ts b/packages/playwright-core/src/server/chromium/crConnection.ts
index 54a776c563..1669359ae3 100644
--- a/packages/playwright-core/src/server/chromium/crConnection.ts
+++ b/packages/playwright-core/src/server/chromium/crConnection.ts
@@ -27,7 +27,7 @@ import type { ConnectionTransport, ProtocolRequest, ProtocolResponse } from '../
import type { Protocol } from './protocol';
import type { RecentLogsCollector } from '@utils/debugLogger';
import type { ProtocolLogger } from '../types';
-import type { Progress } from '@protocol/progress';
+import type { Progress } from '../progress';
export const ConnectionEvents = {
diff --git a/packages/playwright-core/src/server/chromium/crCoverage.ts b/packages/playwright-core/src/server/chromium/crCoverage.ts
index 43f73ce1b3..adbc7622da 100644
--- a/packages/playwright-core/src/server/chromium/crCoverage.ts
+++ b/packages/playwright-core/src/server/chromium/crCoverage.ts
@@ -22,8 +22,8 @@ import { raceUncancellableOperationWithCleanup } from '../progress';
import type { CRSession } from './crConnection';
import type { Protocol } from './protocol';
import type { RegisteredListener } from '@utils/eventsHelper';
-import type * as channels from '@protocol/channels';
-import type { Progress } from '@protocol/progress';
+import type * as channels from '../channels';
+import type { Progress } from '../progress';
export class CRCoverage {
diff --git a/packages/playwright-core/src/server/chromium/crPage.ts b/packages/playwright-core/src/server/chromium/crPage.ts
index cbb1d4eb13..82139d2fac 100644
--- a/packages/playwright-core/src/server/chromium/crPage.ts
+++ b/packages/playwright-core/src/server/chromium/crPage.ts
@@ -44,7 +44,7 @@ import type { RegisteredListener } from '@utils/eventsHelper';
import type { InitScript, PageDelegate } from '../page';
import type { Progress } from '../progress';
import type * as types from '../types';
-import type * as channels from '@protocol/channels';
+import type * as channels from '../channels';
export type WindowBounds = { top?: number, left?: number, width?: number, height?: number };
diff --git a/packages/playwright-core/src/server/chromium/crPdf.ts b/packages/playwright-core/src/server/chromium/crPdf.ts
index 91be70fc73..b9a6fe3a24 100644
--- a/packages/playwright-core/src/server/chromium/crPdf.ts
+++ b/packages/playwright-core/src/server/chromium/crPdf.ts
@@ -19,7 +19,7 @@ import { assert } from '@isomorphic/assert';
import { readProtocolStream } from './crProtocolHelper';
import type { CRSession } from './crConnection';
-import type * as channels from '@protocol/channels';
+import type * as channels from '../channels';
const PagePaperFormats: { [key: string]: { width: number, height: number }} = {
letter: { width: 8.5, height: 11 },
diff --git a/packages/playwright-core/src/server/clock.ts b/packages/playwright-core/src/server/clock.ts
index b14fbb4cdd..d4601596e7 100644
--- a/packages/playwright-core/src/server/clock.ts
+++ b/packages/playwright-core/src/server/clock.ts
@@ -19,7 +19,7 @@ import { nullProgress } from './progress';
import type { BrowserContext } from './browserContext';
import type { InitScript } from './page';
-import type { Progress } from '@protocol/progress';
+import type { Progress } from './progress';
export class Clock {
private _browserContext: BrowserContext;
diff --git a/packages/playwright-core/src/server/cookieStore.ts b/packages/playwright-core/src/server/cookieStore.ts
index 3337dbe90d..2e5fdd8fba 100644
--- a/packages/playwright-core/src/server/cookieStore.ts
+++ b/packages/playwright-core/src/server/cookieStore.ts
@@ -16,7 +16,7 @@
import { isLocalHostname, kMaxCookieExpiresDateInSeconds } from './network';
-import type * as channels from '@protocol/channels';
+import type * as channels from './channels';
export class Cookie {
private _raw: channels.NetworkCookie;
diff --git a/packages/playwright-core/src/server/credentials.ts b/packages/playwright-core/src/server/credentials.ts
index 1f70392e58..5424f9bf06 100644
--- a/packages/playwright-core/src/server/credentials.ts
+++ b/packages/playwright-core/src/server/credentials.ts
@@ -21,7 +21,7 @@ import { nullProgress } from './progress';
import type { BrowserContext } from './browserContext';
import type { InitScript } from './page';
-import type { Progress } from '@protocol/progress';
+import type { Progress } from './progress';
const kBindingName = '__pwWebAuthnBinding';
const kAuthenticatorAAGUID = Buffer.alloc(16); // All-zero AAGUID for the virtual authenticator.
diff --git a/packages/playwright-core/src/server/debugController.ts b/packages/playwright-core/src/server/debugController.ts
index 899d9b15d8..a733dd2379 100644
--- a/packages/playwright-core/src/server/debugController.ts
+++ b/packages/playwright-core/src/server/debugController.ts
@@ -30,7 +30,7 @@ import type { BrowserContext } from './browserContext';
import type { InstrumentationListener } from './instrumentation';
import type { Playwright } from './playwright';
import type { ElementInfo, Mode } from '@recorder/recorderTypes';
-import type { Progress } from '@protocol/progress';
+import type { Progress } from './progress';
import type * as actions from '@recorder/actions';
export class DebugController extends SdkObject {
diff --git a/packages/playwright-core/src/server/debugger.ts b/packages/playwright-core/src/server/debugger.ts
index 338a34635b..aec3ecbdee 100644
--- a/packages/playwright-core/src/server/debugger.ts
+++ b/packages/playwright-core/src/server/debugger.ts
@@ -20,7 +20,7 @@ import { SdkObject } from './instrumentation';
import { BrowserContext } from './browserContext';
import type { CallMetadata, InstrumentationListener } from './instrumentation';
-import type { Progress } from '@protocol/progress';
+import type { Progress } from './progress';
const symbol = Symbol('Debugger');
diff --git a/packages/playwright-core/src/server/dialog.ts b/packages/playwright-core/src/server/dialog.ts
index dba5b7b51e..5faddebf85 100644
--- a/packages/playwright-core/src/server/dialog.ts
+++ b/packages/playwright-core/src/server/dialog.ts
@@ -20,7 +20,7 @@ import { SdkObject } from './instrumentation';
import type { Instrumentation } from './instrumentation';
import type { Page } from './page';
-import type { Progress } from '@protocol/progress';
+import type { Progress } from './progress';
type OnHandle = (accept: boolean, promptText?: string) => Promise<void>;
diff --git a/packages/playwright-core/src/server/dispatchers/androidDispatcher.ts b/packages/playwright-core/src/server/dispatchers/androidDispatcher.ts
index dc554d8466..2ff7e472b1 100644
--- a/packages/playwright-core/src/server/dispatchers/androidDispatcher.ts
+++ b/packages/playwright-core/src/server/dispatchers/androidDispatcher.ts
@@ -22,8 +22,8 @@ import { SdkObject } from '../instrumentation';
import type { RootDispatcher } from './dispatcher';
import type { Android, SocketBackend } from '../android/android';
-import type * as channels from '@protocol/channels';
-import type { Progress } from '@protocol/progress';
+import type * as channels from '../channels';
+import type { Progress } from '../progress';
export class AndroidDispatcher extends Dispatcher<Android, channels.AndroidChannel, RootDispatcher> implements channels.AndroidChannel {
_type_Android = true;
@@ -104,7 +104,7 @@ export class AndroidDeviceDispatcher extends Dispatcher<AndroidDevice, channels.
await this._object.send(progress, 'swipe', params);
}
- async info(params: channels.AndroidDeviceTapParams, progress: Progress): Promise<channels.AndroidDeviceInfoResult> {
+ async info(params: channels.AndroidDeviceInfoParams, progress: Progress): Promise<channels.AndroidDeviceInfoResult> {
const info = await this._object.send(progress, 'info', params);
fixupAndroidElementInfo(info);
return { info };
diff --git a/packages/playwright-core/src/server/dispatchers/artifactDispatcher.ts b/packages/playwright-core/src/server/dispatchers/artifactDispatcher.ts
index ff4e0f868b..9d6da30e45 100644
--- a/packages/playwright-core/src/server/dispatchers/artifactDispatcher.ts
+++ b/packages/playwright-core/src/server/dispatchers/artifactDispatcher.ts
@@ -22,8 +22,8 @@ import { StreamDispatcher } from './streamDispatcher';
import type { DispatcherScope } from './dispatcher';
import type { Artifact } from '../artifact';
-import type * as channels from '@protocol/channels';
-import type { Progress } from '@protocol/progress';
+import type * as channels from '../channels';
+import type { Progress } from '../progress';
export class ArtifactDispatcher extends Dispatcher<Artifact, channels.ArtifactChannel, DispatcherScope> implements channels.ArtifactChannel {
_type_Artifact = true;
diff --git a/packages/playwright-core/src/server/dispatchers/browserContextDispatcher.ts b/packages/playwright-core/src/server/dispatchers/browserContextDispatcher.ts
index 4db2f8adfd..5c33d784d0 100644
--- a/packages/playwright-core/src/server/dispatchers/browserContextDispatcher.ts
+++ b/packages/playwright-core/src/server/dispatchers/browserContextDispatcher.ts
@@ -46,8 +46,8 @@ import type { Request, Response, RouteHandler } from '../network';
import type { InitScript, Page, PageError } from '../page';
import type { Disposable } from '../disposable';
import type { DispatcherScope } from './dispatcher';
-import type * as channels from '@protocol/channels';
-import type { Progress } from '@protocol/progress';
+import type * as channels from '../channels';
+import type { Progress } from '../progress';
import type { URLMatch } from '@isomorphic/urlMatch';
export class BrowserContextDispatcher extends Dispatcher<BrowserContext, channels.BrowserContextChannel, DispatcherScope> implements channels.BrowserContextChannel {
diff --git a/packages/playwright-core/src/server/dispatchers/browserDispatcher.ts b/packages/playwright-core/src/server/dispatchers/browserDispatcher.ts
index 6cc9b81cc1..f558a14aef 100644
--- a/packages/playwright-core/src/server/dispatchers/browserDispatcher.ts
+++ b/packages/playwright-core/src/server/dispatchers/browserDispatcher.ts
@@ -25,8 +25,8 @@ import { nullProgress } from '../progress';
import type { BrowserTypeDispatcher } from './browserTypeDispatcher';
import type { PageDispatcher } from './pageDispatcher';
import type { CRBrowser } from '../chromium/crBrowser';
-import type * as channels from '@protocol/channels';
-import type { Progress } from '@protocol/progress';
+import type * as channels from '../channels';
+import type { Progress } from '../progress';
type BrowserDispatcherOptions = {
// Do not allow to close this browser.
diff --git a/packages/playwright-core/src/server/dispatchers/browserTypeDispatcher.ts b/packages/playwright-core/src/server/dispatchers/browserTypeDispatcher.ts
index dc0d005c10..8c94c7d52b 100644
--- a/packages/playwright-core/src/server/dispatchers/browserTypeDispatcher.ts
+++ b/packages/playwright-core/src/server/dispatchers/browserTypeDispatcher.ts
@@ -21,8 +21,8 @@ import { Dispatcher } from './dispatcher';
import type { BrowserType } from '../browserType';
import type { RootDispatcher } from './dispatcher';
-import type * as channels from '@protocol/channels';
-import type { Progress } from '@protocol/progress';
+import type * as channels from '../channels';
+import type { Progress } from '../progress';
export class BrowserTypeDispatcher extends Dispatcher<BrowserType, channels.BrowserTypeChannel, RootDispatcher> implements channels.BrowserTypeChannel {
_type_BrowserType = true;
diff --git a/packages/playwright-core/src/server/dispatchers/cdpSessionDispatcher.ts b/packages/playwright-core/src/server/dispatchers/cdpSessionDispatcher.ts
index 7a89312d2f..c67ee2321f 100644
--- a/packages/playwright-core/src/server/dispatchers/cdpSessionDispatcher.ts
+++ b/packages/playwright-core/src/server/dispatchers/cdpSessionDispatcher.ts
@@ -19,8 +19,8 @@ import { CDPSession } from '../chromium/crConnection';
import type { BrowserContextDispatcher } from './browserContextDispatcher';
import type { BrowserDispatcher } from './browserDispatcher';
-import type * as channels from '@protocol/channels';
-import type { Progress } from '@protocol/progress';
+import type * as channels from '../channels';
+import type { Progress } from '../progress';
export class CDPSessionDispatcher extends Dispatcher<CDPSession, channels.CDPSessionChannel, BrowserDispatcher | BrowserContextDispatcher> implements channels.CDPSessionChannel {
_type_CDPSession = true;
diff --git a/packages/playwright-core/src/server/dispatchers/debugControllerDispatcher.ts b/packages/playwright-core/src/server/dispatchers/debugControllerDispatcher.ts
index 0c1dc7bbb6..d1b44ccc64 100644
--- a/packages/playwright-core/src/server/dispatchers/debugControllerDispatcher.ts
+++ b/packages/playwright-core/src/server/dispatchers/debugControllerDispatcher.ts
@@ -20,8 +20,8 @@ import { Dispatcher } from './dispatcher';
import type { DispatcherConnection, RootDispatcher } from './dispatcher';
import type { RegisteredListener } from '@utils/eventsHelper';
-import type * as channels from '@protocol/channels';
-import type { Progress } from '@protocol/progress';
+import type * as channels from '../channels';
+import type { Progress } from '../progress';
export class DebugControllerDispatcher extends Dispatcher<DebugController, channels.DebugControllerChannel, RootDispatcher> implements channels.DebugControllerChannel {
diff --git a/packages/playwright-core/src/server/dispatchers/debuggerDispatcher.ts b/packages/playwright-core/src/server/dispatchers/debuggerDispatcher.ts
index 6dcd7ef7ec..40626750b1 100644
--- a/packages/playwright-core/src/server/dispatchers/debuggerDispatcher.ts
+++ b/packages/playwright-core/src/server/dispatchers/debuggerDispatcher.ts
@@ -19,8 +19,8 @@ import { Dispatcher } from './dispatcher';
import { Debugger } from '../debugger';
import type { BrowserContextDispatcher } from './browserContextDispatcher';
-import type * as channels from '@protocol/channels';
-import type { Progress } from '@protocol/progress';
+import type * as channels from '../channels';
+import type { Progress } from '../progress';
export class DebuggerDispatcher extends Dispatcher<Debugger, channels.DebuggerChannel, BrowserContextDispatcher> implements channels.DebuggerChannel {
_type_Debugger = true;
diff --git a/packages/playwright-core/src/server/dispatchers/dialogDispatcher.ts b/packages/playwright-core/src/server/dispatchers/dialogDispatcher.ts
index d9a8172654..376be8b0c0 100644
--- a/packages/playwright-core/src/server/dispatchers/dialogDispatcher.ts
+++ b/packages/playwright-core/src/server/dispatchers/dialogDispatcher.ts
@@ -19,8 +19,8 @@ import { PageDispatcher } from './pageDispatcher';
import type { Dialog } from '../dialog';
import type { BrowserContextDispatcher } from './browserContextDispatcher';
-import type * as channels from '@protocol/channels';
-import type { Progress } from '@protocol/progress';
+import type * as channels from '../channels';
+import type { Progress } from '../progress';
export class DialogDispatcher extends Dispatcher<Dialog, channels.DialogChannel, BrowserContextDispatcher | PageDispatcher> implements channels.DialogChannel {
_type_Dialog = true;
diff --git a/packages/playwright-core/src/server/dispatchers/dispatcher.ts b/packages/playwright-core/src/server/dispatchers/dispatcher.ts
index 50460099f4..292c5445c1 100644
--- a/packages/playwright-core/src/server/dispatchers/dispatcher.ts
+++ b/packages/playwright-core/src/server/dispatchers/dispatcher.ts
@@ -33,7 +33,7 @@ import type { CallMetadata } from '../instrumentation';
import type { PlaywrightDispatcher } from './playwrightDispatcher';
import type { RegisteredListener } from '@utils/eventsHelper';
import type { ValidatorContext } from '../../protocol/validator';
-import type * as channels from '@protocol/channels';
+import type * as channels from '../channels';
const metadataValidator = createMetadataValidator();
const waitInfoValidator = createWaitInfoValidator();
diff --git a/packages/playwright-core/src/server/dispatchers/disposableDispatcher.ts b/packages/playwright-core/src/server/dispatchers/disposableDispatcher.ts
index c60bb45f14..f4e4011675 100644
--- a/packages/playwright-core/src/server/dispatchers/disposableDispatcher.ts
+++ b/packages/playwright-core/src/server/dispatchers/disposableDispatcher.ts
@@ -18,8 +18,8 @@ import { Dispatcher } from './dispatcher';
import type { DisposableObject } from '../disposable';
import type { DispatcherScope } from './dispatcher';
-import type * as channels from '@protocol/channels';
-import type { Progress } from '@protocol/progress';
+import type * as channels from '../channels';
+import type { Progress } from '../progress';
export class DisposableDispatcher extends Dispatcher<DisposableObject, channels.DisposableChannel, DispatcherScope> implements channels.DisposableChannel {
_type_Disposable = true;
diff --git a/packages/playwright-core/src/server/dispatchers/electronDispatcher.ts b/packages/playwright-core/src/server/dispatchers/electronDispatcher.ts
index 4dcf68d0d1..b702585583 100644
--- a/packages/playwright-core/src/server/dispatchers/electronDispatcher.ts
+++ b/packages/playwright-core/src/server/dispatchers/electronDispatcher.ts
@@ -23,8 +23,8 @@ import type { RootDispatcher } from './dispatcher';
import type { PageDispatcher } from './pageDispatcher';
import type { ConsoleMessage } from '../console';
import type { Electron } from '../electron/electron';
-import type * as channels from '@protocol/channels';
-import type { Progress } from '@protocol/progress';
+import type * as channels from '../channels';
+import type { Progress } from '../progress';
export class ElectronDispatcher extends Dispatcher<Electron, channels.ElectronChannel, RootDispatcher> implements channels.ElectronChannel {
diff --git a/packages/playwright-core/src/server/dispatchers/elementHandlerDispatcher.ts b/packages/playwright-core/src/server/dispatchers/elementHandlerDispatcher.ts
index 899c71a0db..639040930c 100644
--- a/packages/playwright-core/src/server/dispatchers/elementHandlerDispatcher.ts
+++ b/packages/playwright-core/src/server/dispatchers/elementHandlerDispatcher.ts
@@ -21,8 +21,8 @@ import { JSHandleDispatcher, parseArgument, serializeResult } from './jsHandleDi
import type { ElementHandle } from '../dom';
import type { Frame } from '../frames';
import type * as js from '../javascript';
-import type * as channels from '@protocol/channels';
-import type { Progress } from '@protocol/progress';
+import type * as channels from '../channels';
+import type { Progress } from '../progress';
export class ElementHandleDispatcher extends JSHandleDispatcher<FrameDispatcher> implements channels.ElementHandleChannel {
diff --git a/packages/playwright-core/src/server/dispatchers/frameDispatcher.ts b/packages/playwright-core/src/server/dispatchers/frameDispatcher.ts
index 8c7af45a22..f8b58d74ed 100644
--- a/packages/playwright-core/src/server/dispatchers/frameDispatcher.ts
+++ b/packages/playwright-core/src/server/dispatchers/frameDispatcher.ts
@@ -25,7 +25,7 @@ import type { Progress } from '../progress';
import type { BrowserContextDispatcher } from './browserContextDispatcher';
import type { PageDispatcher } from './pageDispatcher';
import type { NavigationEvent } from '../frames';
-import type * as channels from '@protocol/channels';
+import type * as channels from '../channels';
export class FrameDispatcher extends Dispatcher<Frame, channels.FrameChannel, BrowserContextDispatcher | PageDispatcher> implements channels.FrameChannel {
_type_Frame = true;
diff --git a/packages/playwright-core/src/server/dispatchers/jsHandleDispatcher.ts b/packages/playwright-core/src/server/dispatchers/jsHandleDispatcher.ts
index 0155587d1a..c2da3199ba 100644
--- a/packages/playwright-core/src/server/dispatchers/jsHandleDispatcher.ts
+++ b/packages/playwright-core/src/server/dispatchers/jsHandleDispatcher.ts
@@ -22,8 +22,8 @@ import type * as js from '../javascript';
import type { ElectronApplicationDispatcher } from './electronDispatcher';
import type { FrameDispatcher } from './frameDispatcher';
import type { PageDispatcher, WorkerDispatcher } from './pageDispatcher';
-import type * as channels from '@protocol/channels';
-import type { Progress } from '@protocol/progress';
+import type * as channels from '../channels';
+import type { Progress } from '../progress';
export type JSHandleDispatcherParentScope = PageDispatcher | FrameDispatcher | WorkerDispatcher | ElectronApplicationDispatcher;
diff --git a/packages/playwright-core/src/server/dispatchers/jsonPipeDispatcher.ts b/packages/playwright-core/src/server/dispatchers/jsonPipeDispatcher.ts
index 0b7e676c40..e334e18256 100644
--- a/packages/playwright-core/src/server/dispatchers/jsonPipeDispatcher.ts
+++ b/packages/playwright-core/src/server/dispatchers/jsonPipeDispatcher.ts
@@ -18,8 +18,8 @@ import { Dispatcher } from './dispatcher';
import { SdkObject } from '../instrumentation';
import type { LocalUtilsDispatcher } from './localUtilsDispatcher';
-import type * as channels from '@protocol/channels';
-import type { Progress } from '@protocol/progress';
+import type * as channels from '../channels';
+import type { Progress } from '../progress';
export class JsonPipeDispatcher extends Dispatcher<SdkObject, channels.JsonPipeChannel, LocalUtilsDispatcher> implements channels.JsonPipeChannel {
_type_JsonPipe = true;
diff --git a/packages/playwright-core/src/server/dispatchers/localUtilsDispatcher.ts b/packages/playwright-core/src/server/dispatchers/localUtilsDispatcher.ts
index e98254eb71..33268afada 100644
--- a/packages/playwright-core/src/server/dispatchers/localUtilsDispatcher.ts
+++ b/packages/playwright-core/src/server/dispatchers/localUtilsDispatcher.ts
@@ -31,7 +31,7 @@ import { WebSocketTransport } from '../transport';
import type { HarBackend } from '../harBackend';
import type { Playwright } from '../playwright';
import type { RootDispatcher } from './dispatcher';
-import type * as channels from '@protocol/channels';
+import type * as channels from '../channels';
import type * as http from 'http';
import type { HTTPRequestParams } from '@utils/network';
diff --git a/packages/playwright-core/src/server/dispatchers/networkDispatchers.ts b/packages/playwright-core/src/server/dispatchers/networkDispatchers.ts
index 4e5cf55807..8a7cfd3e84 100644
--- a/packages/playwright-core/src/server/dispatchers/networkDispatchers.ts
+++ b/packages/playwright-core/src/server/dispatchers/networkDispatchers.ts
@@ -26,8 +26,8 @@ import type { Response, Route } from '../network';
import type { BrowserContextDispatcher } from './browserContextDispatcher';
import type { RootDispatcher } from './dispatcher';
import type { PageDispatcher } from './pageDispatcher';
-import type * as channels from '@protocol/channels';
-import type { Progress } from '@protocol/progress';
+import type * as channels from '../channels';
+import type { Progress } from '../progress';
export class RequestDispatcher extends Dispatcher<Request, channels.RequestChannel, BrowserContextDispatcher | PageDispatcher | FrameDispatcher> implements channels.RequestChannel {
_type_Request: boolean;
diff --git a/packages/playwright-core/src/server/dispatchers/pageDispatcher.ts b/packages/playwright-core/src/server/dispatchers/pageDispatcher.ts
index 7fc4d2231e..531e168971 100644
--- a/packages/playwright-core/src/server/dispatchers/pageDispatcher.ts
+++ b/packages/playwright-core/src/server/dispatchers/pageDispatcher.ts
@@ -46,8 +46,8 @@ import type { InitScript } from '../page';
import type { Disposable } from '../disposable';
import type { BrowserTypeDispatcher } from './browserTypeDispatcher';
import type { ConsoleMessage } from '../console';
-import type * as channels from '@protocol/channels';
-import type { Progress } from '@protocol/progress';
+import type * as channels from '../channels';
+import type { Progress } from '../progress';
import type { URLMatch } from '@isomorphic/urlMatch';
import type { ScreencastFrame } from '../types';
import type { ScreencastClient } from '../screencast';
diff --git a/packages/playwright-core/src/server/dispatchers/playwrightDispatcher.ts b/packages/playwright-core/src/server/dispatchers/playwrightDispatcher.ts
index 09a3b1dc8d..6c12d1a1f5 100644
--- a/packages/playwright-core/src/server/dispatchers/playwrightDispatcher.ts
+++ b/packages/playwright-core/src/server/dispatchers/playwrightDispatcher.ts
@@ -33,8 +33,8 @@ import type { RegisteredListener } from '@utils/eventsHelper';
import type { AndroidDevice } from '../android/android';
import type { Browser } from '../browser';
import type { Playwright } from '../playwright';
-import type * as channels from '@protocol/channels';
-import type { Progress } from '@protocol/progress';
+import type * as channels from '../channels';
+import type { Progress } from '../progress';
export type PlaywrightDispatcherOptions = {
socksProxy?: SocksProxy;
diff --git a/packages/playwright-core/src/server/dispatchers/streamDispatcher.ts b/packages/playwright-core/src/server/dispatchers/streamDispatcher.ts
index c6b26d68d7..7ca88618d4 100644
--- a/packages/playwright-core/src/server/dispatchers/streamDispatcher.ts
+++ b/packages/playwright-core/src/server/dispatchers/streamDispatcher.ts
@@ -19,9 +19,9 @@ import { Dispatcher } from './dispatcher';
import { SdkObject } from '../instrumentation';
import type { ArtifactDispatcher } from './artifactDispatcher';
-import type * as channels from '@protocol/channels';
+import type * as channels from '../channels';
import type * as stream from 'stream';
-import type { Progress } from '@protocol/progress';
+import type { Progress } from '../progress';
class StreamSdkObject extends SdkObject {
readonly stream: stream.Readable;
diff --git a/packages/playwright-core/src/server/dispatchers/tracingDispatcher.ts b/packages/playwright-core/src/server/dispatchers/tracingDispatcher.ts
index f52c02f48a..950ab8401b 100644
--- a/packages/playwright-core/src/server/dispatchers/tracingDispatcher.ts
+++ b/packages/playwright-core/src/server/dispatchers/tracingDispatcher.ts
@@ -22,8 +22,8 @@ import type { BrowserContextDispatcher } from './browserContextDispatcher';
import type { APIRequestContextDispatcher } from './networkDispatchers';
import type { PageDispatcher } from './pageDispatcher';
import type { Tracing } from '../trace/recorder/tracing';
-import type * as channels from '@protocol/channels';
-import type { Progress } from '@protocol/progress';
+import type * as channels from '../channels';
+import type { Progress } from '../progress';
export class TracingDispatcher extends Dispatcher<Tracing, channels.TracingChannel, BrowserContextDispatcher | APIRequestContextDispatcher> implements channels.TracingChannel {
_type_Tracing = true;
diff --git a/packages/playwright-core/src/server/dispatchers/webSocketRouteDispatcher.ts b/packages/playwright-core/src/server/dispatchers/webSocketRouteDispatcher.ts
index dc33c47af9..6400947ac0 100644
--- a/packages/playwright-core/src/server/dispatchers/webSocketRouteDispatcher.ts
+++ b/packages/playwright-core/src/server/dispatchers/webSocketRouteDispatcher.ts
@@ -27,8 +27,8 @@ import type { BrowserContext } from '../browserContext';
import type { DispatcherConnection } from './dispatcher';
import type { Frame } from '../frames';
import type * as ws from '@injected/webSocketMock';
-import type * as channels from '@protocol/channels';
-import type { Progress } from '@protocol/progress';
+import type * as channels from '../channels';
+import type { Progress } from '../progress';
import type { InitScript, PageBinding } from '../page';
export class WebSocketRouteDispatcher extends Dispatcher<SdkObject, channels.WebSocketRouteChannel, PageDispatcher | BrowserContextDispatcher> implements channels.WebSocketRouteChannel {
diff --git a/packages/playwright-core/src/server/dispatchers/writableStreamDispatcher.ts b/packages/playwright-core/src/server/dispatchers/writableStreamDispatcher.ts
index ec44c2f227..3528c13a2e 100644
--- a/packages/playwright-core/src/server/dispatchers/writableStreamDispatcher.ts
+++ b/packages/playwright-core/src/server/dispatchers/writableStreamDispatcher.ts
@@ -20,8 +20,8 @@ import { Dispatcher } from './dispatcher';
import { SdkObject } from '../instrumentation';
import type { BrowserContextDispatcher } from './browserContextDispatcher';
-import type * as channels from '@protocol/channels';
-import type { Progress } from '@protocol/progress';
+import type * as channels from '../channels';
+import type { Progress } from '../progress';
class WritableStreamSdkObject extends SdkObject {
readonly streamOrDirectory: fs.WriteStream | string;
diff --git a/packages/playwright-core/src/server/dom.ts b/packages/playwright-core/src/server/dom.ts
index 3624a05691..872e294f1b 100644
--- a/packages/playwright-core/src/server/dom.ts
+++ b/packages/playwright-core/src/server/dom.ts
@@ -30,7 +30,7 @@ import type { Page } from './page';
import type { Progress } from './progress';
import type { ScreenshotOptions } from './screenshotter';
import type * as types from './types';
-import type * as channels from '@protocol/channels';
+import type * as channels from './channels';
export type InputFilesItems = {
filePayloads?: types.FilePayload[],
diff --git a/packages/playwright-core/src/server/electron/electron.ts b/packages/playwright-core/src/server/electron/electron.ts
index 4064465579..89485c74f3 100644
--- a/packages/playwright-core/src/server/electron/electron.ts
+++ b/packages/playwright-core/src/server/electron/electron.ts
@@ -47,7 +47,7 @@ import type { Page } from '../page';
import type { Playwright } from '../playwright';
import type { Progress } from '../progress';
import type * as types from '../types';
-import type * as channels from '@protocol/channels';
+import type * as channels from '../channels';
import type * as childProcess from 'child_process';
import type { BrowserWindow } from 'electron';
diff --git a/packages/playwright-core/src/server/errors.ts b/packages/playwright-core/src/server/errors.ts
index 67ebff9e79..1728d28185 100644
--- a/packages/playwright-core/src/server/errors.ts
+++ b/packages/playwright-core/src/server/errors.ts
@@ -17,7 +17,7 @@
import { isError } from '@isomorphic/rtti';
import { parseSerializedValue, serializeValue } from '../protocol/serializers';
-import type { SerializedError } from '@protocol/channels';
+import type { SerializedError } from './channels';
class CustomError extends Error {
constructor(message: string) {
diff --git a/packages/playwright-core/src/server/fetch.ts b/packages/playwright-core/src/server/fetch.ts
index 78bfa6b864..f048bd2a36 100644
--- a/packages/playwright-core/src/server/fetch.ts
+++ b/packages/playwright-core/src/server/fetch.ts
@@ -45,7 +45,7 @@ import type * as types from './types';
import type { HeadersArray, ProxySettings } from './types';
import type { HTTPCredentials } from '../../types/types';
import type { RegisteredListener } from '@utils/eventsHelper';
-import type * as channels from '@protocol/channels';
+import type * as channels from './channels';
import type * as har from '@trace/har';
import type { LookupAddress } from 'dns';
import type { Readable, TransformCallback } from 'stream';
diff --git a/packages/playwright-core/src/server/fileUploadUtils.ts b/packages/playwright-core/src/server/fileUploadUtils.ts
index 033c0bed04..2ee26cca50 100644
--- a/packages/playwright-core/src/server/fileUploadUtils.ts
+++ b/packages/playwright-core/src/server/fileUploadUtils.ts
@@ -23,7 +23,7 @@ import type { WritableStreamDispatcher } from './dispatchers/writableStreamDispa
import type { InputFilesItems } from './dom';
import type { Frame } from './frames';
import type * as types from './types';
-import type * as channels from '@protocol/channels';
+import type * as channels from './channels';
// Keep in sync with the client.
export const fileUploadSizeLimit = 50 * 1024 * 1024;
diff --git a/packages/playwright-core/src/server/firefox/ffBrowser.ts b/packages/playwright-core/src/server/firefox/ffBrowser.ts
index 59e8c0c716..120e448cd4 100644
--- a/packages/playwright-core/src/server/firefox/ffBrowser.ts
+++ b/packages/playwright-core/src/server/firefox/ffBrowser.ts
@@ -30,7 +30,7 @@ import type { ConnectionTransport } from '../transport';
import type * as types from '../types';
import type { FFSession } from './ffConnection';
import type { Protocol } from './protocol';
-import type * as channels from '@protocol/channels';
+import type * as channels from '../channels';
export class FFBrowser extends Browser {
private _connection: FFConnection;
diff --git a/packages/playwright-core/src/server/firefox/firefox.ts b/packages/playwright-core/src/server/firefox/firefox.ts
index 14c43a327c..3e0b505951 100644
--- a/packages/playwright-core/src/server/firefox/firefox.ts
+++ b/packages/playwright-core/src/server/firefox/firefox.ts
@@ -30,8 +30,8 @@ import type { ConnectionTransport } from '../transport';
import type * as types from '../types';
import type { RecentLogsCollector } from '@utils/debugLogger';
import type { BrowserContext } from '../browserContext';
-import type * as channels from '@protocol/channels';
-import type { Progress } from '@protocol/progress';
+import type * as channels from '../channels';
+import type { Progress } from '../progress';
export class Firefox extends BrowserType {
private _bidiFirefox: BrowserType;
diff --git a/packages/playwright-core/src/server/formData.ts b/packages/playwright-core/src/server/formData.ts
index e494003e2d..b0ef5097aa 100644
--- a/packages/playwright-core/src/server/formData.ts
+++ b/packages/playwright-core/src/server/formData.ts
@@ -15,7 +15,7 @@
*/
import mime from 'mime';
-import type * as channels from '@protocol/channels';
+import type * as channels from './channels';
export class MultipartFormData {
private readonly _boundary: string;
diff --git a/packages/playwright-core/src/server/frames.ts b/packages/playwright-core/src/server/frames.ts
index 7afcb5a7f5..1628143cb2 100644
--- a/packages/playwright-core/src/server/frames.ts
+++ b/packages/playwright-core/src/server/frames.ts
@@ -47,7 +47,7 @@ import type { Progress } from './progress';
import type { ScreenshotOptions } from './screenshotter';
import type { RegisteredListener } from '@utils/eventsHelper';
import type { ParsedSelector } from '@isomorphic/selectorParser';
-import type * as channels from '@protocol/channels';
+import type * as channels from './channels';
type ContextData = {
contextPromise: ManualPromise<dom.FrameExecutionContext | { destroyedReason: string }>;
diff --git a/packages/playwright-core/src/server/har/harRecorder.ts b/packages/playwright-core/src/server/har/harRecorder.ts
index c9f40f0136..31012fd7aa 100644
--- a/packages/playwright-core/src/server/har/harRecorder.ts
+++ b/packages/playwright-core/src/server/har/harRecorder.ts
@@ -25,7 +25,7 @@ import type { BrowserContext } from '../browserContext';
import type { HarTracerDelegate } from './harTracer';
import type { Page } from '../page';
import type { NameValue } from '@isomorphic/types';
-import type * as channels from '@protocol/channels';
+import type * as channels from '../channels';
import type * as har from '@trace/har';
export class HarRecorder implements HarTracerDelegate {
diff --git a/packages/playwright-core/src/server/instrumentation.ts b/packages/playwright-core/src/server/instrumentation.ts
index 729a2ec7d7..c5730e81a8 100644
--- a/packages/playwright-core/src/server/instrumentation.ts
+++ b/packages/playwright-core/src/server/instrumentation.ts
@@ -19,6 +19,7 @@ import { EventEmitter } from 'events';
import { createGuid } from '@utils/crypto';
import { debugLogger } from '@utils/debugLogger';
+import type { SerializedError } from './channels';
import type { Browser } from './browser';
import type { BrowserContext } from './browserContext';
import type { BrowserType } from './browserType';
@@ -29,8 +30,6 @@ import type { Frame } from './frames';
import type { Page, Worker } from './page';
import type { Playwright } from './playwright';
import type * as types from './types';
-import type { CallMetadata } from '@protocol/callMetadata';
-export type { CallMetadata } from '@protocol/callMetadata';
import type { LogName } from '@utils/debugLogger';
export type Attribution = {
@@ -82,6 +81,30 @@ export function createRootSdkObject() {
export type AddListenerOptions = { order?: 'last' };
+export type CallMetadata = {
+ id: string;
+ startTime: number;
+ endTime: number;
+ pauseStartTime?: number;
+ pauseEndTime?: number;
+ type: string;
+ method: string;
+ params: any;
+ title?: string;
+ // Client is making an internal call that should not show up in
+ // the inspector or trace.
+ internal?: boolean;
+ // Test runner step id.
+ stepId?: string;
+ location?: { file: string, line?: number, column?: number };
+ log: string[];
+ error?: SerializedError;
+ result?: any;
+ objectId?: string;
+ pageId?: string;
+ frameId?: string;
+};
+
export interface Instrumentation {
addListener(listener: InstrumentationListener, context: BrowserContext | APIRequestContext | null, options?: AddListenerOptions): void;
removeListener(listener: InstrumentationListener): void;
diff --git a/packages/playwright-core/src/server/javascript.ts b/packages/playwright-core/src/server/javascript.ts
index e4128a0e8e..17aaf1683e 100644
--- a/packages/playwright-core/src/server/javascript.ts
+++ b/packages/playwright-core/src/server/javascript.ts
@@ -21,7 +21,7 @@ import { SdkObject } from './instrumentation';
import * as rawUtilityScriptSource from '../generated/utilityScriptSource';
import type * as dom from './dom';
-import type { Progress } from '@protocol/progress';
+import type { Progress } from './progress';
import type { UtilityScript } from '@injected/utilityScript';
interface TaggedAsJSHandle<T> {
diff --git a/packages/playwright-core/src/server/localUtils.ts b/packages/playwright-core/src/server/localUtils.ts
index 8da82e56b2..c2b36758a6 100644
--- a/packages/playwright-core/src/server/localUtils.ts
+++ b/packages/playwright-core/src/server/localUtils.ts
@@ -27,10 +27,10 @@ import { calculateSha1 } from '@utils/crypto';
import { ZipFile } from '@utils/zipFile';
import { removeFolders, resolveWithinRoot } from '@utils/fileUtils';
import { HarBackend } from './harBackend';
-import type * as channels from '@protocol/channels';
+import type * as channels from './channels';
import type * as har from '@trace/har';
import type EventEmitter from 'events';
-import type { Progress } from '@protocol/progress';
+import type { Progress } from './progress';
export type StackSession = {
diff --git a/packages/playwright-core/src/server/network.ts b/packages/playwright-core/src/server/network.ts
index db00d5a703..457efb5717 100644
--- a/packages/playwright-core/src/server/network.ts
+++ b/packages/playwright-core/src/server/network.ts
@@ -26,8 +26,8 @@ import type * as pages from './page';
import type * as types from './types';
import type { NormalizedContinueOverrides } from './types';
import type { HeadersArray, NameValue } from '@isomorphic/types';
-import type * as channels from '@protocol/channels';
-import type { Progress } from '@protocol/progress';
+import type * as channels from './channels';
+import type { Progress } from './progress';
export function filterCookies(cookies: channels.NetworkCookie[], urls: string[]): channels.NetworkCookie[] {
diff --git a/packages/playwright-core/src/server/page.ts b/packages/playwright-core/src/server/page.ts
index c26d5d39dd..88407afa0a 100644
--- a/packages/playwright-core/src/server/page.ts
+++ b/packages/playwright-core/src/server/page.ts
@@ -51,7 +51,7 @@ import type { Progress } from './progress';
import type { ScreenshotOptions } from './screenshotter';
import type * as types from './types';
import type { ImageComparatorOptions } from '@utils/comparators';
-import type * as channels from '@protocol/channels';
+import type * as channels from './channels';
import type { BindingPayload } from '@injected/bindingsController';
import type { SelectorInfo } from './frameSelectors';
diff --git a/packages/playwright-core/src/server/progress.ts b/packages/playwright-core/src/server/progress.ts
index c55bcc0c09..22787d0cee 100644
--- a/packages/playwright-core/src/server/progress.ts
+++ b/packages/playwright-core/src/server/progress.ts
@@ -20,10 +20,19 @@ import { monotonicTime } from '@isomorphic/time';
import { debugLogger } from '@utils/debugLogger';
import { TimeoutError } from './errors';
-import type { Progress } from '@protocol/progress';
import type { CallMetadata, SdkObject } from './instrumentation';
-export type { Progress } from '@protocol/progress';
+export interface Progress {
+ timeout: number;
+ deadline: number;
+ disableTimeout(): void;
+ log(message: string): void;
+ race<T>(promise: Promise<T> | Promise<T>[]): Promise<T>;
+ wait(timeout: number): Promise<void>; // timeout = 0 here means "wait 0 ms", not forever.
+ signal: AbortSignal;
+ metadata: CallMetadata;
+ setAllowConcurrentOrNestedRaces(allow: boolean): void;
+}
export class ProgressController {
private _forceAbortPromise = new ManualPromise<any>();
diff --git a/packages/playwright-core/src/server/recorder.ts b/packages/playwright-core/src/server/recorder.ts
index 925520399b..360431911b 100644
--- a/packages/playwright-core/src/server/recorder.ts
+++ b/packages/playwright-core/src/server/recorder.ts
@@ -39,7 +39,7 @@ import type { CallMetadata, InstrumentationListener, SdkObject } from './instrum
import type { Point } from '@isomorphic/types';
import type { AriaTemplateNode } from '@isomorphic/ariaSnapshot';
import type { Progress } from './progress';
-import type * as channels from '@protocol/channels';
+import type * as channels from './channels';
import type * as actions from '@recorder/actions';
import type { CallLog, CallLogStatus, ElementInfo, Mode, OverlayState, Source, UIState } from '@recorder/recorderTypes';
import type { RegisteredListener } from '@utils/eventsHelper';
diff --git a/packages/playwright-core/src/server/recorder/recorderApp.ts b/packages/playwright-core/src/server/recorder/recorderApp.ts
index f85f695741..9e6b37e7c5 100644
--- a/packages/playwright-core/src/server/recorder/recorderApp.ts
+++ b/packages/playwright-core/src/server/recorder/recorderApp.ts
@@ -34,7 +34,7 @@ import type { Page } from '../page';
import type * as actions from '@recorder/actions';
import type { CallLog, ElementInfo, Mode, RecorderBackend, RecorderFrontend, Source } from '@recorder/recorderTypes';
import type { Language, LanguageGeneratorOptions } from '../codegen/types';
-import type * as channels from '@protocol/channels';
+import type * as channels from '../channels';
import type { Progress } from '../progress';
import type { AriaTemplateNode } from '@isomorphic/ariaSnapshot';
diff --git a/packages/playwright-core/src/server/recorder/recorderRunner.ts b/packages/playwright-core/src/server/recorder/recorderRunner.ts
index 1123b63fa4..125e748396 100644
--- a/packages/playwright-core/src/server/recorder/recorderRunner.ts
+++ b/packages/playwright-core/src/server/recorder/recorderRunner.ts
@@ -14,7 +14,6 @@
* limitations under the License.
*/
-import { serializeExpectedTextValues } from '@isomorphic/expectUtils';
import { toKeyboardModifiers } from '../codegen/language';
import { buildFullSelector, mainFrameForAction } from './recorderUtils';
import { Progress } from '../progress';
@@ -105,7 +104,7 @@ async function performActionImpl(progress: Progress, mainFrame: Frame, actionInC
await mainFrame.expect(progress, selector, {
selector,
expression: 'to.have.text',
- expectedText: serializeExpectedTextValues([action.text], { matchSubstring: true, normalizeWhiteSpace: true }),
+ expectedText: [{ string: action.text, matchSubstring: true, normalizeWhiteSpace: true }],
isNot: false,
});
return;
diff --git a/packages/playwright-core/src/server/recorder/recorderUtils.ts b/packages/playwright-core/src/server/recorder/recorderUtils.ts
index fca4472208..fcbf6c835f 100644
--- a/packages/playwright-core/src/server/recorder/recorderUtils.ts
+++ b/packages/playwright-core/src/server/recorder/recorderUtils.ts
@@ -24,7 +24,7 @@ import type { CallMetadata } from '../instrumentation';
import type { Page } from '../page';
import type * as actions from '@recorder/actions';
import type { CallLog, CallLogStatus } from '@recorder/recorderTypes';
-import type { Progress } from '@protocol/progress';
+import type { Progress } from '../progress';
export function buildFullSelector(framePath: string[], selector: string) {
return [...framePath, selector].join(' >> internal:control=enter-frame >> ');
diff --git a/packages/playwright-core/src/server/selectors.ts b/packages/playwright-core/src/server/selectors.ts
index 3b90294deb..810dc4640f 100644
--- a/packages/playwright-core/src/server/selectors.ts
+++ b/packages/playwright-core/src/server/selectors.ts
@@ -18,7 +18,7 @@ import { InvalidSelectorError, parseSelector, stringifySelector, visitAllSelect
import { createGuid } from '@utils/crypto';
import type { ParsedSelector } from '@isomorphic/selectorParser';
-import type * as channels from '@protocol/channels';
+import type * as channels from './channels';
export class Selectors {
private readonly _builtinEngines: Set<string>;
diff --git a/packages/playwright-core/src/server/socksClientCertificatesInterceptor.ts b/packages/playwright-core/src/server/socksClientCertificatesInterceptor.ts
index 3174827e28..412dda56cc 100644
--- a/packages/playwright-core/src/server/socksClientCertificatesInterceptor.ts
+++ b/packages/playwright-core/src/server/socksClientCertificatesInterceptor.ts
@@ -32,7 +32,7 @@ import { verifyClientCertificates } from './browserContext';
import type * as types from './types';
import type { SocksSocketClosedPayload, SocksSocketDataPayload, SocksSocketRequestedPayload } from '@utils/socksProxy';
import type https from 'https';
-import type { Progress } from '@protocol/progress';
+import type { Progress } from './progress';
let dummyServerTlsOptions: tls.TlsOptions | undefined = undefined;
function loadDummyServerCertsIfNeeded() {
diff --git a/packages/playwright-core/src/server/socksInterceptor.ts b/packages/playwright-core/src/server/socksInterceptor.ts
index c410ff19bc..9d325dfb31 100644
--- a/packages/playwright-core/src/server/socksInterceptor.ts
+++ b/packages/playwright-core/src/server/socksInterceptor.ts
@@ -22,7 +22,7 @@ import { ValidationError, findValidator } from '../protocol/validator';
import type { WebSocketTransport } from './transport';
import type { ValidatorContext } from '../protocol/validator';
-import type * as channels from '@protocol/channels';
+import type * as channels from '../client/channels'; // this file lives in server/, but since it runs via localUtils, client channels is still correct.
export class SocksInterceptor {
private _handler: socks.SocksProxyHandler;
diff --git a/packages/playwright-core/src/server/trace/recorder/tracing.ts b/packages/playwright-core/src/server/trace/recorder/tracing.ts
index 84af09c2b0..77156a7aa4 100644
--- a/packages/playwright-core/src/server/trace/recorder/tracing.ts
+++ b/packages/playwright-core/src/server/trace/recorder/tracing.ts
@@ -48,11 +48,11 @@ import type { APIRequestContext } from '../../fetch';
import type { HarTracerDelegate } from '../../har/harTracer';
import type { CallMetadata, InstrumentationListener } from '../../instrumentation';
import type { PageError } from '../../page';
-import type { RecordHarOptions, StackFrame, TracingTracingStopChunkParams } from '@protocol/channels';
+import type { RecordHarOptions, StackFrame, TracingTracingStopChunkParams } from '../../channels';
import type * as har from '@trace/har';
import type { FrameSnapshot } from '@trace/snapshot';
import type * as trace from '@trace/trace';
-import type { Progress } from '@protocol/progress';
+import type { Progress } from '../../progress';
import type * as types from '../../types';
import type { Screencast, ScreencastClient } from '../../screencast';
diff --git a/packages/playwright-core/src/server/types.ts b/packages/playwright-core/src/server/types.ts
index 25c0f81206..33efd23934 100644
--- a/packages/playwright-core/src/server/types.ts
+++ b/packages/playwright-core/src/server/types.ts
@@ -17,7 +17,7 @@
import type { HeadersArray, Point, Size } from '@isomorphic/types';
export type { HeadersArray, Point, Quad, Rect, Size } from '@isomorphic/types';
-import type * as channels from '@protocol/channels';
+import type * as channels from './channels';
import type { ProxySettings } from '@utils/network';
export type StrictOptions = {
diff --git a/packages/playwright-core/src/server/webkit/webkit.ts b/packages/playwright-core/src/server/webkit/webkit.ts
index 62b4bcca4b..d4df20b828 100644
--- a/packages/playwright-core/src/server/webkit/webkit.ts
+++ b/packages/playwright-core/src/server/webkit/webkit.ts
@@ -33,7 +33,7 @@ import type { Progress } from '../progress';
import type { ConnectionTransport } from '../transport';
import type * as types from '../types';
import type { RecentLogsCollector } from '@utils/debugLogger';
-import type * as channels from '@protocol/channels';
+import type * as channels from '../channels';
// Must be kept in sync with bin/install_webkit_wsl.ps1 that provisions the distribution.
const kWSLDistribution = 'playwright';
diff --git a/packages/playwright-core/src/server/webkit/webview/wvBrowser.ts b/packages/playwright-core/src/server/webkit/webview/wvBrowser.ts
index 509890ce30..313f3ab0ae 100644
--- a/packages/playwright-core/src/server/webkit/webview/wvBrowser.ts
+++ b/packages/playwright-core/src/server/webkit/webview/wvBrowser.ts
@@ -37,7 +37,7 @@ import type { SdkObject } from '../../instrumentation';
import type { InitScript, Page } from '../../page';
import type { ProtocolRequest, ProtocolResponse } from '../../transport';
import type * as types from '../../types';
-import type * as channels from '@protocol/channels';
+import type * as channels from '../../channels';
import type { Progress } from '../../progress';
import type { ConnectOverCDPTransport } from '../../../../types/types.d.ts';
diff --git a/packages/playwright-core/src/server/webkit/webview/wvPage.ts b/packages/playwright-core/src/server/webkit/webview/wvPage.ts
index 54ac344451..4d249e705a 100644
--- a/packages/playwright-core/src/server/webkit/webview/wvPage.ts
+++ b/packages/playwright-core/src/server/webkit/webview/wvPage.ts
@@ -47,7 +47,7 @@ import type { JSHandle } from '../../javascript';
import type { InitScript, PageDelegate } from '../../page';
import type { Progress } from '../../progress';
import type * as types from '../../types';
-import type { PagePdfParams } from '@protocol/channels';
+import type { PagePdfParams } from '../../channels';
export class WVPage implements PageDelegate {
readonly rawMouse: RawMouseImpl;
diff --git a/packages/playwright-core/src/server/webkit/wkBrowser.ts b/packages/playwright-core/src/server/webkit/wkBrowser.ts
index ffdd5d18e9..a46a7e5172 100644
--- a/packages/playwright-core/src/server/webkit/wkBrowser.ts
+++ b/packages/playwright-core/src/server/webkit/wkBrowser.ts
@@ -30,7 +30,7 @@ import type { ConnectionTransport } from '../transport';
import type * as types from '../types';
import type { Protocol } from './protocol';
import type { PageProxyMessageReceivedPayload } from './wkConnection';
-import type * as channels from '@protocol/channels';
+import type * as channels from '../channels';
const BROWSER_VERSION = '26.5';
const DEFAULT_USER_AGENT = `Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/${BROWSER_VERSION} Safari/605.1.15`;
diff --git a/packages/playwright/src/matchers/expect.ts b/packages/playwright/src/matchers/expect.ts
index c4de97609d..72a6c424e5 100644
--- a/packages/playwright/src/matchers/expect.ts
+++ b/packages/playwright/src/matchers/expect.ts
@@ -88,7 +88,7 @@ import type { MatcherContext, MatchersObject, RawMatcherFn } from './expectLibra
import type { MatcherAttachment, MatcherResult } from './matcherHint';
import type { ExpectMatcherStateInternal } from './matchers';
import type { Expect } from '../../types/test';
-import type { StackFrame } from '@protocol/channels';
+import type { StackFrame } from '@isomorphic/stackTrace';
interface ExpectStep {
complete(result: {
diff --git a/packages/playwright/src/matchers/matcherHint.ts b/packages/playwright/src/matchers/matcherHint.ts
index bf8dd14fd6..4799c9962e 100644
--- a/packages/playwright/src/matchers/matcherHint.ts
+++ b/packages/playwright/src/matchers/matcherHint.ts
@@ -18,7 +18,7 @@ import util from 'util';
import { stringifyStackFrames } from '@isomorphic/stackTrace';
-import type { StackFrame } from '@protocol/channels';
+import type { StackFrame } from '@isomorphic/stackTrace';
export type MatcherAttachment = { name: string; contentType: string; path?: string; body?: string | Buffer };
diff --git a/packages/playwright/src/matchers/matchers.ts b/packages/playwright/src/matchers/matchers.ts
index d2fedd70cd..8cd4583b7a 100644
--- a/packages/playwright/src/matchers/matchers.ts
+++ b/packages/playwright/src/matchers/matchers.ts
@@ -21,7 +21,6 @@ import { isRegExp } from '@isomorphic/rtti';
import { isString } from '@isomorphic/stringUtils';
import { pollAgainstDeadline } from '@isomorphic/timeoutRunner';
import { constructURLBasedOnBaseURL, isURLPattern } from '@isomorphic/urlMatch';
-import { serializeExpectedTextValues } from '@isomorphic/expectUtils';
import { monotonicTime } from '@isomorphic/index';
import { expectTypes, formatMatcherMessage, MatcherResult } from './matcherHint';
@@ -45,6 +44,26 @@ export type ExpectMatcherStateInternal = Omit<ExpectMatcherState, 'utils'> & {
utils: ExpectMatcherUtils & InternalMatcherUtils;
};
+type ExpectedTextValue = {
+ string?: string,
+ regexSource?: string,
+ regexFlags?: string,
+ matchSubstring?: boolean,
+ ignoreCase?: boolean,
+ normalizeWhiteSpace?: boolean,
+};
+
+function serializeExpectedTextValues(items: (string | RegExp)[], options: { matchSubstring?: boolean, normalizeWhiteSpace?: boolean, ignoreCase?: boolean } = {}): ExpectedTextValue[] {
+ return items.map(i => ({
+ string: isString(i) ? i : undefined,
+ regexSource: isRegExp(i) ? i.source : undefined,
+ regexFlags: isRegExp(i) ? i.flags : undefined,
+ matchSubstring: options.matchSubstring,
+ ignoreCase: options.ignoreCase,
+ normalizeWhiteSpace: options.normalizeWhiteSpace,
+ }));
+}
+
export interface LocatorEx extends Locator {
_selector: string;
_expect(expression: string, options: FrameExpectParams): Promise<ExpectResult>;
diff --git a/packages/playwright/src/util.ts b/packages/playwright/src/util.ts
index 6f6063de52..c0c36ec252 100644
--- a/packages/playwright/src/util.ts
+++ b/packages/playwright/src/util.ts
@@ -27,10 +27,9 @@ import { isRegExp } from '@isomorphic/rtti';
import { parseStackFrame, stringifyStackFrames } from '@isomorphic/stackTrace';
import { ansiRegex, isString, stripAnsiEscapes } from '@isomorphic/stringUtils';
-import type { RawStack } from '@isomorphic/stackTrace';
+import type { RawStack, StackFrame } from '@isomorphic/stackTrace';
import type { Location } from './../types/testReporter';
import type { TestInfoError } from './../types/test';
-import type { StackFrame } from '@protocol/channels';
import type { TestCase } from './common/test';
const PLAYWRIGHT_TEST_PATH = path.join(__dirname, '..');
diff --git a/packages/playwright/src/worker/testInfo.ts b/packages/playwright/src/worker/testInfo.ts
index 42b3a7a902..58ee006bee 100644
--- a/packages/playwright/src/worker/testInfo.ts
+++ b/packages/playwright/src/worker/testInfo.ts
@@ -35,7 +35,7 @@ import type { RunnableDescription } from './timeoutManager';
import type { FullProject, TestInfo, TestInfoError, TestStatus, TestStepInfo, TestAnnotation } from '../../types/test';
import type { FullConfig, Location } from '../../types/testReporter';
import type { config as commonConfig, FullConfigInternal, test as testNs } from '../common';
-import type { StackFrame } from '@protocol/channels';
+import type { StackFrame } from '@isomorphic/stackTrace';
export type TestStepCategory = 'expect' | 'fixture' | 'hook' | 'pw:api' | 'test.step' | 'test.attach';
diff --git a/packages/playwright/src/worker/testTracing.ts b/packages/playwright/src/worker/testTracing.ts
index 70b6a5c28e..d6373496f5 100644
--- a/packages/playwright/src/worker/testTracing.ts
+++ b/packages/playwright/src/worker/testTracing.ts
@@ -29,7 +29,7 @@ import { filteredStackTrace } from '../util';
import type { TestStepCategory, TestInfoImpl } from './testInfo';
import type { PlaywrightWorkerOptions, TestInfo, TestInfoError, TraceMode } from '../../types/test';
-import type { SerializedError, StackFrame } from '@protocol/channels';
+import type { StackFrame } from '@isomorphic/stackTrace';
import type * as trace from '@trace/trace';
import type EventEmitter from 'events';
@@ -291,7 +291,7 @@ export class TestTracing {
});
}
- appendAfterActionForStep(callId: string, error?: SerializedError['error'], attachments: Attachment[] = [], annotations?: trace.AfterActionTraceEventAnnotation[]) {
+ appendAfterActionForStep(callId: string, error?: trace.SerializedError['error'], attachments: Attachment[] = [], annotations?: trace.AfterActionTraceEventAnnotation[]) {
this._appendTraceEvent({
type: 'after',
callId,
diff --git a/packages/protocol/src/callMetadata.d.ts b/packages/protocol/src/callMetadata.d.ts
deleted file mode 100644
index 9fea3cea2a..0000000000
--- a/packages/protocol/src/callMetadata.d.ts
+++ /dev/null
@@ -1,41 +0,0 @@
-/**
- * Copyright (c) Microsoft Corporation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import type { SerializedError } from './channels';
-
-export type CallMetadata = {
- id: string;
- startTime: number;
- endTime: number;
- pauseStartTime?: number;
- pauseEndTime?: number;
- type: string;
- method: string;
- params: any;
- title?: string;
- // Client is making an internal call that should not show up in
- // the inspector or trace.
- internal?: boolean;
- // Test runner step id.
- stepId?: string;
- location?: { file: string, line?: number, column?: number };
- log: string[];
- error?: SerializedError;
- result?: any;
- objectId?: string;
- pageId?: string;
- frameId?: string;
-};
diff --git a/packages/protocol/src/progress.d.ts b/packages/protocol/src/progress.d.ts
deleted file mode 100644
index 72280b317b..0000000000
--- a/packages/protocol/src/progress.d.ts
+++ /dev/null
@@ -1,43 +0,0 @@
-/**
- * Copyright (c) Microsoft Corporation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import type { CallMetadata } from './callMetadata';
-
-// Most server operations are run inside a Progress instance, which is conceptually
-// similar to a cancellation token.
-//
-// Each method that takes a Progress must result in one of the three outcomes:
-// - It finishes successfully, returning a value, before the Progress is aborted.
-// - It throws some error, before the Progress is aborted.
-// - It throws the Progress's aborted error, because the Progress was aborted before
-// the method could finish.
-//
-// As a rule of thumb, the above is achieved by:
-// - Passing the Progress instance when awaiting other methods.
-// - Using `progress.race()` when awaiting other methods that do not take a Progress argument.
-// In this case, it is important that awaited method has no side effects, for example
-// it is a read-only browser protocol call.
-export interface Progress {
- timeout: number;
- deadline: number;
- disableTimeout(): void;
- log(message: string): void;
- race<T>(promise: Promise<T> | Promise<T>[]): Promise<T>;
- wait(timeout: number): Promise<void>; // timeout = 0 here means "wait 0 ms", not forever.
- signal: AbortSignal;
- metadata: CallMetadata;
- setAllowConcurrentOrNestedRaces(allow: boolean): void;
-}
diff --git a/packages/recorder/vite.config.ts b/packages/recorder/vite.config.ts
index 921cb4b575..50663c4deb 100644
--- a/packages/recorder/vite.config.ts
+++ b/packages/recorder/vite.config.ts
@@ -27,7 +27,6 @@ export default defineConfig({
resolve: {
alias: {
'@isomorphic': path.resolve(__dirname, '../isomorphic'),
- '@protocol': path.resolve(__dirname, '../protocol/src'),
'@web': path.resolve(__dirname, '../web/src'),
},
},
diff --git a/packages/trace-viewer/src/ui/callTab.tsx b/packages/trace-viewer/src/ui/callTab.tsx
index 69da4e94c1..fccc857224 100644
--- a/packages/trace-viewer/src/ui/callTab.tsx
+++ b/packages/trace-viewer/src/ui/callTab.tsx
@@ -14,8 +14,7 @@
* limitations under the License.
*/
-import type { SerializedValue } from '@protocol/channels';
-import type { ActionTraceEvent } from '@trace/trace';
+import type { ActionTraceEvent, SerializedValue } from '@trace/trace';
import { clsx } from '@web/uiUtils';
import { msToString } from '@isomorphic/formatUtils';
import * as React from 'react';
diff --git a/packages/trace-viewer/src/ui/consoleTab.tsx b/packages/trace-viewer/src/ui/consoleTab.tsx
index 16d5809d2b..e82f80f8d4 100644
--- a/packages/trace-viewer/src/ui/consoleTab.tsx
+++ b/packages/trace-viewer/src/ui/consoleTab.tsx
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-import type * as channels from '@protocol/channels';
+import type { SerializedError } from '@trace/trace';
import * as React from 'react';
import './consoleTab.css';
import type { TraceModel } from '@isomorphic/trace/traceModel';
@@ -31,7 +31,7 @@ export type ConsoleEntry = {
bodyString: string;
location: string;
},
- browserError?: channels.SerializedError;
+ browserError?: SerializedError;
nodeMessage?: {
html: string;
},
diff --git a/packages/trace-viewer/src/ui/sourceTab.tsx b/packages/trace-viewer/src/ui/sourceTab.tsx
index 4cbca74d0c..a6c9ad9531 100644
--- a/packages/trace-viewer/src/ui/sourceTab.tsx
+++ b/packages/trace-viewer/src/ui/sourceTab.tsx
@@ -22,7 +22,7 @@ import { StackTraceView } from './stackTrace';
import { CodeMirrorWrapper } from '@web/components/codeMirrorWrapper';
import type { SourceHighlight } from '@web/components/codeMirrorWrapper';
import type { SourceLocation, SourceModel } from '@isomorphic/trace/traceModel';
-import type { StackFrame } from '@protocol/channels';
+import type { StackFrame } from '@isomorphic/stackTrace';
import { CopyToClipboard } from './copyToClipboard';
import { ToolbarButton } from '@web/components/toolbarButton';
import { Toolbar } from '@web/components/toolbar';
diff --git a/packages/trace-viewer/src/ui/stackTrace.tsx b/packages/trace-viewer/src/ui/stackTrace.tsx
index f0e79cd673..d03879631c 100644
--- a/packages/trace-viewer/src/ui/stackTrace.tsx
+++ b/packages/trace-viewer/src/ui/stackTrace.tsx
@@ -17,7 +17,7 @@
import * as React from 'react';
import './stackTrace.css';
import { ListView } from '@web/components/listView';
-import type { StackFrame } from '@protocol/channels';
+import type { StackFrame } from '@isomorphic/stackTrace';
const StackFrameListView = ListView<StackFrame>;
diff --git a/packages/trace-viewer/vite.config.ts b/packages/trace-viewer/vite.config.ts
index 3d0f63e65e..fbb0a6883c 100644
--- a/packages/trace-viewer/vite.config.ts
+++ b/packages/trace-viewer/vite.config.ts
@@ -36,7 +36,6 @@ export default defineConfig({
alias: {
'@injected': path.resolve(__dirname, '../injected/src'),
'@isomorphic': path.resolve(__dirname, '../isomorphic'),
- '@protocol': path.resolve(__dirname, '../protocol/src'),
'@testIsomorphic': path.resolve(__dirname, '../playwright/src/isomorphic'),
'@trace': path.resolve(__dirname, '../trace/src'),
'@web': path.resolve(__dirname, '../web/src'),
diff --git a/packages/trace/src/trace.ts b/packages/trace/src/trace.ts
index d11ac4dc91..6cdfbdfc3b 100644
--- a/packages/trace/src/trace.ts
+++ b/packages/trace/src/trace.ts
@@ -16,10 +16,51 @@
import type { FrameSnapshot, ResourceSnapshot } from './snapshot';
import type { Language } from '@isomorphic/locatorGenerators';
-import type { Point, SerializedError, StackFrame } from '@protocol/channels';
+import type { StackFrame } from '@isomorphic/stackTrace';
+import type { Point } from '@isomorphic/types';
export type Size = { width: number, height: number };
+export type SerializedValue = {
+ n?: number,
+ b?: boolean,
+ s?: string,
+ v?: 'null' | 'undefined' | 'NaN' | 'Infinity' | '-Infinity' | '-0',
+ d?: string,
+ u?: string,
+ bi?: string,
+ ta?: {
+ b: Buffer,
+ k: 'i8' | 'ui8' | 'ui8c' | 'i16' | 'ui16' | 'i32' | 'ui32' | 'f32' | 'f64' | 'bi64' | 'bui64',
+ },
+ e?: {
+ m: string,
+ n: string,
+ s: string,
+ },
+ r?: {
+ p: string,
+ f: string,
+ },
+ a?: SerializedValue[],
+ o?: {
+ k: string,
+ v: SerializedValue,
+ }[],
+ h?: number,
+ id?: number,
+ ref?: number,
+};
+
+export type SerializedError = {
+ error?: {
+ message: string,
+ name: string,
+ stack?: string,
+ },
+ value?: SerializedValue,
+};
+
// Make sure you add _modernize_N_to_N1(event: any) to traceModernizer.ts.
export type VERSION = 8;
diff --git a/packages/utils/nodePlatform.ts b/packages/utils/nodePlatform.ts
index 9c3f8b38f6..ab0811e1ef 100644
--- a/packages/utils/nodePlatform.ts
+++ b/packages/utils/nodePlatform.ts
@@ -26,9 +26,8 @@ import { debugLogger } from './debugLogger';
import { currentZone, emptyZone } from './zones';
import { debugMode, isUnderTest } from './debug';
-import type { Platform, Zone } from '@isomorphic/platform';
+import type { Platform, StreamChannel, WritableStreamChannel, Zone } from '@isomorphic/platform';
import type { Zone as ZoneImpl } from './zones';
-import type * as channels from '@protocol/channels';
const pipelineAsync = util.promisify(pipeline);
@@ -113,11 +112,11 @@ export const nodePlatform: (coreDir: string) => Platform = coreDir => ({
await pipelineAsync(fs.createReadStream(path), stream);
},
- streamReadable: (channel: channels.StreamChannel) => {
+ streamReadable: (channel: StreamChannel) => {
return new ReadableStreamImpl(channel);
},
- streamWritable: (channel: channels.WritableStreamChannel) => {
+ streamWritable: (channel: WritableStreamChannel) => {
return new WritableStreamImpl(channel);
},
@@ -128,9 +127,9 @@ export const nodePlatform: (coreDir: string) => Platform = coreDir => ({
});
class ReadableStreamImpl extends Readable {
- private _channel: channels.StreamChannel;
+ private _channel: StreamChannel;
- constructor(channel: channels.StreamChannel) {
+ constructor(channel: StreamChannel) {
super();
this._channel = channel;
}
@@ -151,9 +150,9 @@ class ReadableStreamImpl extends Readable {
}
class WritableStreamImpl extends Writable {
- private _channel: channels.WritableStreamChannel;
+ private _channel: WritableStreamChannel;
- constructor(channel: channels.WritableStreamChannel) {
+ constructor(channel: WritableStreamChannel) {
super();
this._channel = channel;
}
diff --git a/tests/config/debugControllerBackend.ts b/tests/config/debugControllerBackend.ts
index 9f67d44e50..1c90a5c468 100644
--- a/tests/config/debugControllerBackend.ts
+++ b/tests/config/debugControllerBackend.ts
@@ -16,7 +16,7 @@
import WebSocket from 'ws';
import { EventEmitter } from 'events';
-import type * as channels from '@protocol/channels';
+import type * as channels from '../../packages/playwright-core/src/client/channels';
export type ProtocolRequest = {
id: number;
diff --git a/tests/config/utils.ts b/tests/config/utils.ts
index f39363a61f..dcc8d7c6eb 100644
--- a/tests/config/utils.ts
+++ b/tests/config/utils.ts
@@ -19,7 +19,7 @@ import { utils, iso } from '../../packages/playwright-core/lib/coreBundle';
import type { iso as isoType } from '../../packages/playwright-core/lib/coreBundle';
import type { Locator, Frame, Page } from 'playwright-core';
-import type { StackFrame } from '../../packages/protocol/src/channels';
+import type { StackFrame } from '../../packages/isomorphic/stackTrace';
import type { ActionTraceEvent, TraceEvent } from '@trace/trace';
const { TraceLoader, TraceModel } = iso;
diff --git a/tests/library/debug-controller.spec.ts b/tests/library/debug-controller.spec.ts
index 90f26ef4dd..7d70a22647 100644
--- a/tests/library/debug-controller.spec.ts
+++ b/tests/library/debug-controller.spec.ts
@@ -19,7 +19,7 @@ import { remote, utils } from '../../packages/playwright-core/lib/coreBundle';
const { PlaywrightServer } = remote;
import { Backend } from '../config/debugControllerBackend';
import type { Browser, BrowserContext } from '@playwright/test';
-import type * as channels from '@protocol/channels';
+import type * as channels from '../../packages/playwright-core/src/client/channels';
import { roundBox } from '../config/utils';
const { createGuid } = utils;
diff --git a/tests/library/tracing.spec.ts b/tests/library/tracing.spec.ts
index b565683b6d..68258bb58e 100644
--- a/tests/library/tracing.spec.ts
+++ b/tests/library/tracing.spec.ts
@@ -19,7 +19,7 @@ import { jpegjs } from 'playwright-core/lib/utilsBundle';
import path from 'path';
import { browserTest, contextTest as test, expect } from '../config/browserTest';
import { parseTraceRaw } from '../config/utils';
-import type { StackFrame } from '@protocol/channels';
+import type { StackFrame } from '../../packages/isomorphic/stackTrace';
import type { ActionTraceEvent } from '../../packages/trace/src/trace';
import { artifactsFolderName } from '../../packages/playwright/src/isomorphic/folders';
import { rafraf } from '../page/pageTest';
diff --git a/tests/tsconfig.json b/tests/tsconfig.json
index d9df9e1380..ad46142a25 100644
--- a/tests/tsconfig.json
+++ b/tests/tsconfig.json
@@ -16,7 +16,6 @@
"@isomorphic/*": ["packages/isomorphic/*"],
"@utils/*": ["packages/utils/*"],
"@testIsomorphic/*": ["packages/playwright/src/isomorphic/*"],
- "@protocol/*": ["packages/protocol/src/*"],
"@recorder/*": ["packages/recorder/src/*"],
"@trace/*": ["packages/trace/src/*"],
"@web/*": ["packages/web/src/*"],
diff --git a/tsconfig.json b/tsconfig.json
index c26c7fc9c6..a027e586c8 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -16,7 +16,6 @@
"@injected/*": ["./packages/injected/src/*"],
"@isomorphic/*": ["./packages/isomorphic/*"],
"@utils/*": ["./packages/utils/*"],
- "@protocol/*": ["./packages/protocol/src/*"],
"@recorder/*": ["./packages/recorder/src/*"],
"@testIsomorphic/*": ["./packages/playwright/src/isomorphic/*"],
"@trace/*": ["./packages/trace/src/*"],
diff --git a/utils/eslint-plugin-progress/index.js b/utils/eslint-plugin-progress/index.js
index 1a00e1a2a3..394ade81b9 100644
--- a/utils/eslint-plugin-progress/index.js
+++ b/utils/eslint-plugin-progress/index.js
@@ -121,7 +121,7 @@ const rule = createRule({
description: 'In methods accepting Progress, awaited async calls must pass progress or be wrapped in progress.race()',
},
messages: {
- missingProgress: 'Awaited async call must either pass `progress` as first argument or be wrapped in `progress.race()`. See packages/protocol/src/progress.d.ts.',
+ missingProgress: 'Awaited async call must either pass `progress` as first argument or be wrapped in `progress.race()`. See packages/playwright-core/src/server/progress.ts.',
},
schema: [],
},
diff --git a/utils/generate_channels.js b/utils/generate_channels.js
index 0b2a0173ba..cb03c6430a 100755
--- a/utils/generate_channels.js
+++ b/utils/generate_channels.js
@@ -109,7 +109,8 @@ function objectType(props, indent, onlyOptional = false) {
return { ts: `{\n${inner.ts}\n${indent}}`, scheme: `tObject({\n${inner.scheme}\n${indent}})` };
}
-const channels_ts = [
+function channelsHeader(target) {
+ return [
`/**
* Copyright (c) Microsoft Corporation.
*
@@ -126,16 +127,16 @@ const channels_ts = [
* limitations under the License.
*/
-// This file is generated by ${path.basename(__filename).split(path.sep).join(path.posix.sep)}, do not edit manually.
+// This file is generated by ${path.basename(__filename).split(path.sep).join(path.posix.sep)}, do not edit manually.` + (target === 'Dispatcher' ? `
-import type { CallMetadata } from './callMetadata';
import type { Progress } from './progress';
-
+` : '') + `
export type Binary = Buffer;
export interface Channel {
}
`];
+}
const validator_ts = [
`/**
@@ -228,152 +229,163 @@ const entriesInReverse = interfaceEntries
.sort((a, b) => depthOf(b.e[0]) - depthOf(a.e[0]) || a.i - b.i)
.map(x => x.e);
-channels_ts.push(`// ----------- Initializer Traits -----------`);
-channels_ts.push(`export type InitializerTraits<T> =`);
-for (const [name, item] of entriesInReverse) {
- if (item.type !== 'interface')
- continue;
- channels_ts.push(` T extends ${name}Channel ? ${name}Initializer :`);
-}
-channels_ts.push(` object;`);
-channels_ts.push(``);
-channels_ts.push(`// ----------- Event Traits -----------`);
-channels_ts.push(`export type EventsTraits<T> =`);
-for (const [name, item] of entriesInReverse) {
- if (item.type !== 'interface')
- continue;
- channels_ts.push(` T extends ${name}Channel ? ${name}Events :`);
-}
-channels_ts.push(` undefined;`);
-channels_ts.push(``);
-channels_ts.push(`// ----------- EventTarget Traits -----------`);
-channels_ts.push(`export type EventTargetTraits<T> =`);
-for (const [name, item] of entriesInReverse) {
- if (item.type !== 'interface')
- continue;
- channels_ts.push(` T extends ${name}Channel ? ${name}EventTarget :`);
-}
-channels_ts.push(` undefined;`);
-channels_ts.push(``);
+function generateChannels(target) {
+ const channels_ts = channelsHeader(target);
+ const isDispatcher = target === 'Dispatcher';
-for (const [name, item] of Object.entries(protocol)) {
- if (item.type === 'interface') {
- const channelName = name;
- channels_ts.push(`// ----------- ${channelName} -----------`);
- const init = objectType(item.initializer || {}, '');
- const initializerName = channelName + 'Initializer';
- channels_ts.push(`export type ${initializerName} = ${init.ts};`);
-
- let ancestorInit = init;
- let ancestor = item;
- while (!ancestor.initializer) {
- if (!ancestor.extends)
- break;
- ancestor = channels.get(ancestor.extends);
- ancestorInit = objectType(ancestor.initializer || {}, '');
- }
- addScheme(`${channelName}Initializer`, ancestor.initializer ? ancestorInit.scheme : `tOptional(tObject({}))`);
-
- channels_ts.push(`export interface ${channelName}EventTarget {`);
- const ts_types = new Map();
-
- /** @type{{eventName: string, eventType: string}[]} */
- const eventTypes = [];
- for (let [eventName, event] of Object.entries(item.events || {})) {
- if (event === null)
- event = {};
- const parameters = objectType(event.parameters || {}, '');
- const paramsName = `${channelName}${titleCase(eventName)}Event`;
- ts_types.set(paramsName, parameters.ts);
- channels_ts.push(` on(event: '${eventName}', callback: (params: ${paramsName}) => void): this;`);
- eventTypes.push({eventName, eventType: paramsName});
- addScheme(paramsName, event.parameters ? parameters.scheme : `tOptional(tObject({}))`);
- for (const derived of derivedClasses.get(channelName) || [])
- addScheme(`${derived}${titleCase(eventName)}Event`, `tType('${paramsName}')`);
- }
- channels_ts.push(`}`);
-
- channels_ts.push(`export interface ${channelName}Channel extends ${channelName}EventTarget, ${(item.extends || '') + 'Channel'} {`);
- channels_ts.push(` _type_${channelName}: boolean;`);
- for (let [methodName, method] of Object.entries(item.commands || {})) {
- if (method === null)
- method = {};
-
-
- for (const className of [name, ...(derivedClasses.get(name) || [])]) {
- if (method.flags?.slowMo && method.internal)
- throw new Error(`Method "${className}.${methodName}" has "slowMo" flag, so cannot be "internal" in protocol.yml`);
- if (method.flags?.snapshot && method.internal)
- throw new Error(`Method "${className}.${methodName}" has "snapshot" flag, so cannot be "internal" in protocol.yml`);
- if (method.flags?.pause && method.internal)
- throw new Error(`Method "${className}.${methodName}" has "pause" flag, so cannot be "internal" in protocol.yml`);
- if (!method.title && !method.internal)
- throw new Error(`Method "${className}.${methodName}" must have a "title" because it is not "internal" in protocol.yml`);
- if (method.group && method.internal)
- throw new Error(`Method "${className}.${methodName}" must should not specify "group" because it is "internal" in protocol.yml`);
- if (method.group && !['getter', 'configuration', 'route', 'default'].includes(method.group))
- throw new Error(`Unknown group "${method.group}" for method "${className}.${methodName}" in protocol.yml`);
- const internalProp = method.internal ? ` internal: ${method.internal},` : '';
- const titleProp = method.title ? ` title: '${method.title}',` : '';
- const groupProp = method.group ? ` group: '${method.group}',` : '';
- const slowMoProp = method.flags?.slowMo ? ` slowMo: ${method.flags.slowMo},` : '';
- const snapshotProp = method.flags?.snapshot ? ` snapshot: ${method.flags.snapshot},` : '';
- const pauseProp = method.flags?.pause ? ` pause: ${method.flags.pause},` : '';
- const inputProp = method.flags?.input ? ` input: ${method.flags.input},` : '';
- const isAutoWaitingProp = method.flags?.isAutoWaiting ? ` isAutoWaiting: ${method.flags.isAutoWaiting},` : '';
- methodMetainfo.push(`['${className + '.' + methodName}', {${internalProp}${titleProp}${slowMoProp}${snapshotProp}${pauseProp}${inputProp}${isAutoWaitingProp}${groupProp} }]`);
+ channels_ts.push(`// ----------- Initializer Traits -----------`);
+ channels_ts.push(`export type InitializerTraits<T> =`);
+ for (const [name, item] of entriesInReverse) {
+ if (item.type !== 'interface')
+ continue;
+ channels_ts.push(` T extends ${name}Channel ? ${name}Initializer :`);
+ }
+ channels_ts.push(` object;`);
+ channels_ts.push(``);
+ channels_ts.push(`// ----------- Event Traits -----------`);
+ channels_ts.push(`export type EventsTraits<T> =`);
+ for (const [name, item] of entriesInReverse) {
+ if (item.type !== 'interface')
+ continue;
+ channels_ts.push(` T extends ${name}Channel ? ${name}Events :`);
+ }
+ channels_ts.push(` undefined;`);
+ channels_ts.push(``);
+ channels_ts.push(`// ----------- EventTarget Traits -----------`);
+ channels_ts.push(`export type EventTargetTraits<T> =`);
+ for (const [name, item] of entriesInReverse) {
+ if (item.type !== 'interface')
+ continue;
+ channels_ts.push(` T extends ${name}Channel ? ${name}EventTarget :`);
+ }
+ channels_ts.push(` undefined;`);
+ channels_ts.push(``);
+
+ for (const [name, item] of Object.entries(protocol)) {
+ if (item.type === 'interface') {
+ const channelName = name;
+ channels_ts.push(`// ----------- ${channelName} -----------`);
+ const init = objectType(item.initializer || {}, '');
+ const initializerName = channelName + 'Initializer';
+ channels_ts.push(`export type ${initializerName} = ${init.ts};`);
+
+ let ancestorInit = init;
+ let ancestor = item;
+ while (!ancestor.initializer) {
+ if (!ancestor.extends)
+ break;
+ ancestor = channels.get(ancestor.extends);
+ ancestorInit = objectType(ancestor.initializer || {}, '');
}
+ addScheme(`${channelName}Initializer`, ancestor.initializer ? ancestorInit.scheme : `tOptional(tObject({}))`);
+
+ channels_ts.push(`export interface ${channelName}EventTarget {`);
+ const ts_types = new Map();
+
+ /** @type{{eventName: string, eventType: string}[]} */
+ const eventTypes = [];
+ for (let [eventName, event] of Object.entries(item.events || {})) {
+ if (event === null)
+ event = {};
+ const parameters = objectType(event.parameters || {}, '');
+ const paramsName = `${channelName}${titleCase(eventName)}Event`;
+ ts_types.set(paramsName, parameters.ts);
+ if (isDispatcher)
+ channels_ts.push(` _dispatchEvent(event: '${eventName}', params?: ${paramsName}): void;`);
+ else
+ channels_ts.push(` on(event: '${eventName}', callback: (params: ${paramsName}) => void): this;`);
+ eventTypes.push({eventName, eventType: paramsName});
+ addScheme(paramsName, event.parameters ? parameters.scheme : `tOptional(tObject({}))`);
+ for (const derived of derivedClasses.get(channelName) || [])
+ addScheme(`${derived}${titleCase(eventName)}Event`, `tType('${paramsName}')`);
+ }
+ channels_ts.push(`}`);
+
+ channels_ts.push(`export interface ${channelName}Channel extends ${channelName}EventTarget, ${(item.extends || '') + 'Channel'} {`);
+ channels_ts.push(` _type_${channelName}: boolean;`);
+ for (let [methodName, method] of Object.entries(item.commands || {})) {
+ if (method === null)
+ method = {};
+
+ for (const className of [name, ...(derivedClasses.get(name) || [])]) {
+ if (method.flags?.slowMo && method.internal)
+ throw new Error(`Method "${className}.${methodName}" has "slowMo" flag, so cannot be "internal" in protocol.yml`);
+ if (method.flags?.snapshot && method.internal)
+ throw new Error(`Method "${className}.${methodName}" has "snapshot" flag, so cannot be "internal" in protocol.yml`);
+ if (method.flags?.pause && method.internal)
+ throw new Error(`Method "${className}.${methodName}" has "pause" flag, so cannot be "internal" in protocol.yml`);
+ if (!method.title && !method.internal)
+ throw new Error(`Method "${className}.${methodName}" must have a "title" because it is not "internal" in protocol.yml`);
+ if (method.group && method.internal)
+ throw new Error(`Method "${className}.${methodName}" must should not specify "group" because it is "internal" in protocol.yml`);
+ if (method.group && !['getter', 'configuration', 'route', 'default'].includes(method.group))
+ throw new Error(`Unknown group "${method.group}" for method "${className}.${methodName}" in protocol.yml`);
+ const internalProp = method.internal ? ` internal: ${method.internal},` : '';
+ const titleProp = method.title ? ` title: '${method.title}',` : '';
+ const groupProp = method.group ? ` group: '${method.group}',` : '';
+ const slowMoProp = method.flags?.slowMo ? ` slowMo: ${method.flags.slowMo},` : '';
+ const snapshotProp = method.flags?.snapshot ? ` snapshot: ${method.flags.snapshot},` : '';
+ const pauseProp = method.flags?.pause ? ` pause: ${method.flags.pause},` : '';
+ const inputProp = method.flags?.input ? ` input: ${method.flags.input},` : '';
+ const isAutoWaitingProp = method.flags?.isAutoWaiting ? ` isAutoWaiting: ${method.flags.isAutoWaiting},` : '';
+ methodMetainfo.push(`['${className + '.' + methodName}', {${internalProp}${titleProp}${slowMoProp}${snapshotProp}${pauseProp}${inputProp}${isAutoWaitingProp}${groupProp} }]`);
+ }
+
+ const parameters = objectType(method.parameters || {}, '');
+ const paramsName = `${channelName}${titleCase(methodName)}Params`;
+ const optionsName = `${channelName}${titleCase(methodName)}Options`;
+ ts_types.set(paramsName, parameters.ts);
+ ts_types.set(optionsName, objectType(method.parameters || {}, '', true).ts);
+ addScheme(paramsName, method.parameters ? parameters.scheme : `tOptional(tObject({}))`);
+ for (const derived of derivedClasses.get(channelName) || [])
+ addScheme(`${derived}${titleCase(methodName)}Params`, `tType('${paramsName}')`);
- const parameters = objectType(method.parameters || {}, '');
- const paramsName = `${channelName}${titleCase(methodName)}Params`;
- const optionsName = `${channelName}${titleCase(methodName)}Options`;
- ts_types.set(paramsName, parameters.ts);
- ts_types.set(optionsName, objectType(method.parameters || {}, '', true).ts);
- addScheme(paramsName, method.parameters ? parameters.scheme : `tOptional(tObject({}))`);
- for (const derived of derivedClasses.get(channelName) || [])
- addScheme(`${derived}${titleCase(methodName)}Params`, `tType('${paramsName}')`);
-
- const resultName = `${channelName}${titleCase(methodName)}Result`;
- const returns = objectType(method.returns || {}, '');
- ts_types.set(resultName, method.returns ? returns.ts : 'void');
- addScheme(resultName, method.returns ? returns.scheme : `tOptional(tObject({}))`);
- for (const derived of derivedClasses.get(channelName) || [])
- addScheme(`${derived}${titleCase(methodName)}Result`, `tType('${resultName}')`);
-
- if (method.errorDetails) {
- const errorDetailsName = `${channelName}${titleCase(methodName)}ErrorDetails`;
- const details = objectType(method.errorDetails, '');
- ts_types.set(errorDetailsName, details.ts);
- addScheme(errorDetailsName, details.scheme);
+ const resultName = `${channelName}${titleCase(methodName)}Result`;
+ const returns = objectType(method.returns || {}, '');
+ ts_types.set(resultName, method.returns ? returns.ts : 'void');
+ addScheme(resultName, method.returns ? returns.scheme : `tOptional(tObject({}))`);
for (const derived of derivedClasses.get(channelName) || [])
- addScheme(`${derived}${titleCase(methodName)}ErrorDetails`, `tType('${errorDetailsName}')`);
+ addScheme(`${derived}${titleCase(methodName)}Result`, `tType('${resultName}')`);
+
+ if (method.errorDetails) {
+ const errorDetailsName = `${channelName}${titleCase(methodName)}ErrorDetails`;
+ const details = objectType(method.errorDetails, '');
+ ts_types.set(errorDetailsName, details.ts);
+ addScheme(errorDetailsName, details.scheme);
+ for (const derived of derivedClasses.get(channelName) || [])
+ addScheme(`${derived}${titleCase(methodName)}ErrorDetails`, `tType('${errorDetailsName}')`);
+ }
+ const secondParam = isDispatcher ? `, progress: Progress` : '';
+ channels_ts.push(` ${methodName}(params${method.parameters || isDispatcher ? '' : '?'}: ${paramsName}${secondParam}): Promise<${resultName}>;`);
}
- channels_ts.push(` ${methodName}(params${method.parameters ? '' : '?'}: ${paramsName}, progress?: Progress): Promise<${resultName}>;`);
+ channels_ts.push(`}`);
+ for (const [typeName, typeValue] of ts_types)
+ channels_ts.push(`export type ${typeName} = ${typeValue};`);
+ channels_ts.push(``);
+
+ channels_ts.push(`export interface ${channelName}Events {`);
+ for (const {eventName, eventType} of eventTypes)
+ channels_ts.push(` '${eventName}': ${eventType};`);
+ channels_ts.push(`}\n`);
+
+ } else if (item.type === 'object') {
+ const inner = objectType(item.properties, '');
+ channels_ts.push(`export type ${name} = ${inner.ts};`);
+ channels_ts.push(``);
+ addScheme(name, inner.scheme);
+ } else if (item.type === 'enum') {
+ const ts = item.literals.map(literal => `'${literal}'`).join(' | ');
+ channels_ts.push(`export type ${name} = ${ts};`)
+ addScheme(name, `tEnum([${item.literals.map(literal => `'${literal}'`).join(', ')}])`);
}
-
- channels_ts.push(`}`);
- for (const [typeName, typeValue] of ts_types)
- channels_ts.push(`export type ${typeName} = ${typeValue};`);
- channels_ts.push(``);
-
- channels_ts.push(`export interface ${channelName}Events {`);
- for (const {eventName, eventType} of eventTypes)
- channels_ts.push(` '${eventName}': ${eventType};`);
- channels_ts.push(`}\n`);
-
- } else if (item.type === 'object') {
- const inner = objectType(item.properties, '');
- channels_ts.push(`export type ${name} = ${inner.ts};`);
- channels_ts.push(``);
- addScheme(name, inner.scheme);
- } else if (item.type === 'enum') {
- const ts = item.literals.map(literal => `'${literal}'`).join(' | ');
- channels_ts.push(`export type ${name} = ${ts};`)
- addScheme(name, `tEnum([${item.literals.map(literal => `'${literal}'`).join(', ')}])`);
}
+
+ return channels_ts;
}
+const client_channels_ts = generateChannels('Channel');
+
metainfo_ts.push(`export type MethodMetainfo = { internal?: boolean, title?: string, slowMo?: boolean, snapshot?: boolean, pause?: boolean, isAutoWaiting?: boolean, input?: boolean, group?: string };
export const methodMetainfo = new Map<string, MethodMetainfo>([
@@ -383,6 +395,10 @@ export const methodMetainfo = new Map<string, MethodMetainfo>([
export function getMetainfo(metadata: { type: string, method: string }): MethodMetainfo | undefined {
return methodMetainfo.get(metadata.type + '.' + metadata.method);
}`);
+const metainfoContent = metainfo_ts.join('\n') + '\n';
+const validatorContent = validator_ts.join('\n') + '\n';
+
+const server_channels_ts = generateChannels('Dispatcher');
let hasChanges = false;
@@ -396,10 +412,12 @@ function writeFile(filePath, content) {
hasChanges = true;
const root = path.join(__dirname, '..');
console.log(`Writing //${path.relative(root, filePath)}`);
+ fs.mkdirSync(path.dirname(filePath), { recursive: true });
fs.writeFileSync(filePath, content, 'utf8');
}
-writeFile(path.join(__dirname, '..', 'packages', 'protocol', 'src', 'channels.d.ts'), channels_ts.join('\n') + '\n');
-writeFile(path.join(__dirname, '..', 'packages', 'isomorphic', 'protocolMetainfo.ts'), metainfo_ts.join('\n') + '\n');
-writeFile(path.join(__dirname, '..', 'packages', 'playwright-core', 'src', 'protocol', 'validator.ts'), validator_ts.join('\n') + '\n');
+writeFile(path.join(__dirname, '..', 'packages', 'playwright-core', 'src', 'client', 'channels.d.ts'), client_channels_ts.join('\n') + '\n');
+writeFile(path.join(__dirname, '..', 'packages', 'playwright-core', 'src', 'server', 'channels.d.ts'), server_channels_ts.join('\n') + '\n');
+writeFile(path.join(__dirname, '..', 'packages', 'isomorphic', 'protocolMetainfo.ts'), metainfoContent);
+writeFile(path.join(__dirname, '..', 'packages', 'playwright-core', 'src', 'protocol', 'validator.ts'), validatorContent);
process.exit(hasChanges ? 1 : 0);