@wdio/devtools-service
Version:
Hook up WebdriverIO with DevTools
35 lines (34 loc) • 1.2 kB
TypeScript
import { WebDriverCommands } from '@wdio/protocols';
import { CommandLog, TraceLog } from './types.js';
export declare class SessionCapturer {
#private;
commandsLog: CommandLog[];
sources: Map<string, string>;
mutations: TraceMutation[];
traceLogs: string[];
consoleLogs: ConsoleLogs[];
metadata?: {
url: string;
viewport: VisualViewport;
};
constructor(devtoolsOptions?: {
hostname?: string;
port?: number;
});
get isReportingUpstream(): boolean;
/**
* after command hook
*
* Used to
* - capture command logs
* - capture trace data from the application under test
*
* @param {string} command command name
* @param {Array} args command arguments
* @param {object} result command result
* @param {Error} error command error
*/
afterCommand(browser: WebdriverIO.Browser, command: keyof WebDriverCommands, args: any[], result: any, error: Error | undefined, callSource?: string): Promise<void>;
injectScript(browser: WebdriverIO.Browser): Promise<void>;
sendUpstream<Scope extends keyof TraceLog>(scope: Scope, data: Partial<TraceLog[Scope]>): void;
}