make sure our 'chromeOptions' overriding works for Chrome and not just Chromeviews (fix #4119)

This commit is contained in:
Jonathan Lipps
2014-12-01 14:44:01 -08:00
parent b477c22d79
commit a3a903893b
3 changed files with 16 additions and 1 deletions
+13
View File
@@ -287,6 +287,19 @@ Android.prototype.checkApiLevel = function (cb) {
});
};
Android.prototype.decorateChromeOptions = function (caps) {
if (this.args.chromeOptions) {
_.each(this.args.chromeOptions, function (val, option) {
if (typeof caps.chromeOptions[option] === "undefined") {
caps.chromeOptions[option] = val;
} else {
logger.warn("Cannot pass option " + caps.chromeOptions[option] + " because Appium needs it to make chromeDriver work");
}
});
}
return caps;
};
Android.prototype.processFromManifest = function (cb) {
if (!this.args.app) {
return cb();
+1
View File
@@ -135,6 +135,7 @@ ChromeAndroid.prototype.createSession = function (cb) {
caps.chromeOptions.androidActivity = this.args.appActivity;
}
caps = this.decorateChromeOptions(caps);
this.chromedriver.createSession(caps, cb);
};
+2 -1
View File
@@ -1,4 +1,5 @@
module.exports = {
browserName: process.env.BROWSER_NAME || 'chrome',
enablePerformanceLogging: true
enablePerformanceLogging: true,
chromeOptions: {args: ['--disable-translate']}
};