mirror of
https://github.com/appium/appium.git
synced 2026-10-25 18:21:19 +08:00
make sure our 'chromeOptions' overriding works for Chrome and not just Chromeviews (fix #4119)
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -135,6 +135,7 @@ ChromeAndroid.prototype.createSession = function (cb) {
|
||||
caps.chromeOptions.androidActivity = this.args.appActivity;
|
||||
}
|
||||
|
||||
caps = this.decorateChromeOptions(caps);
|
||||
this.chromedriver.createSession(caps, cb);
|
||||
};
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
module.exports = {
|
||||
browserName: process.env.BROWSER_NAME || 'chrome',
|
||||
enablePerformanceLogging: true
|
||||
enablePerformanceLogging: true,
|
||||
chromeOptions: {args: ['--disable-translate']}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user