UNPKG

@applitools/spec-driver-playwright

Version:
43 lines (42 loc) 3.08 kB
declare const _default: SpecDriver; export default _default; export function isDriver(page: any): page is Driver; export function isContext(frame: any): frame is Context; export function isElement(element: any): element is Element<Node>; export function isSelector(selector: any): selector is Selector; export function isStaleElementError(err: any): boolean; export function toSelector(selector: import('@applitools/driver').CommonSelector<Selector>): Selector; export function toSimpleCommonSelector(selector: Selector): null | import('@applitools/driver').CommonSelector; export function extractContext(page: Driver): Context; export function executeScript(frame: Context, script: string | ((arg: any) => any), arg: any): Promise<any>; export function executeBrowserCommands(page: Driver, commands: Array<import('@applitools/driver').BrowserCommand>, logger?: any): Promise<any>; export function findElement(frame: Context, selector: Selector, parent?: undefined | Element<Node>): Promise<null | Element<SVGElement | HTMLElement>>; export function findElements(frame: Context, selector: Selector, parent?: undefined | Element<Node>): Promise<Array<Element<SVGElement | HTMLElement>>>; export function setElementText(frame: Context, element: Selector | Element<Node>, text: string): Promise<void>; export function hover(_frame: Context, element: Element<Node>): Promise<void>; export function click(_frame: Context, element: Element<Node>): Promise<void>; export function mainContext(frame: Context): Promise<Context>; export function parentContext(frame: Context): Promise<Context>; export function childContext(_frame: Context, element: Element<Node>): Promise<Context>; export function getDriverInfo(_page: Driver): Promise<import('@applitools/driver').DriverInfo>; export function getViewportSize(page: Driver): Promise<{ width: number; height: number; }>; export function setViewportSize(page: Driver, size: { width: number; height: number; }): Promise<void>; export function getCookies(page: Driver): Promise<Array<import('@applitools/driver').Cookie>>; export function getTitle(page: Driver): Promise<string>; export function getUrl(page: Driver): Promise<string>; export function visit(page: Driver, url: string): Promise<void>; export function takeScreenshot(page: Driver): Promise<Uint8Array>; export function build(env: any): Promise<[Driver, () => Promise<void>, () => import('playwright-core').Browser]>; export type Driver = import('playwright-core').Page & { __applitoolsBrand?: undefined; }; export type Context = import('playwright-core').Frame & { __applitoolsBrand?: undefined; }; export type Element<T = Node> = import('playwright-core').ElementHandle<T> & { __applitoolsBrand?: undefined; }; export type Selector = (string | import('playwright-core').Locator) & { __applitoolsBrand?: undefined; }; export type PrimarySpecType = { driver: Driver; context: Context; element: Element<Node>; selector: Selector; secondary: never; userFunction: unknown; }; export type SpecDriver = import('@applitools/driver').SpecDriver<PrimarySpecType>;