diff --git a/lib/devices/android/android.js b/lib/devices/android/android.js index eb9c6b155..fc6433a39 100644 --- a/lib/devices/android/android.js +++ b/lib/devices/android/android.js @@ -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(); diff --git a/lib/devices/android/chrome.js b/lib/devices/android/chrome.js index 3761ec52f..9ea54055f 100644 --- a/lib/devices/android/chrome.js +++ b/lib/devices/android/chrome.js @@ -135,6 +135,7 @@ ChromeAndroid.prototype.createSession = function (cb) { caps.chromeOptions.androidActivity = this.args.appActivity; } + caps = this.decorateChromeOptions(caps); this.chromedriver.createSession(caps, cb); }; diff --git a/test/functional/android/chrome/desired.js b/test/functional/android/chrome/desired.js index 15989cf3c..7f41ba820 100644 --- a/test/functional/android/chrome/desired.js +++ b/test/functional/android/chrome/desired.js @@ -1,4 +1,5 @@ module.exports = { browserName: process.env.BROWSER_NAME || 'chrome', - enablePerformanceLogging: true + enablePerformanceLogging: true, + chromeOptions: {args: ['--disable-translate']} };