From 7d8e9741ecc9fa4241431f1494f0ab0b3ad280c0 Mon Sep 17 00:00:00 2001 From: Mykola Grybyk <25589559+mgrybyk@users.noreply.github.com> Date: Mon, 21 Sep 2020 10:25:22 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#47761=20Fix=20sele?= =?UTF-8?q?nium-standalone=20driver=20options=20by=20@mgrybyk?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/selenium-standalone/index.d.ts | 18 ++++++++--------- .../selenium-standalone-tests.ts | 20 +++++++++++++++++++ 2 files changed, 28 insertions(+), 10 deletions(-) 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) => {});