import type { Page, BrowserContextOptions, LaunchOptions } from 'playwright'; import { SafeRequire } from './safe-require'; import { Hooks } from './safepage'; import type { MatchImageSnapshotOptions } from 'jest-image-snapshot'; export declare const SAFETEST_INTERFACE = "__safetestApi__"; export interface Bridge { (callback: () => Return | Promise): Promise; (args: Args, callback: (args: Args) => Return | Promise): Promise; } export interface RenderOptions extends LaunchOptions, BrowserContextOptions { browser?: 'chromium' | 'firefox' | 'webkit'; /** The base URL of the running app. Defaults to `localhost:3000` per CRA. */ url?: string; /** Remote server to connect to. See https://playwright.dev/docs/api/class-browsertype#browser-type-launch-server */ browserServer?: string; /** The subpath to navigate to when opening the page. */ subPath?: string; /** options to use in CI. */ ciOptions?: { /** * Shorthand for: * * failureScreenshotsDir: `${ARTIFACTS_DIR}/failure_screenshots`, * recordVideo: { dir: `${ARTIFACTS_DIR}/videos` }, * recordTraces: `${ARTIFACTS_DIR}/traces`, * matchImageSnapshotOptions: { * customDiffDir: `${ARTIFACTS_DIR}/image_diffs`, * storeReceivedOnFailure: true, * customReceivedDir: `${ARTIFACTS_DIR}/updated_snapshots`, * customReceivedPostfix: '', * failureThreshold: 0, * } */ usingArtifactsDir: string; } | RenderOptions; /** Path to record coverage json files to for each test */ /** Path to failure-screenshots, defaults to `failure-screenshots/`. */ failureScreenshotsDir?: string; hooks?: Partial; recordTraces?: string; ignoreConsoleMessages?: RegExp[]; /** The default timeout. See {@link Page.setDefaultTimeout} */ defaultTimeout?: number; /** The timeout for the first page render in case there are some network auth handshakes that take a while. */ initialNavigationTimeout?: number; /** The default timeout for navigation. See {@link Page.setDefaultNavigationTimeout} */ defaultNavigationTimeout?: number; matchImageSnapshotOptions?: MatchImageSnapshotOptions; /** Run the tests inside a docker container for consistency. */ useDocker?: boolean; /** HACK: enable workaround to allow screen casting the page without breaking playwright events. */ enableScreenCasting?: boolean; /** Only run test the following tests (full test name). */ debugTests?: string[]; } export interface RenderReturn { /** The Playwright page object of the rendered component. */ page: Page; /** Pause current test. */ pause: () => Promise; /** Bridge API to communicate with browser from node */ bridge: Bridge; /** Node require function, will return an `anything` proxy in the browser */ require: SafeRequire; } type RenderableThing = { __isRenderable: true; thing: any; }; export declare function render(element: RenderableThing, options: RenderOptions, howToRender: (element: RenderableThing) => Promise): Promise; export {}; //# sourceMappingURL=render.d.ts.map