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 _failedScenarios; private _runningScenarios; 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; beforeTest(test: Frameworks.Test): Promise; 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; /** * Runs before a Cucumber Scenario. * @param world world object containing information on pickle and test step */ beforeScenario(world: Frameworks.World): Promise | undefined; beforeStep(step: Frameworks.PickleStep): Promise; /** * 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; /** * 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 | undefined; updateJob(sessionId: string, failures: number, calledOnReload?: boolean, browserName?: string): Promise; /** * VM message data */ getBody(failures: number, calledOnReload?: boolean, browserName?: string): Partial; /** * Update the running Sauce Labs Job with an annotation */ setAnnotation(annotation: string): Promise; private _setJobName; private _getStatusForTestRun; private _getOsName; private _collectTestRun; private _updateJobIdInTestRuns; } //# sourceMappingURL=service.d.ts.map