UNPKG

@progress/kendo-e2e

Version:

Kendo UI end-to-end test utilities.

46 lines (45 loc) 1.73 kB
type ImageSnapshotOptions = { hideSelectors?: string[]; offsetY?: number; sleep?: number; tolerance?: number; ignoreCaret?: boolean; timeout?: number; }; type ImageSnapshotResult = { same?: boolean; }; /** * Takes an image snapshot of an element and stores in the specified location. * * The image is compared using [looks-same](https://www.npmjs.com/package/looks-same) before overwriting. * * If `SKIP_IMAGE_UPLOAD_AND_FAIL` environment variable provided, the method throws error and the image writing is skipped. * * @example * await snapshotImage(driver, '#test-area', `${artifactsPath}/column-menu.png`, { * hideSelectors: ['div#demoToolbar'] * }); * * @param driver WebDriver instance * @param selector A selector that matches the element to screenshot. If multiple elements match, only the first will be used. * @param outputPath The path to the screenshot file to be created or updated. * @param options Screenshot options. */ export declare function snapshotImage(driver: any, selector: string, outputPath: string, options?: ImageSnapshotOptions): Promise<ImageSnapshotResult>; /** * Takes an image snapshot of view port. * * The image is compared using [looks-same](https://www.npmjs.com/package/looks-same) before overwriting. * * @example * await snapshotViewPort(driver, `${artifactsPath}/column-menu.png`, { * hideSelectors: ['div#demoToolbar'] * }); * * @param driver WebDriver instance * @param outputPath The path to the screenshot file to be created or updated. * @param options Screenshot options. */ export declare function snapshotViewPort(driver: any, outputPath: string, options?: ImageSnapshotOptions): Promise<ImageSnapshotResult>; export {};