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

Commit

Permalink
fix(cli): convert capabilities arguments to dot-notation for WebDrive…
Browse files Browse the repository at this point in the history
…r compatibility
  • Loading branch information
RobbinHabermehl authored and juliemr committed Feb 10, 2014
1 parent 6bc5e29 commit 8924bbc
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,22 @@ if (argv.exclude) {
argv.exclude = processFilePatterns(argv.exclude);
}

// WebDriver capabilities properties require dot notation.
var flattenObject = function(obj) {
var prefix = arguments[1] || '';
var out = arguments[2] || {};
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);
}

['seleniumServerJar', 'chromeDriver', 'onPrepare'].forEach(function(name) {
if (argv[name]) {
argv[name] = path.resolve(process.cwd(), argv[name]);
Expand Down

0 comments on commit 8924bbc

Please sign in to comment.