fix(protocol): remove unnused strict in QSA and add it to waitForSelector docs (#8140)

Strict doesn't make sense in querySelectorAll, but it was in the protocol.

And we had a strict option in ElementHandle.waitForSelector but it
was not surfaced in the docs/api.
This commit is contained in:
Joel Einbinder 2021-08-25 10:10:40 -04:00 committed by GitHub
parent 527cdfb55b
commit 943c22c9c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 4 deletions

View file

@ -974,3 +974,5 @@ This method does not work across navigations, use [`method: Page.waitForSelector
### option: ElementHandle.waitForSelector.state = %%-wait-for-selector-state-%%
### option: ElementHandle.waitForSelector.timeout = %%-input-timeout-%%
### option: ElementHandle.waitForSelector.strict = %%-input-strict-%%

View file

@ -1828,10 +1828,9 @@ export type FrameQuerySelectorResult = {
};
export type FrameQuerySelectorAllParams = {
selector: string,
strict?: boolean,
};
export type FrameQuerySelectorAllOptions = {
strict?: boolean,
};
export type FrameQuerySelectorAllResult = {
elements: ElementHandleChannel[],

View file

@ -1486,7 +1486,6 @@ Frame:
querySelectorAll:
parameters:
selector: string
strict: boolean?
returns:
elements:
type: array

View file

@ -754,7 +754,6 @@ export function createScheme(tChannel: (name: string) => Validator): Scheme {
});
scheme.FrameQuerySelectorAllParams = tObject({
selector: tString,
strict: tOptional(tBoolean),
});
scheme.FrameSelectOptionParams = tObject({
selector: tString,

6
types/types.d.ts vendored
View file

@ -12893,6 +12893,12 @@ interface ElementHandleWaitForSelectorOptions {
*/
state?: "attached"|"detached"|"visible"|"hidden";
/**
* When true, the call requires selector to resolve to a single element. If given selector resolves to more then one
* element, the call throws an exception.
*/
strict?: boolean;
/**
* Maximum time in milliseconds, defaults to 30 seconds, pass `0` to disable timeout. The default value can be changed by
* using the