UNPKG

@wdio/visual-service

Version:

Image comparison / visual regression testing for WebdriverIO

55 lines 2.62 kB
import type { Folders, InstanceData, CheckScreenMethodOptions, SaveScreenMethodOptions, CheckFullPageMethodOptions, SaveFullPageMethodOptions, CheckElementMethodOptions, SaveElementMethodOptions, TestContext } from 'webdriver-image-comparison'; import type { NativeContextType } from './types.js'; /** * Get the folders data * * If folder options are passed in use those values * Otherwise, use the values set during instantiation */ type getFolderMethodOptions = CheckElementMethodOptions | CheckFullPageMethodOptions | CheckScreenMethodOptions | SaveElementMethodOptions | SaveFullPageMethodOptions | SaveScreenMethodOptions; export declare function getFolders(methodOptions: getFolderMethodOptions, folders: Folders, currentTestPath: string): Folders; /** * Get the size of a screenshot in pixels without the device pixel ratio */ export declare function getScreenshotSize(screenshot: string, devicePixelRation?: number): { height: number; width: number; }; /** * Get the device pixel ratio */ export declare function getDevicePixelRatio(screenshot: string, deviceScreenSize: { height: number; width: number; }): number; /** * Get the LambdaTest options, these can be case insensitive */ export declare function getLtOptions(capabilities: WebdriverIO.Capabilities): any | undefined; /** * Get the instance data */ export declare function getInstanceData(currentBrowser: WebdriverIO.Browser): Promise<InstanceData>; /** * Traverse up the scope chain until browser element was reached */ export declare function getBrowserObject(elem: WebdriverIO.Element | WebdriverIO.Browser): WebdriverIO.Browser; /** * We can't say it's native context if the autoWebview is provided and set to true, for all other cases we can say it's native */ export declare function determineNativeContext(driver: WebdriverIO.Browser | WebdriverIO.MultiRemoteBrowser): NativeContextType; /** * Get the native context for the current browser */ export declare function getNativeContext(browser: WebdriverIO.Browser | WebdriverIO.MultiRemoteBrowser, currentBrowser: WebdriverIO.Browser, nativeContext: NativeContextType): boolean; /** * Make sure we have all the data for the test context */ export declare function enrichTestContext({ commandName, currentTestContext: { framework, parent, title, }, instanceData: { appName, browserName, browserVersion, deviceName, isAndroid, isIOS, isMobile, platformName, platformVersion, }, tag, }: { commandName: string; currentTestContext: TestContext; instanceData: InstanceData; tag: string; }): TestContext; export {}; //# sourceMappingURL=utils.d.ts.map