import { ConsoleMessage, Page } from 'puppeteer'; import { DiffImagesOptions } from "../utils/diff-images.js"; import BrowserDriver, { ServerConfiguration } from "./browser-driver.js"; declare global { function browserTestDriver_fail(): void; function browserTestDriver_finish(): string; function browserTestDriver_emulateInput(event: unknown): Promise; function browserTestDriver_captureAndDiffScreen(opts: DiffImagesOpts): Promise; } type BrowserTestDriverProps = { title?: string; headless?: boolean; maxConsoleMessageLength?: number; server: ServerConfiguration; browser?: object; exposeFunctions?: any; url?: string; onStart?: (params: { page: Page; }) => void | Promise; onFinish?: (params: { page: Page; isSuccessful: boolean; }) => void | Promise; }; export type DiffImagesOpts = DiffImagesOptions & { goldenImage: string; region?: any; saveOnFail?: boolean; saveAs?: string; }; /** @todo this seems like just a light repackaging of the underlying result type. Reuse or better separation of types? */ export type DiffImageResult = { headless: boolean; match: string | number; matchPercentage: string; success: boolean; error: Error | string | null; }; /** A test driver that starts a browser instance and runs tests inside it */ export default class BrowserTestDriver extends BrowserDriver { title: string; headless: boolean; time: number; failures: number; maxConsoleMessageLength: number; run(config: BrowserTestDriverProps): Promise; _openPage(url: string, config: BrowserTestDriverProps): Promise; _onConsole(event: ConsoleMessage): void; _onFinish(message: string): void; _pass(message: string): void; _fail(message: string): void; _emulateInput(event: any): any; _captureAndDiff(opts: DiffImagesOpts): Promise; _saveScreenshot(filename: any, data: any): void; } export {}; //# sourceMappingURL=browser-test-driver.d.ts.map