@theintern/digdug
Version:
Dig Dug. A simple abstraction library for downloading and launching WebDriver service tunnels.
51 lines (50 loc) • 1.77 kB
TypeScript
/// <reference types="node" />
import Tunnel, { TunnelProperties, DownloadOptions, ChildExecutor } from './Tunnel';
import { CancellablePromise } from '@theintern/common';
export default class SeleniumTunnel extends Tunnel implements SeleniumProperties {
seleniumArgs: string[];
drivers: DriverDescriptor[];
baseUrl: string;
version: string;
seleniumTimeout: number;
webDriverDataUrl: string | null;
private _webDriverDataLoaded;
constructor(options?: SeleniumOptions);
get artifact(): string;
get directory(): string;
get executable(): string;
get isDownloaded(): boolean;
get url(): string;
download(forceDownload?: boolean): CancellablePromise<void>;
sendJobState(): CancellablePromise<void>;
protected _updateWebDriverData(): CancellablePromise<void>;
protected _getDriverConfigs(): DriverFile[];
protected _makeArgs(): string[];
protected _postDownloadFile(data: Buffer, options: SeleniumDownloadOptions): Promise<void>;
protected _start(executor: ChildExecutor): CancellablePromise<any>;
}
export interface DriverFile extends RemoteFile {
seleniumProperty: string;
}
export interface RemoteFile {
dontExtract?: boolean;
directory?: string;
executable: string;
url: string;
}
export declare type DriverDescriptor = string | DriverFile | {
name: string;
version?: string;
};
export interface SeleniumProperties extends TunnelProperties {
seleniumArgs: string[];
drivers: DriverDescriptor[];
baseUrl: string;
version: string;
seleniumTimeout: number;
}
export declare type SeleniumOptions = Partial<SeleniumProperties>;
export interface SeleniumDownloadOptions extends DownloadOptions {
executable?: string;
dontExtract?: boolean;
}