Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

Commit

Permalink
fix(config): do not flatten capabilities (#3291)
Browse files Browse the repository at this point in the history
This is no longer necessary in the latest version of selenium-webdriver.
Without this change, `--capabilities.chromeOptions.binary` will do nothing,
for example.

Closes #3290
  • Loading branch information
juliemr authored and cnishina committed Jun 21, 2016
1 parent cd21f4d commit e9b49f2
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions lib/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,25 +89,6 @@ if (argv.version) {
process.exit(0);
}

// WebDriver capabilities properties require dot notation, but optimist parses
// that into an object. Re-flatten it.
function flattenObject(obj: any, prefix?: string, out?: any): any {
prefix = prefix || '';
out = out || {};
for (var prop in obj) {
if (obj.hasOwnProperty(prop)) {
typeof obj[prop] === 'object' ?
flattenObject(obj[prop], prefix + prop + '.', out) :
out[prefix + prop] = obj[prop];
}
}
return out;
};

if (argv.capabilities) {
argv.capabilities = flattenObject(argv.capabilities);
}

/**
* Helper to resolve comma separated lists of file pattern strings relative to
* the cwd.
Expand Down

0 comments on commit e9b49f2

Please sign in to comment.