UNPKG

@wdio/devtools-service

Version:
40 lines (39 loc) 1.68 kB
import { Services, Capabilities, Options } from '@wdio/types'; import { WebDriverCommands } from '@wdio/protocols'; import { DevToolsAppLauncher } from './launcher.js'; import { TraceType } from './types.js'; export * from './types.js'; export declare const launcher: typeof DevToolsAppLauncher; /** * Setup WebdriverIO Devtools hook for standalone instances */ export declare function setupForDevtools(opts: Options.WebdriverIO): Options.WebdriverIO; export default class DevToolsHookService implements Services.ServiceInstance { #private; /** * allows to define the type of data being captured to hint the * devtools app which data to expect */ captureType: TraceType; before(caps: Capabilities.W3CCapabilities, __: string[], browser: WebdriverIO.Browser): Promise<void>; beforeSession(config: Options.Testrunner, capabilities: Capabilities.W3CCapabilities): void; /** * Hook for Cucumber framework. * beforeScenario is triggered at the beginning of every worker session, therefore * we can use it to reset the command stack and last command signature */ beforeScenario(): void; /** * Hook for Mocha/Jasmine frameworks. * It does the exact same thing as beforeScenario. */ beforeTest(): void; private resetStack; beforeCommand(command: string, args: string[]): Promise<void>; afterCommand(command: keyof WebDriverCommands, args: any[], result: any, error?: Error): Promise<void> | undefined; /** * after hook is triggered at the end of every worker session, therefore * we can use it to write all trace information to a file */ after(): Promise<void>; }