Skip to content

Commit

Permalink
feat(start): add a gecko driver path to the start command (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
cnishina authored Aug 23, 2016
1 parent 752a527 commit 7ec082a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/cmds/opts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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(
Expand Down
12 changes: 12 additions & 0 deletions lib/cmds/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 7ec082a

Please sign in to comment.