UNPKG

test-real-styles

Version:

utilities to test real styling of dom elements

25 lines (24 loc) 1.05 kB
import { Browser, BrowserContext, Page } from 'playwright'; import { Styles } from './resolveStyleInput'; import { Options } from './getStyles'; export declare const PLAYWRIGHT_BROWSERS: ("chromium" | "firefox" | "webkit")[]; export type PlaywrightBrowser = (typeof PLAYWRIGHT_BROWSERS)[0]; export interface LaunchedPage { name: PlaywrightBrowser; getPlaywright(): Promise<{ browser: Browser; context: BrowserContext; page: Page; }>; updatePage(element: HTMLElement | Document, options?: { transitions?: boolean; styles?: Styles | Promise<Styles>; }): Promise<void>; getStyles<T extends (keyof CSSStyleDeclaration)[]>(element: HTMLElement, styles: T, options?: Options): Promise<{ [key in T[0]]: string; }>; hover(element: HTMLElement): Promise<void>; focus(element: HTMLElement): Promise<void>; } export default function launchPage(browserName: PlaywrightBrowser, stylesInput: Styles | Promise<Styles>): LaunchedPage; export declare function cleanup(): Promise<void>;