Skip to content
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

Add server feature to enable automated Chromedriver downloads #548

Merged
merged 6 commits into from
Jul 2, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions lib/commands/context.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@ import PortFinder from 'portfinder';
import B from 'bluebird';
import { util } from 'appium-support';
import { errors } from 'appium-base-driver';
import { default as webviewHelpers,
NATIVE_WIN, WEBVIEW_BASE, WEBVIEW_WIN, CHROMIUM_WIN } from '../webview-helpers';
import {
default as webviewHelpers,
NATIVE_WIN, WEBVIEW_BASE, WEBVIEW_WIN, CHROMIUM_WIN
} from '../webview-helpers';

const CHROMEDRIVER_AUTODOWNLOAD_FEATURE = 'chromedriver_autodownload';

let commands = {}, helpers = {}, extensions = {};

Expand Down Expand Up @@ -329,6 +332,15 @@ async function getChromedriverPort (portSpec) {
return foundPort;
}

helpers.isChromedriverAutodownloadEnabled = function isChromedriverAutodownloadEnabled () {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should be isChromedriverAutoDownloadEnabled but it doesn't matter. I just wanted to comment in case it was a typo

if (this.isFeatureEnabled(CHROMEDRIVER_AUTODOWNLOAD_FEATURE)) {
return true;
}
log.debug(`Automated Chromedriver download is disabled. ` +
`Use '${CHROMEDRIVER_AUTODOWNLOAD_FEATURE}' server feature to enable it`);
return false;
};

helpers.setupNewChromedriver = async function setupNewChromedriver (opts, curDeviceId, adb) {
if (opts.chromeDriverPort) {
log.warn(`The 'chromeDriverPort' capability is deprecated. Please use 'chromedriverPort' instead`);
Expand All @@ -353,6 +365,8 @@ helpers.setupNewChromedriver = async function setupNewChromedriver (opts, curDev
bundleId: opts.chromeBundleId,
useSystemExecutable: opts.chromedriverUseSystemExecutable,
disableBuildCheck: opts.chromedriverDisableBuildCheck,
isAutodownloadEnabled: (this || {}).isChromedriverAutodownloadEnabled
? this.isChromedriverAutodownloadEnabled() : undefined,
});

// make sure there are chromeOptions
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@babel/runtime": "^7.0.0",
"appium-adb": "^7.8.0",
"appium-base-driver": "^3.17.0",
"appium-chromedriver": "^4.8.0",
"appium-chromedriver": "^4.13.0",
"appium-support": "^2.25.0",
"asyncbox": "^2.0.4",
"bluebird": "^3.4.7",
Expand Down