chore: mark where APIs don't work for BiDi (#11396)

This commit is contained in:
Nikolay Vitkov 2023-11-16 08:22:32 +01:00 committed by GitHub
parent b58ba6b07c
commit 7c499cb0b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 92 additions and 1 deletions

View File

@ -399,6 +399,9 @@ export abstract class Browser extends EventEmitter<BrowserEvents> {
* *
* {@link Page | Pages} can override the user agent with * {@link Page | Pages} can override the user agent with
* {@link Page.setUserAgent}. * {@link Page.setUserAgent}.
*
* @privateRemarks BiDi
* Not supported when using protocol `webDriverBiDi`
*/ */
abstract userAgent(): Promise<string>; abstract userAgent(): Promise<string>;

View File

@ -164,6 +164,9 @@ export abstract class BrowserContext extends EventEmitter<BrowserContextEvents>
* "https://example.com". * "https://example.com".
* @param permissions - An array of permissions to grant. All permissions that * @param permissions - An array of permissions to grant. All permissions that
* are not listed here will be automatically denied. * are not listed here will be automatically denied.
*
* @privateRemarks BiDi
* Not supported when using protocol `webDriverBiDi`
*/ */
abstract overridePermissions( abstract overridePermissions(
origin: string, origin: string,
@ -183,6 +186,9 @@ export abstract class BrowserContext extends EventEmitter<BrowserContextEvents>
* // do stuff .. * // do stuff ..
* context.clearPermissionOverrides(); * context.clearPermissionOverrides();
* ``` * ```
*
* @privateRemarks BiDi
* Not supported when using protocol `webDriverBiDi`
*/ */
abstract clearPermissionOverrides(): Promise<void>; abstract clearPermissionOverrides(): Promise<void>;

View File

@ -963,6 +963,8 @@ export abstract class ElementHandle<
* For locals script connecting to remote chrome environments, paths must be * For locals script connecting to remote chrome environments, paths must be
* absolute. * absolute.
* *
* @privateRemarks BiDi
* Not supported when using protocol `webDriverBiDi`
*/ */
abstract uploadFile( abstract uploadFile(
this: ElementHandle<HTMLInputElement>, this: ElementHandle<HTMLInputElement>,

View File

@ -311,6 +311,9 @@ export abstract class Frame extends EventEmitter<FrameEvents> {
/** /**
* Is `true` if the frame is an out-of-process (OOP) frame. Otherwise, * Is `true` if the frame is an out-of-process (OOP) frame. Otherwise,
* `false`. * `false`.
*
* @privateRemarks BiDi
* Not supported when using protocol `webDriverBiDi`
*/ */
abstract isOOPFrame(): boolean; abstract isOOPFrame(): boolean;
@ -1196,6 +1199,9 @@ export abstract class Frame extends EventEmitter<FrameEvents> {
* ); * );
* ``` * ```
* *
* @privateRemarks BiDi
* Not supported when using protocol `webDriverBiDi`
*
* @internal * @internal
*/ */
abstract waitForDevicePrompt( abstract waitForDevicePrompt(

View File

@ -130,6 +130,9 @@ export abstract class HTTPRequest {
* Warning! Using this client can break Puppeteer. Use with caution. * Warning! Using this client can break Puppeteer. Use with caution.
* *
* @experimental * @experimental
*
* @privateRemarks BiDi
* Not supported when using protocol `webDriverBiDi`
*/ */
abstract get client(): CDPSession; abstract get client(): CDPSession;
@ -147,17 +150,26 @@ export abstract class HTTPRequest {
* The `ContinueRequestOverrides` that will be used * The `ContinueRequestOverrides` that will be used
* if the interception is allowed to continue (ie, `abort()` and * if the interception is allowed to continue (ie, `abort()` and
* `respond()` aren't called). * `respond()` aren't called).
*
* @privateRemarks BiDi
* Not supported when using protocol `webDriverBiDi`
*/ */
abstract continueRequestOverrides(): ContinueRequestOverrides; abstract continueRequestOverrides(): ContinueRequestOverrides;
/** /**
* The `ResponseForRequest` that gets used if the * The `ResponseForRequest` that gets used if the
* interception is allowed to respond (ie, `abort()` is not called). * interception is allowed to respond (ie, `abort()` is not called).
*
* @privateRemarks BiDi
* Not supported when using protocol `webDriverBiDi`
*/ */
abstract responseForRequest(): Partial<ResponseForRequest> | null; abstract responseForRequest(): Partial<ResponseForRequest> | null;
/** /**
* The most recent reason for aborting the request * The most recent reason for aborting the request
*
* @privateRemarks BiDi
* Not supported when using protocol `webDriverBiDi`
*/ */
abstract abortErrorReason(): Protocol.Network.ErrorReason | null; abstract abortErrorReason(): Protocol.Network.ErrorReason | null;
@ -171,12 +183,18 @@ export abstract class HTTPRequest {
* *
* InterceptResolutionAction is one of: `abort`, `respond`, `continue`, * InterceptResolutionAction is one of: `abort`, `respond`, `continue`,
* `disabled`, `none`, or `already-handled`. * `disabled`, `none`, or `already-handled`.
*
* @privateRemarks BiDi
* Not supported when using protocol `webDriverBiDi`
*/ */
abstract interceptResolutionState(): InterceptResolutionState; abstract interceptResolutionState(): InterceptResolutionState;
/** /**
* Is `true` if the intercept resolution has already been handled, * Is `true` if the intercept resolution has already been handled,
* `false` otherwise. * `false` otherwise.
*
* @privateRemarks BiDi
* Not supported when using protocol `webDriverBiDi`
*/ */
abstract isInterceptResolutionHandled(): boolean; abstract isInterceptResolutionHandled(): boolean;
@ -193,6 +211,9 @@ export abstract class HTTPRequest {
/** /**
* Awaits pending interception handlers and then decides how to fulfill * Awaits pending interception handlers and then decides how to fulfill
* the request interception. * the request interception.
*
* @privateRemarks BiDi
* Not supported when using protocol `webDriverBiDi`
*/ */
abstract finalizeInterceptions(): Promise<void>; abstract finalizeInterceptions(): Promise<void>;
@ -288,6 +309,9 @@ export abstract class HTTPRequest {
* return an object with `errorText` containing a human-readable error * return an object with `errorText` containing a human-readable error
* message, e.g. `net::ERR_FAILED`. It is not guaranteed that there will be * message, e.g. `net::ERR_FAILED`. It is not guaranteed that there will be
* failure text if the request fails. * failure text if the request fails.
*
* @privateRemarks BiDi
* Not supported when using protocol `webDriverBiDi`
*/ */
abstract failure(): {errorText: string} | null; abstract failure(): {errorText: string} | null;
@ -319,6 +343,9 @@ export abstract class HTTPRequest {
* @param priority - If provided, intercept is resolved using * @param priority - If provided, intercept is resolved using
* cooperative handling rules. Otherwise, intercept is resolved * cooperative handling rules. Otherwise, intercept is resolved
* immediately. * immediately.
*
* @privateRemarks BiDi
* Not supported when using protocol `webDriverBiDi`
*/ */
abstract continue( abstract continue(
overrides?: ContinueRequestOverrides, overrides?: ContinueRequestOverrides,
@ -356,6 +383,9 @@ export abstract class HTTPRequest {
* @param priority - If provided, intercept is resolved using * @param priority - If provided, intercept is resolved using
* cooperative handling rules. Otherwise, intercept is resolved * cooperative handling rules. Otherwise, intercept is resolved
* immediately. * immediately.
*
* @privateRemarks BiDi
* Not supported when using protocol `webDriverBiDi`
*/ */
abstract respond( abstract respond(
response: Partial<ResponseForRequest>, response: Partial<ResponseForRequest>,
@ -374,6 +404,9 @@ export abstract class HTTPRequest {
* @param priority - If provided, intercept is resolved using * @param priority - If provided, intercept is resolved using
* cooperative handling rules. Otherwise, intercept is resolved * cooperative handling rules. Otherwise, intercept is resolved
* immediately. * immediately.
*
* @privateRemarks BiDi
* Not supported when using protocol `webDriverBiDi`
*/ */
abstract abort(errorCode?: ErrorCode, priority?: number): Promise<void>; abstract abort(errorCode?: ErrorCode, priority?: number): Promise<void>;
} }

View File

@ -81,6 +81,9 @@ export abstract class HTTPResponse {
/** /**
* {@link SecurityDetails} if the response was received over the * {@link SecurityDetails} if the response was received over the
* secure connection, or `null` otherwise. * secure connection, or `null` otherwise.
*
* @privateRemarks BiDi
* Not supported when using protocol `webDriverBiDi`
*/ */
abstract securityDetails(): SecurityDetails | null; abstract securityDetails(): SecurityDetails | null;
@ -91,6 +94,9 @@ export abstract class HTTPResponse {
/** /**
* Promise which resolves to a buffer with response body. * Promise which resolves to a buffer with response body.
*
* @privateRemarks BiDi
* Not supported when using protocol `webDriverBiDi`
*/ */
abstract buffer(): Promise<Buffer>; abstract buffer(): Promise<Buffer>;

View File

@ -435,6 +435,9 @@ export abstract class Mouse {
* Dispatches a `drag` event. * Dispatches a `drag` event.
* @param start - starting point for drag * @param start - starting point for drag
* @param target - point to drag to * @param target - point to drag to
*
* @privateRemarks BiDi
* Not supported when using protocol `webDriverBiDi`
*/ */
abstract drag(start: Point, target: Point): Promise<Protocol.Input.DragData>; abstract drag(start: Point, target: Point): Promise<Protocol.Input.DragData>;
@ -442,6 +445,9 @@ export abstract class Mouse {
* Dispatches a `dragenter` event. * Dispatches a `dragenter` event.
* @param target - point for emitting `dragenter` event * @param target - point for emitting `dragenter` event
* @param data - drag data containing items and operations mask * @param data - drag data containing items and operations mask
*
* @privateRemarks BiDi
* Not supported when using protocol `webDriverBiDi`
*/ */
abstract dragEnter( abstract dragEnter(
target: Point, target: Point,
@ -452,6 +458,9 @@ export abstract class Mouse {
* Dispatches a `dragover` event. * Dispatches a `dragover` event.
* @param target - point for emitting `dragover` event * @param target - point for emitting `dragover` event
* @param data - drag data containing items and operations mask * @param data - drag data containing items and operations mask
*
* @privateRemarks BiDi
* Not supported when using protocol `webDriverBiDi`
*/ */
abstract dragOver( abstract dragOver(
target: Point, target: Point,
@ -462,6 +471,9 @@ export abstract class Mouse {
* Performs a dragenter, dragover, and drop in sequence. * Performs a dragenter, dragover, and drop in sequence.
* @param target - point to drop on * @param target - point to drop on
* @param data - drag data containing items and operations mask * @param data - drag data containing items and operations mask
*
* @privateRemarks BiDi
* Not supported when using protocol `webDriverBiDi`
*/ */
abstract drop(target: Point, data: Protocol.Input.DragData): Promise<void>; abstract drop(target: Point, data: Protocol.Input.DragData): Promise<void>;
@ -472,6 +484,9 @@ export abstract class Mouse {
* @param options - An object of options. Accepts delay which, * @param options - An object of options. Accepts delay which,
* if specified, is the time to wait between `dragover` and `drop` in milliseconds. * if specified, is the time to wait between `dragover` and `drop` in milliseconds.
* Defaults to 0. * Defaults to 0.
*
* @privateRemarks BiDi
* Not supported when using protocol `webDriverBiDi`
*/ */
abstract dragAndDrop( abstract dragAndDrop(
start: Point, start: Point,

View File

@ -429,6 +429,9 @@ export const enum PageEvent {
* page.evaluate(() => window.open('https://example.com')), * page.evaluate(() => window.open('https://example.com')),
* ]); * ]);
* ``` * ```
*
* @privateRemarks BiDi
* Not supported when using protocol `webDriverBiDi`
*/ */
Popup = 'popup', Popup = 'popup',
/** /**
@ -472,12 +475,18 @@ export const enum PageEvent {
* Emitted when a dedicated * Emitted when a dedicated
* {@link https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API | WebWorker} * {@link https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API | WebWorker}
* is spawned by the page. * is spawned by the page.
*
* @privateRemarks BiDi
* Not supported when using protocol `webDriverBiDi`
*/ */
WorkerCreated = 'workercreated', WorkerCreated = 'workercreated',
/** /**
* Emitted when a dedicated * Emitted when a dedicated
* {@link https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API | WebWorker} * {@link https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API | WebWorker}
* is destroyed by the page. * is destroyed by the page.
*
* @privateRemarks BiDi
* Not supported when using protocol `webDriverBiDi`
*/ */
WorkerDestroyed = 'workerdestroyed', WorkerDestroyed = 'workerdestroyed',
} }
@ -718,6 +727,9 @@ export abstract class Page extends EventEmitter<PageEvents> {
* ]); * ]);
* await fileChooser.accept(['/tmp/myfile.pdf']); * await fileChooser.accept(['/tmp/myfile.pdf']);
* ``` * ```
*
* @privateRemarks BiDi
* Not supported when using protocol `webDriverBiDi`
*/ */
abstract waitForFileChooser( abstract waitForFileChooser(
options?: WaitTimeoutOptions options?: WaitTimeoutOptions
@ -2785,9 +2797,11 @@ export abstract class Page extends EventEmitter<PageEvents> {
* {@link https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors | Selector} * {@link https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Selectors | Selector}
* to search for element to tap. If there are multiple elements satisfying the * to search for element to tap. If there are multiple elements satisfying the
* selector, the first will be tapped. * selector, the first will be tapped.
* @returns
* @remarks * @remarks
* Shortcut for {@link Frame.tap | page.mainFrame().tap(selector)}. * Shortcut for {@link Frame.tap | page.mainFrame().tap(selector)}.
*
* @privateRemarks BiDi
* Not supported when using protocol `webDriverBiDi`
*/ */
tap(selector: string): Promise<void> { tap(selector: string): Promise<void> {
return this.mainFrame().tap(selector); return this.mainFrame().tap(selector);

View File

@ -70,6 +70,9 @@ export abstract class Target {
/** /**
* Creates a Chrome Devtools Protocol session attached to the target. * Creates a Chrome Devtools Protocol session attached to the target.
*
* @privateRemarks BiDi
* Not supported when using protocol `webDriverBiDi`
*/ */
abstract createCDPSession(): Promise<CDPSession>; abstract createCDPSession(): Promise<CDPSession>;
@ -94,6 +97,9 @@ export abstract class Target {
/** /**
* Get the target that opened this target. Top-level targets return `null`. * Get the target that opened this target. Top-level targets return `null`.
*
* @privateRemarks BiDi
* Not supported when using protocol `webDriverBiDi`
*/ */
abstract opener(): Target | undefined; abstract opener(): Target | undefined;
} }