diff --git a/lib/cmds/opts.ts b/lib/cmds/opts.ts index 63ca7b22..04fd257e 100644 --- a/lib/cmds/opts.ts +++ b/lib/cmds/opts.ts @@ -14,6 +14,7 @@ export const CHROME = 'chrome'; export const IE = 'ie'; export const IE32 = 'ie32'; export const EDGE = 'edge'; +export const GECKO = 'gecko'; export const ANDROID = 'android'; export const IOS = 'ios'; export const VERSIONS_CHROME = 'versions.chrome'; @@ -51,6 +52,7 @@ opts[IE32] = new Option(IE32, 'Install or update 32-bit ie driver', 'boolean', I opts[EDGE] = new Option( EDGE, 'Use installed Microsoft Edge driver', 'string', 'C:\\Program Files (x86)\\Microsoft Web Driver\\MicrosoftWebDriver.exe'); +opts[GECKO] = new Option(GECKO, 'Use path for gecko driver', 'string'); opts[ANDROID] = new Option(ANDROID, 'Update/use the android sdk', 'boolean', AndroidSDK.isDefault); opts[IOS] = new Option(IOS, 'Update the iOS sdk', 'boolean', false); opts[VERSIONS_CHROME] = new Option( diff --git a/lib/cmds/start.ts b/lib/cmds/start.ts index 94c2dfdc..461166e6 100644 --- a/lib/cmds/start.ts +++ b/lib/cmds/start.ts @@ -26,6 +26,7 @@ let prog = new Program() .addOption(Opts[Opt.VERSIONS_ANDROID]) .addOption(Opts[Opt.VERSIONS_APPIUM]) .addOption(Opts[Opt.CHROME_LOGS]) + .addOption(Opts[Opt.GECKO]) .addOption(Opts[Opt.LOGGING]) .addOption(Opts[Opt.ANDROID]) .addOption(Opts[Opt.AVDS]) @@ -152,6 +153,17 @@ function start(options: Options) { // driver does not exist. } } + if (options[Opt.GECKO].getString()) { + let gecko = options[Opt.GECKO].getString(); + try { + if (fs.statSync(gecko).isFile()) { + args.push('-Dwebdriver.edge.driver=' + gecko); + } + } catch (err) { + // The file does not exist. + logger.warn('The absolute path provided for gecko (' + gecko + ') does not exist'); + } + } if (options[Opt.ANDROID].getBoolean()) { if (downloadedBinaries[AndroidSDK.id] != null) { let avds = options[Opt.AVDS].getString();