@wdio/devtools-service
Version:
Hook up WebdriverIO with DevTools
37 lines (36 loc) • 1.27 kB
TypeScript
export declare function setCurrentSpecFile(file?: string): void;
/**
* Get the top-level browser object from an element/browser
*/
export declare function getBrowserObject(elem: WebdriverIO.Element | WebdriverIO.Browser): WebdriverIO.Browser;
/**
* Parse a JS/TS test/spec file to collect suite/test calls (Mocha/Jasmine) with full title path
*/
export declare function findTestLocations(filePath: string): {
type: "test" | "suite";
name: string;
titlePath: string[];
line?: number;
column?: number;
}[];
/**
* Capture stack trace and try to find a user frame.
* Prefer step-definition files, then spec/tests, then feature files.
*/
export declare function getCurrentTestLocation(): {
file: string;
line: number;
column: number;
} | null;
/**
* Enrich stats:
* - Cucumber: prefer step-definition file/line
* - Mocha/Jasmine: AST with suite path; fallback to runtime stack
*/
export declare function mapTestToSource(testStats: any, hintFile?: string): void;
/**
* Enrich a suite with file + line
* - Mocha/Jasmine: map "describe/context" by title path using AST
* - Cucumber: find Feature/Scenario line in .feature file
*/
export declare function mapSuiteToSource(suiteStats: any, hintFile?: string, suitePath?: string[]): void;