1 | import { MatchImageSnapshotOptions } from 'jest-image-snapshot';
|
2 | import { Base64ScreenShotOptions, Browser, DirectNavigationOptions, Page, ElementHandle } from 'puppeteer';
|
3 | export interface Context {
|
4 | kind: string;
|
5 | story: string;
|
6 | parameters: {
|
7 | [key: string]: any;
|
8 | };
|
9 | }
|
10 | interface Options {
|
11 | context: Context;
|
12 | url: string;
|
13 | }
|
14 | export interface CommonConfig {
|
15 | storybookUrl: string;
|
16 | chromeExecutablePath: string;
|
17 | getGotoOptions: (options: Options) => DirectNavigationOptions;
|
18 | customizePage: (page: Page) => Promise<void>;
|
19 | getCustomBrowser: () => Promise<Browser>;
|
20 | setupTimeout: number;
|
21 | testTimeout: number;
|
22 | }
|
23 | export interface PuppeteerTestConfig extends CommonConfig {
|
24 | testBody: ((page: Page, options: Options) => void | Promise<void>) & {
|
25 | filter?: (options: Options) => boolean;
|
26 | };
|
27 | }
|
28 | export interface ImageSnapshotConfig extends CommonConfig {
|
29 | getMatchOptions: (options: Options) => MatchImageSnapshotOptions;
|
30 | getScreenshotOptions: (options: Options) => Base64ScreenShotOptions;
|
31 | beforeScreenshot: (page: Page, options: Options) => Promise<void | ElementHandle>;
|
32 | afterScreenshot: (options: {
|
33 | image: string;
|
34 | context: Context;
|
35 | }) => Promise<void>;
|
36 | }
|
37 | export interface AxeConfig extends CommonConfig {
|
38 | beforeAxeTest: (page: Page, options: Options) => Promise<void>;
|
39 | }
|
40 | export declare const defaultCommonConfig: CommonConfig;
|
41 | export declare const defaultPuppeteerTestConfig: PuppeteerTestConfig;
|
42 | export declare const defaultImageSnapshotConfig: ImageSnapshotConfig;
|
43 | export declare const defaultAxeConfig: AxeConfig;
|
44 | export {};
|