@playwright-testing-library/test
Version:
playwright + dom-testing-library
31 lines (29 loc) • 1.39 kB
TypeScript
import { Page } from "@playwright/test";
import waitForExpect from 'wait-for-expect';
import { Config } from './common';
import { ElementHandle, Queries, ScopedQueries } from './typedefs';
declare type ContextFn = (...args: any[]) => ElementHandle;
export declare function getDocument(_page?: Page): Promise<ElementHandle>;
declare type WaitForCallback = Parameters<typeof waitForExpect>[0];
export declare function wait(callback: WaitForCallback, { timeout, interval }?: {
timeout?: number;
interval?: number;
}): Promise<{}>;
export declare const waitFor: typeof wait;
/**
* Configuration API for legacy queries that return `ElementHandle` instances.
* Only `testIdAttribute` and `asyncUtilTimeout` are currently supported.
* @see {@link https://testing-library.com/docs/dom-testing-library/api-configuration}
*
* ⚠️ This API has no effect on the queries that return `Locator` instances. Use
* `test.use` instead to configure the `Locator` queries.
*
* @see {@link https://github.com/testing-library/playwright-testing-library/releases/tag/v4.4.0-beta.2}
*
* @param config
*/
export declare function configure(config: Partial<Config>): void;
export declare function getQueriesForElement<T>(object: T, contextFn?: ContextFn): T & Queries & ScopedQueries;
export declare const within: typeof getQueriesForElement;
export declare const queries: Queries;
export {};