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-%% ### option: ElementHandle.selectOption.force = %%-input-force-%%
* since: v1.13 * since: v1.13
### option: ElementHandle.selectOption.noWaitAfter = %%-input-no-wait-after-%% ### option: ElementHandle.selectOption.noWaitAfter = %%-input-no-wait-after-removed-%%
* since: v1.8 * since: v1.8
### option: ElementHandle.selectOption.timeout = %%-input-timeout-%% ### 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-%% ### option: Frame.selectOption.force = %%-input-force-%%
* since: v1.13 * since: v1.13
### option: Frame.selectOption.noWaitAfter = %%-input-no-wait-after-%% ### option: Frame.selectOption.noWaitAfter = %%-input-no-wait-after-removed-%%
* since: v1.8 * since: v1.8
### option: Frame.selectOption.strict = %%-input-strict-%% ### 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-%% ### option: Locator.selectOption.force = %%-input-force-%%
* since: v1.14 * since: v1.14
### option: Locator.selectOption.noWaitAfter = %%-input-no-wait-after-%% ### option: Locator.selectOption.noWaitAfter = %%-input-no-wait-after-removed-%%
* since: v1.14 * since: v1.14
### option: Locator.selectOption.timeout = %%-input-timeout-%% ### 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-%% ### option: Page.selectOption.force = %%-input-force-%%
* since: v1.13 * since: v1.13
### option: Page.selectOption.noWaitAfter = %%-input-no-wait-after-%% ### option: Page.selectOption.noWaitAfter = %%-input-no-wait-after-removed-%%
* since: v1.8 * since: v1.8
### option: Page.selectOption.strict = %%-input-strict-%% ### 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 WaitForFunctionOptions = { timeout?: number, polling?: 'raf' | number };
export type SelectOption = { value?: string, label?: string, index?: number, valueOrLabel?: string }; 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 FilePayload = { name: string, mimeType: string, buffer: Buffer };
export type StorageState = { export type StorageState = {
cookies: channels.NetworkCookie[], cookies: channels.NetworkCookie[],

View file

@ -1637,7 +1637,6 @@ scheme.FrameSelectOptionParams = tObject({
}))), }))),
force: tOptional(tBoolean), force: tOptional(tBoolean),
timeout: tOptional(tNumber), timeout: tOptional(tNumber),
noWaitAfter: tOptional(tBoolean),
}); });
scheme.FrameSelectOptionResult = tObject({ scheme.FrameSelectOptionResult = tObject({
values: tArray(tString), values: tArray(tString),
@ -2001,7 +2000,6 @@ scheme.ElementHandleSelectOptionParams = tObject({
}))), }))),
force: tOptional(tBoolean), force: tOptional(tBoolean),
timeout: tOptional(tNumber), timeout: tOptional(tNumber),
noWaitAfter: tOptional(tBoolean),
}); });
scheme.ElementHandleSelectOptionResult = tObject({ scheme.ElementHandleSelectOptionResult = tObject({
values: tArray(tString), 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' }); 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); const controller = new ProgressController(metadata, this);
return controller.run(async progress => { return controller.run(async progress => {
const result = await this._selectOption(progress, elements, values, options); 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)); }, 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[] = []; let resultingOptions: string[] = [];
await this._retryAction(progress, 'select option', async () => { await this._retryAction(progress, 'select option', async () => {
await progress.beforeInputAction(this); await progress.beforeInputAction(this);

View file

@ -1344,7 +1344,7 @@ export class Frame extends SdkObject {
}, this._page._timeoutSettings.timeout(options)); }, 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); const controller = new ProgressController(metadata, this);
return controller.run(async progress => { return controller.run(async progress => {
return await this._retryWithProgressIfNotConnected(progress, selector, options.strict, !options.force /* performLocatorHandlersCheckpoint */, handle => handle._selectOption(progress, elements, values, options)); 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; force?: boolean;
/** /**
* Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You * This option has no effect.
* can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as * @deprecated This option has no effect.
* navigating to inaccessible pages. Defaults to `false`.
* @deprecated This option will default to `true` in the future.
*/ */
noWaitAfter?: boolean; noWaitAfter?: boolean;
@ -7023,10 +7021,8 @@ export interface Frame {
force?: boolean; force?: boolean;
/** /**
* Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You * This option has no effect.
* can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as * @deprecated This option has no effect.
* navigating to inaccessible pages. Defaults to `false`.
* @deprecated This option will default to `true` in the future.
*/ */
noWaitAfter?: boolean; noWaitAfter?: boolean;
@ -11136,10 +11132,8 @@ export interface ElementHandle<T=Node> extends JSHandle<T> {
force?: boolean; force?: boolean;
/** /**
* Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You * This option has no effect.
* can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as * @deprecated This option has no effect.
* navigating to inaccessible pages. Defaults to `false`.
* @deprecated This option will default to `true` in the future.
*/ */
noWaitAfter?: boolean; noWaitAfter?: boolean;
@ -13331,10 +13325,8 @@ export interface Locator {
force?: boolean; force?: boolean;
/** /**
* Actions that initiate navigations are waiting for these navigations to happen and for pages to start loading. You * This option has no effect.
* can opt out of waiting via setting this flag. You would only need this option in the exceptional cases such as * @deprecated This option has no effect.
* navigating to inaccessible pages. Defaults to `false`.
* @deprecated This option will default to `true` in the future.
*/ */
noWaitAfter?: boolean; noWaitAfter?: boolean;

View file

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

View file

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