UNPKG

playwright-performance-reporter

Version:

Measure and publish performance metrics from browser dev-tools when running playwright

40 lines (39 loc) 1.25 kB
import { type Metrics, type SupportedBrowsers, type HookOrder, type TargetMetric, type MetricObserver } from '../types/index.js'; export declare class MetricsEngine { /** * Client reference to the browser */ private browser; /** * Options for connection to the browser */ private browserOptions; /** * Starts client * * @param browser which client to setup */ setupBrowser(browser: SupportedBrowsers | string | undefined, options: Record<string, any>): Promise<boolean>; /** * Shutdown client */ destroy(): void; /** * Get current running client */ getBrowser(): SupportedBrowsers | undefined; /** * Dispatches metric fetch from browser and return metric * * @param metric which metric to measure * @param hookOrder step to run */ getMetric(metric: Metrics, hookOrder: HookOrder): Promise<TargetMetric[] | undefined>; /** * Dispatches custom metric fetch from browser and return metric * * @param customMetric user defined fetch function * @param hookOrder step to run */ runCustomMetric(customMetric: MetricObserver, hookOrder: HookOrder): Promise<TargetMetric[] | undefined>; }