import type { Services, Capabilities, Options, Frameworks } from '@wdio/types'; import type { BrowserstackConfig, MultiRemoteAction } from './types.js'; import type { Pickle, Feature, ITestCaseHookParameter, CucumberHook } from './cucumber-types.js'; export default class BrowserstackService implements Services.ServiceInstance { private _caps; private _config; private _sessionBaseUrl; private _failReasons; private _hookFailReasons; private _pureTestFailReasons; private _scenariosThatRan; private _failureStatuses; private _browser?; private _suiteTitle?; private _suiteFile?; private _fullTitle?; private _options; private _specsRan; private _observability; private _currentTest?; private _insightsHandler?; private _accessibility; private _accessibilityHandler?; private _percy; private _percyCaptureMode; private _percyHandler?; private _turboScale; constructor(options: BrowserstackConfig & Options.Testrunner, _caps: Capabilities.RemoteCapability, _config: Options.Testrunner); _updateCaps(fn: (caps: WebdriverIO.Capabilities | Capabilities.DesiredCapabilities) => void): void; beforeSession(config: Omit, capabilities: WebdriverIO.Capabilities): Promise; before(caps: Capabilities.RemoteCapability, specs: string[], browser: WebdriverIO.Browser): Promise; /** * Set the default job name at the suite level to make sure we account * for the cases where there is a long running `before` function for a * suite or one that can fail. * Don't do this for Jasmine because `suite.title` is `Jasmine__TopLevel__Suite` * and `suite.fullTitle` is `undefined`, so no alternative to use for the job name. */ beforeSuite(suite: Frameworks.Suite): Promise; beforeHook(test: Frameworks.Test | CucumberHook, context: any): Promise; afterHook(test: Frameworks.Test | CucumberHook, context: unknown, result: Frameworks.TestResult): Promise; beforeTest(test: Frameworks.Test): Promise; afterTest(test: Frameworks.Test, context: never, results: Frameworks.TestResult): Promise; after(result: number): Promise; /** * For CucumberJS */ private _cliCucumberFramework; /** * A `Frameworks.Test`-shaped view of a scenario, for the cli/modules that read `args.test`. * automateModule.onBeforeTest is the first observer on TEST/PRE and dereferences `test.title` * unguarded, so an absent view takes down every later observer for that key — including the * one that emits the scenario event. * * `title` is left undefined and `fullName` populated deliberately. Legacy calls * `_setSessionName(feature.name)` with NO test argument, so `sessionNameFormat` receives * `undefined` as its fourth argument and the mocha arm (`test && !test.fullName`, which * activates sessionNamePrependTopLevelSuiteTitle / sessionNameOmitTestTitle) is never taken. * Both properties reproduce that. */ private _cucumberTestView; /** * A `Frameworks.TestResult`-shaped view of a scenario result, for automateModule's session * marking — which on the CLI flow is the only session-status authority, since `after()`'s * accumulation is gated off while the binary is up. * * Which statuses fail the SESSION is `_failureStatuses`, not the passed/failed collapse the * o11y result applies: UNDEFINED / AMBIGUOUS / UNKNOWN fail the session while reporting to * Observability as `skipped`, and PENDING joins them only under `cucumberOpts.strict`. */ private _cucumberTestResult; /** * Cucumber abandons the whole feature when a `BeforeAll` fails, so every scenario it never * reached (Rule-nested included) is reported skipped rather than vanishing. * * Sent straight to TestHub rather than through `trackEvent()`: legacy called * `listener.testFinished()` directly, so driving the observers per row would rename the * Automate session, stop the accessibility scan and run a Percy teardown for each one. Both * halves are sent because TestHub's v2 pipeline creates the row from the START event. */ private _reportCucumberScenariosSkipped; beforeFeature(uri: string, feature: Feature): Promise; /** * Runs before a Cucumber Scenario. * @param world world object containing information on pickle and test step */ beforeScenario(world: ITestCaseHookParameter): Promise; afterScenario(world: ITestCaseHookParameter): Promise; beforeStep(step: Frameworks.PickleStep, scenario: Pickle): Promise; afterStep(step: Frameworks.PickleStep, scenario: Pickle, result: Frameworks.PickleResult): Promise; onReload(oldSessionId: string, newSessionId: string): Promise; _isAppAutomate(): boolean; _updateJob(requestBody: any): Promise; _multiRemoteAction(action: MultiRemoteAction): Promise; _update(sessionId: string, requestBody: any): Promise>; _printSessionURL(): Promise; /** The file the CLI mocha framework gives root-level hooks, which mocha leaves without one. */ private _setCliSuiteFile; private _setSessionName; private _setAnnotation; private _executeCommand; private saveWorkerData; } //# sourceMappingURL=service.d.ts.map