Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
TypeScript automationchromechromiume2e-testingelectronend-to-end-testingfirefoxjavascriptplaywrighttesttest-automationtestingtesting-toolswebwebkit
fix(types): expose signal option of Locator.elementHandle (#42520)
Ashraf Alid4b2db46a649
diff --git a/packages/playwright-client/types/types.d.ts b/packages/playwright-client/types/types.d.tsindex 2acee94c52..b14199edc3 100644--- a/packages/playwright-client/types/types.d.ts+++ b/packages/playwright-client/types/types.d.ts@@ -14382,7 +14382,7 @@ export interface Locator {* multiple elements match the locator, throws.* @param options*/- elementHandle(options?: { timeout?: number }): Promise<ElementHandle<SVGElement | HTMLElement>>;+ elementHandle(options?: { timeout?: number, signal?: AbortSignal }): Promise<ElementHandle<SVGElement | HTMLElement>>;/*** Highlight the corresponding element(s) on the screen. Useful for debugging, don't commit the code that uses* [locator.highlight([options])](https://playwright.dev/docs/api/class-locator#locator-highlight).diff --git a/packages/playwright-core/types/types.d.ts b/packages/playwright-core/types/types.d.tsindex 2acee94c52..b14199edc3 100644--- a/packages/playwright-core/types/types.d.ts+++ b/packages/playwright-core/types/types.d.ts@@ -14382,7 +14382,7 @@ export interface Locator {* multiple elements match the locator, throws.* @param options*/- elementHandle(options?: { timeout?: number }): Promise<ElementHandle<SVGElement | HTMLElement>>;+ elementHandle(options?: { timeout?: number, signal?: AbortSignal }): Promise<ElementHandle<SVGElement | HTMLElement>>;/*** Highlight the corresponding element(s) on the screen. Useful for debugging, don't commit the code that uses* [locator.highlight([options])](https://playwright.dev/docs/api/class-locator#locator-highlight).diff --git a/utils/generate_types/overrides.d.ts b/utils/generate_types/overrides.d.tsindex a329924e5a..62a2231567 100644--- a/utils/generate_types/overrides.d.ts+++ b/utils/generate_types/overrides.d.ts@@ -198,7 +198,7 @@ export interface Locator {evaluateHandle<R, Arg, E extends SVGElement | HTMLElement = SVGElement | HTMLElement>(pageFunction: PageFunctionOn<E, Arg, R>, arg?: Arg, options?: { timeout?: number, signal?: AbortSignal, exposeFunctions?: boolean }): Promise<SmartHandle<R>>;evaluateAll<R, Arg, E extends SVGElement | HTMLElement = SVGElement | HTMLElement>(pageFunction: PageFunctionOn<E[], Arg, R>, arg?: Arg): Promise<R>;waitForFunction<Arg, E extends SVGElement | HTMLElement = SVGElement | HTMLElement>(pageFunction: PageFunctionOn<E, Arg, any>, arg?: Arg, options?: { timeout?: number, signal?: AbortSignal }): Promise<void>;- elementHandle(options?: { timeout?: number }): Promise<ElementHandle<SVGElement | HTMLElement>>;+ elementHandle(options?: { timeout?: number, signal?: AbortSignal }): Promise<ElementHandle<SVGElement | HTMLElement>>;highlight(options?: { style?: string | { [key: string]: string | number } }): Promise<Disposable>;toString(): string;}