@wdio/browserstack-service
Version:
WebdriverIO service for better Browserstack integration
48 lines • 2.68 kB
TypeScript
import * as BrowserstackLocalLauncher from 'browserstack-local';
import type { Capabilities, Services, Options } from '@wdio/types';
import type { BrowserstackConfig, BrowserstackOptions, App, AppConfig, AppUploadResponse, UserConfig } from './types.js';
type BrowserstackLocal = BrowserstackLocalLauncher.Local & {
pid?: number;
stop(callback: (err?: Error) => void): void;
};
export default class BrowserstackLauncherService implements Services.ServiceInstance {
private _options;
private _config;
browserstackLocal?: BrowserstackLocal;
private _buildName?;
private _projectName?;
private _buildTag?;
private _buildIdentifier?;
private _accessibilityAutomation?;
private _percy?;
private _percyBestPlatformCaps?;
private readonly browserStackConfig;
constructor(_options: BrowserstackConfig & BrowserstackOptions, capabilities: Capabilities.TestrunnerCapabilities, _config: Options.Testrunner);
onWorkerStart(cid: string, caps: WebdriverIO.Capabilities): Promise<void>;
onPrepare(config: Options.Testrunner, capabilities: Capabilities.TestrunnerCapabilities | WebdriverIO.Capabilities): Promise<unknown>;
onComplete(): Promise<unknown>;
setupPercy(options: BrowserstackConfig & Options.Testrunner, config: Options.Testrunner, bsConfig: UserConfig): Promise<void>;
stopPercy(): Promise<void>;
_uploadApp(app: App): Promise<AppUploadResponse>;
/**
* @param {String | AppConfig} appConfig <string>: should be "app file path" or "app_url" or "custom_id" or "shareable_id".
* <object>: only "path" and "custom_id" should coexist as multiple properties.
*/
_validateApp(appConfig: AppConfig | string): Promise<App>;
_uploadServiceLogs(): Promise<void>;
_updateObjectTypeCaps(capabilities?: Capabilities.TestrunnerCapabilities | WebdriverIO.Capabilities, capType?: string, value?: {
[key: string]: unknown;
}): void;
_updateCaps(capabilities?: Capabilities.TestrunnerCapabilities, capType?: string, value?: string): void;
_handleBuildIdentifier(capabilities?: Capabilities.TestrunnerCapabilities): void;
_updateBrowserStackPercyConfig(): void;
/**
* @return {string} if buildName doesn't exist in json file, it will return 1
* else returns corresponding value in json file (e.g. { "wdio-build": { "identifier" : 2 } } => 2 in this case)
*/
_getLocalBuildNumber(): string | null;
_updateLocalBuildCache(filePath?: string, buildName?: string, buildIdentifier?: number): void;
_getClientBuildUuid(): string;
}
export {};
//# sourceMappingURL=launcher.d.ts.map