From 4bd9b532b84063c9670c6913190d7f498d4f10d5 Mon Sep 17 00:00:00 2001 From: Julie Ralph Date: Mon, 20 Jun 2016 17:49:40 -0700 Subject: [PATCH] fix(config): do not flatten capabilities 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 --- lib/cli.ts | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/lib/cli.ts b/lib/cli.ts index 9d43e1ac1..98457e788 100644 --- a/lib/cli.ts +++ b/lib/cli.ts @@ -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.