UNPKG

@wdio/sauce-service

Version:

WebdriverIO service that provides a better integration into Sauce Labs

79 lines 3.14 kB
import { default as SauceLabs } from 'saucelabs'; import type { Services, Capabilities, Options, Frameworks } from '@wdio/types'; import type { SauceServiceConfig } from './types.js'; export default class SauceService implements Services.ServiceInstance { private _capabilities; private _config; private _testCnt; private _maxErrorStackLength; private _failures; private _isServiceEnabled; private _isJobNameSet; private _testStartTime; private _options; private _api; private _browser?; private _isRDC?; private _suiteTitle?; private _cid; private _testRuns; constructor(options: SauceServiceConfig, _capabilities: Capabilities.ResolvedTestrunnerCapabilities, _config: Options.Testrunner); /** * gather information about runner */ beforeSession(_: Options.Testrunner, __: never, ___: never, cid: string): void; before(_: unknown, __: string[], browser: WebdriverIO.Browser | WebdriverIO.MultiRemoteBrowser): void; beforeSuite(suite: Frameworks.Suite): Promise<void>; beforeTest(test: Frameworks.Test): Promise<any>; afterSuite(suite: Frameworks.Suite): void; private _reportErrorLog; afterTest(test: Frameworks.Test, context: unknown, results: Frameworks.TestResult): void; afterHook(test: never, context: never, results: Frameworks.TestResult): void; /** * For CucumberJS */ beforeFeature(uri: unknown, feature: { name: string; }): Promise<any>; /** * Runs before a Cucumber Scenario. * @param world world object containing information on pickle and test step */ beforeScenario(world: Frameworks.World): Promise<any> | undefined; beforeStep(step: Frameworks.PickleStep): Promise<any>; /** * Runs after a Cucumber Scenario. * @param world world object containing information on pickle and test step * @param result result object containing * @param result.passed true if scenario has passed * @param result.error error stack if scenario failed * @param result.duration duration of scenario in milliseconds */ afterScenario(world: Frameworks.World, result: Frameworks.PickleResult): void; /** * update Sauce Labs job */ after(result: number): Promise<any>; /** * upload files to Sauce Labs platform * @param jobId id of the job * @returns a promise that is resolved once all files got uploaded */ private _uploadLogs; onReload(oldSessionId: string, newSessionId: string): Promise<void> | undefined; updateJob(sessionId: string, failures: number, calledOnReload?: boolean, browserName?: string): Promise<void>; /** * VM message data */ getBody(failures: number, calledOnReload?: boolean, browserName?: string): Partial<SauceLabs.Job>; /** * Update the running Sauce Labs Job with an annotation */ setAnnotation(annotation: string): Promise<any>; private _setJobName; private _getStatusForTestRun; private _getOsName; private _collectTestRun; private _updateJobIdInTestRuns; } //# sourceMappingURL=service.d.ts.map