-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add config option to merge chromeOptions #42
Conversation
- merge desiredCapabilities.chromeOptions.args by default if specified in config - allow override of desiredCapabilities.chromeOptions.args with merge: false
2a7dcb9
to
264b081
Compare
Thanks for this feature. A few observations:
|
lib/processes.js
Outdated
args = args.concat(config.get('desiredCapabilities.chromeOptions.args')) | ||
.filter(function filterIt(opt, idx, arr) { | ||
return arr.indexOf(opt) === idx; | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this might need to be a bit more sophisticated for cases like --disk-cache-size=2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah that is a good point I forgot about options like --disk-cache-size=2
lib/processes.js
Outdated
|
||
if (config.has('desiredCapabilities.chromeOptions.args')) { | ||
if (config.has('desiredCapabilities.chromeOptions.mergeArgs') | ||
&& config.get('desiredCapabilities.chromeOptions.mergeArgs') === true) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can probably collapse this to:
if (config.get('desiredCapabilities.chromeOptions.mergeArgs', false) === true) {
lib/processes.js
Outdated
return acc; | ||
}, {}); | ||
|
||
return Object.entries(objOpts).reduce(function mergeOpts(acc, opt) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Object.entries()
requires node 8+; at the moment we want to maintain compatibility with 6+; you can use Object.keys()
and a bit more work and maintain compatibility
- use Object.keys for node6 - config.get for 'desiredCapabilities.chromeOptions.mergeArgs' return false by default
LGTM; thanks! |
in config
false