chore: remove noWaitAfter from selectOption (#32283)

This follows removing this option from other methods in v1.46. The two
methods still supporting `noWaitAfter` are `click` and `press`.
This commit is contained in:
Dmitry Gozman 2024-08-23 14:50:43 -07:00 committed by GitHub
parent 9d86bc5336
commit abe6c04a54
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 16 additions and 32 deletions

View File

@ -866,7 +866,7 @@ await handle.SelectOptionAsync(new[] {
### option: ElementHandle.selectOption.force = %%-input-force-%%
* since: v1.13
### option: ElementHandle.selectOption.noWaitAfter = %%-input-no-wait-after-%%
### option: ElementHandle.selectOption.noWaitAfter = %%-input-no-wait-after-removed-%%
* since: v1.8
### option: ElementHandle.selectOption.timeout = %%-input-timeout-%%

View File

@ -1543,7 +1543,7 @@ await frame.SelectOptionAsync("select#colors", new[] { "red", "green", "blue" })
### option: Frame.selectOption.force = %%-input-force-%%
* since: v1.13
### option: Frame.selectOption.noWaitAfter = %%-input-no-wait-after-%%
### option: Frame.selectOption.noWaitAfter = %%-input-no-wait-after-removed-%%
* since: v1.8
### option: Frame.selectOption.strict = %%-input-strict-%%

View File

@ -2055,7 +2055,7 @@ await element.SelectOptionAsync(new[] { "red", "green", "blue" });
### option: Locator.selectOption.force = %%-input-force-%%
* since: v1.14
### option: Locator.selectOption.noWaitAfter = %%-input-no-wait-after-%%
### option: Locator.selectOption.noWaitAfter = %%-input-no-wait-after-removed-%%
* since: v1.14
### option: Locator.selectOption.timeout = %%-input-timeout-%%

View File

@ -3742,7 +3742,7 @@ await page.SelectOptionAsync("select#colors", new[] { "red", "green", "blue" });
### option: Page.selectOption.force = %%-input-force-%%
* since: v1.13
### option: Page.selectOption.noWaitAfter = %%-input-no-wait-after-%%
### option: Page.selectOption.noWaitAfter = %%-input-no-wait-after-removed-%%
* since: v1.8
### option: Page.selectOption.strict = %%-input-strict-%%

View File

@ -33,7 +33,7 @@ export type WaitForEventOptions = Function | { predicate?: Function, timeout?: n
export type WaitForFunctionOptions = { timeout?: number, polling?: 'raf' | number };
export type SelectOption = { value?: string, label?: string, index?: number, valueOrLabel?: string };
export type SelectOptionOptions = { force?: boolean, timeout?: number, noWaitAfter?: boolean };
export type SelectOptionOptions = { force?: boolean, timeout?: number };
export type FilePayload = { name: string, mimeType: string, buffer: Buffer };
export type StorageState = {
cookies: channels.NetworkCookie[],

View File

@ -1637,7 +1637,6 @@ scheme.FrameSelectOptionParams = tObject({
}))),
force: tOptional(tBoolean),
timeout: tOptional(tNumber),
noWaitAfter: tOptional(tBoolean),
});
scheme.FrameSelectOptionResult = tObject({
values: tArray(tString),
@ -2001,7 +2000,6 @@ scheme.ElementHandleSelectOptionParams = tObject({
}))),
force: tOptional(tBoolean),
timeout: tOptional(tNumber),
noWaitAfter: tOptional(tBoolean),
});
scheme.ElementHandleSelectOptionResult = tObject({
values: tArray(tString),

View File

@ -536,7 +536,7 @@ export class ElementHandle<T extends Node = Node> extends js.JSHandle<T> {
return this._retryPointerAction(progress, 'tap', true /* waitForEnabled */, point => this._page.touchscreen.tap(point.x, point.y), { ...options, waitAfter: 'disabled' });
}
async selectOption(metadata: CallMetadata, elements: ElementHandle[], values: types.SelectOption[], options: { noWaitAfter?: boolean } & types.CommonActionOptions): Promise<string[]> {
async selectOption(metadata: CallMetadata, elements: ElementHandle[], values: types.SelectOption[], options: types.CommonActionOptions): Promise<string[]> {
const controller = new ProgressController(metadata, this);
return controller.run(async progress => {
const result = await this._selectOption(progress, elements, values, options);
@ -544,7 +544,7 @@ export class ElementHandle<T extends Node = Node> extends js.JSHandle<T> {
}, this._page._timeoutSettings.timeout(options));
}
async _selectOption(progress: Progress, elements: ElementHandle[], values: types.SelectOption[], options: { noWaitAfter?: boolean } & types.CommonActionOptions): Promise<string[] | 'error:notconnected'> {
async _selectOption(progress: Progress, elements: ElementHandle[], values: types.SelectOption[], options: types.CommonActionOptions): Promise<string[] | 'error:notconnected'> {
let resultingOptions: string[] = [];
await this._retryAction(progress, 'select option', async () => {
await progress.beforeInputAction(this);

View File

@ -1344,7 +1344,7 @@ export class Frame extends SdkObject {
}, this._page._timeoutSettings.timeout(options));
}
async selectOption(metadata: CallMetadata, selector: string, elements: dom.ElementHandle[], values: types.SelectOption[], options: { noWaitAfter?: boolean } & types.CommonActionOptions = {}): Promise<string[]> {
async selectOption(metadata: CallMetadata, selector: string, elements: dom.ElementHandle[], values: types.SelectOption[], options: types.CommonActionOptions = {}): Promise<string[]> {
const controller = new ProgressController(metadata, this);
return controller.run(async progress => {
return await this._retryWithProgressIfNotConnected(progress, selector, options.strict, !options.force /* performLocatorHandlersCheckpoint */, handle => handle._selectOption(progress, elements, values, options));

View File

@ -3897,10 +3897,8 @@ export interface Page {
force?: boolean;
/**
* Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You
* can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as
* navigating to inaccessible pages. Defaults to `false`.
* @deprecated This option will default to `true` in the future.
* This option has no effect.
* @deprecated This option has no effect.
*/
noWaitAfter?: boolean;
@ -7023,10 +7021,8 @@ export interface Frame {
force?: boolean;
/**
* Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You
* can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as
* navigating to inaccessible pages. Defaults to `false`.
* @deprecated This option will default to `true` in the future.
* This option has no effect.
* @deprecated This option has no effect.
*/
noWaitAfter?: boolean;
@ -11136,10 +11132,8 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
force?: boolean;
/**
* Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You
* can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as
* navigating to inaccessible pages. Defaults to `false`.
* @deprecated This option will default to `true` in the future.
* This option has no effect.
* @deprecated This option has no effect.
*/
noWaitAfter?: boolean;
@ -13331,10 +13325,8 @@ export interface Locator {
force?: boolean;
/**
* Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You
* can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as
* navigating to inaccessible pages. Defaults to `false`.
* @deprecated This option will default to `true` in the future.
* This option has no effect.
* @deprecated This option has no effect.
*/
noWaitAfter?: boolean;

View File

@ -2939,7 +2939,6 @@ export type FrameSelectOptionParams = {
}[],
force?: boolean,
timeout?: number,
noWaitAfter?: boolean,
};
export type FrameSelectOptionOptions = {
strict?: boolean,
@ -2952,7 +2951,6 @@ export type FrameSelectOptionOptions = {
}[],
force?: boolean,
timeout?: number,
noWaitAfter?: boolean,
};
export type FrameSelectOptionResult = {
values: string[],
@ -3555,7 +3553,6 @@ export type ElementHandleSelectOptionParams = {
}[],
force?: boolean,
timeout?: number,
noWaitAfter?: boolean,
};
export type ElementHandleSelectOptionOptions = {
elements?: ElementHandleChannel[],
@ -3567,7 +3564,6 @@ export type ElementHandleSelectOptionOptions = {
}[],
force?: boolean,
timeout?: number,
noWaitAfter?: boolean,
};
export type ElementHandleSelectOptionResult = {
values: string[],

View File

@ -2185,7 +2185,6 @@ Frame:
index: number?
force: boolean?
timeout: number?
noWaitAfter: boolean?
returns:
values:
type: array
@ -2741,7 +2740,6 @@ ElementHandle:
index: number?
force: boolean?
timeout: number?
noWaitAfter: boolean?
returns:
values:
type: array