diff --git a/types/selenium-standalone/index.d.ts b/types/selenium-standalone/index.d.ts index 7ffc3f563e..9710abc801 100644 --- a/types/selenium-standalone/index.d.ts +++ b/types/selenium-standalone/index.d.ts @@ -22,11 +22,7 @@ export interface InstallOpts { basePath?: string; version?: string; drivers?: { - [browser: string]: { - version?: string; - arch: string | "ia32" | "x64"; - baseURL: string; - } + [browser: string]: DriverOptions }; progressCb?: (totalLength: number, progressLength: number, chunkLength: number) => void; logger?: (message: string) => void; @@ -38,11 +34,7 @@ export interface StartOpts { basePath?: string; version?: string; drivers?: { - [browser: string]: { - version?: string; - arch: string | "ia32" | "x64"; - baseURL: string; - } + [browser: string]: DriverOptions }; seleniumArgs?: string[]; javaArgs?: string[]; @@ -53,6 +45,12 @@ export interface StartOpts { cb?: (error: Error, child: ChildProcess) => void; } +export interface DriverOptions { + version?: string; + arch?: string | "ia32" | "x64"; + baseURL?: string; +} + export interface FsPaths { [x: string]: any; chrome?: { diff --git a/types/selenium-standalone/selenium-standalone-tests.ts b/types/selenium-standalone/selenium-standalone-tests.ts index 9d83bb9a4b..c16b7d6a25 100644 --- a/types/selenium-standalone/selenium-standalone-tests.ts +++ b/types/selenium-standalone/selenium-standalone-tests.ts @@ -24,6 +24,15 @@ let installOpts: InstallOpts = { cb: (error: Error) => {}, }; +const installOptsCompact: InstallOpts = { + version: "version", + drivers: { + chrome: { + version: "chrome_version", + }, + }, +}; + installOpts = {}; installOpts = { @@ -60,6 +69,15 @@ let startOpts: StartOpts = { }; startOpts = {}; +const startOptsCompact: StartOpts = { + version: "version", + drivers: { + firefox: { + version: "version", + } + }, +}; + // FsPaths interface let fsPaths: FsPaths = { bla: "foo", @@ -88,8 +106,10 @@ fsPaths = {}; // start method start(startOpts, (error: Error | null, selenium: ChildProcess) => {}); +start(installOptsCompact, (error: Error | null, selenium: ChildProcess) => {}); start((error: Error | null, selenium: ChildProcess) => {}); // install method install(installOpts, (error: Error | undefined, fsPaths: FsPaths) => {}); +install(installOptsCompact, (error: Error | undefined, fsPaths: FsPaths) => {}); install((error: Error | undefined, fsPaths: FsPaths) => {});