appium-chromedriver 5.6.78 → 6.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/README.md +10 -16
- package/package.json +2 -4
- package/build/lib/install.d.ts +0 -3
- package/build/lib/install.d.ts.map +0 -1
- package/build/lib/install.js +0 -64
- package/build/lib/install.js.map +0 -1
- package/install-npm.js +0 -80
- package/lib/install.js +0 -67
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
## [6.0.1](https://github.com/appium/appium-chromedriver/compare/v6.0.0...v6.0.1) (2024-09-16)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* Import proper eslint config ([#409](https://github.com/appium/appium-chromedriver/issues/409)) ([044a5ac](https://github.com/appium/appium-chromedriver/commit/044a5ac5132e6f8506d2846d67106ad1c14bf44b))
|
|
6
|
+
|
|
7
|
+
## [6.0.0](https://github.com/appium/appium-chromedriver/compare/v5.6.78...v6.0.0) (2024-09-16)
|
|
8
|
+
|
|
9
|
+
### ⚠ BREAKING CHANGES
|
|
10
|
+
|
|
11
|
+
* Latest chromedriver binary does not get downloaded automatically anymore upon module installation
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* Remove automatic download of the latest chromedriver upon install ([#430](https://github.com/appium/appium-chromedriver/issues/430)) ([ee7940d](https://github.com/appium/appium-chromedriver/commit/ee7940d30ef23cd825584b76b8fcfb8c42b38cc8))
|
|
16
|
+
|
|
1
17
|
## [5.6.78](https://github.com/appium/appium-chromedriver/compare/v5.6.77...v5.6.78) (2024-09-14)
|
|
2
18
|
|
|
3
19
|
### Miscellaneous Chores
|
package/README.md
CHANGED
|
@@ -24,7 +24,12 @@ more details on it.
|
|
|
24
24
|
> This package can work with Microsoft Edge WebDriver as well, but the support is limited.
|
|
25
25
|
> For example, automatic downloads do not work for Microsoft Edge WebDriver.
|
|
26
26
|
|
|
27
|
-
##
|
|
27
|
+
## Automatic Chromedriver download on module install
|
|
28
|
+
|
|
29
|
+
Since version 6.0.0 of this module automatic download of the latest known chromedriver
|
|
30
|
+
does not happen anymore. The below information is only relevant for older module versions:
|
|
31
|
+
|
|
32
|
+
### Skipping binary installation
|
|
28
33
|
|
|
29
34
|
By default, upon installation the package downloads the most recent known Chromedriver version from
|
|
30
35
|
Chromedriver CDN server: http://chromedriver.storage.googleapis.com.
|
|
@@ -35,7 +40,7 @@ binary set the `APPIUM_SKIP_CHROMEDRIVER_INSTALL` environment variable:
|
|
|
35
40
|
APPIUM_SKIP_CHROMEDRIVER_INSTALL=1 npm install appium-chromedriver
|
|
36
41
|
```
|
|
37
42
|
|
|
38
|
-
|
|
43
|
+
### Custom Chromedriver version
|
|
39
44
|
|
|
40
45
|
By default, the package uses the most recent known Chromedriver version.
|
|
41
46
|
The full list of known Chromedriver versions and their corresponding supported
|
|
@@ -51,19 +56,8 @@ CHROMEDRIVER_VERSION=107.0.5304.62 npm install appium-chromedriver
|
|
|
51
56
|
## Custom binaries url
|
|
52
57
|
|
|
53
58
|
If you want Chromedriver to be downloaded from another CDN, which differs from the
|
|
54
|
-
default one https://chromedriver.storage.googleapis.com, then
|
|
55
|
-
|
|
56
|
-
```bash
|
|
57
|
-
npm install appium-chromedriver --chromedriver_cdnurl=http://npm.taobao.org/mirrors/chromedriver
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
The property could also be added into your [`.npmrc`](https://docs.npmjs.com/files/npmrc) file.
|
|
61
|
-
|
|
62
|
-
```bash
|
|
63
|
-
chromedriver_cdnurl=http://npm.taobao.org/mirrors/chromedriver
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
Or set the new URL to `CHROMEDRIVER_CDNURL` environment variable:
|
|
59
|
+
default one https://chromedriver.storage.googleapis.com, then set the new URL to
|
|
60
|
+
the `CHROMEDRIVER_CDNURL` environment variable:
|
|
67
61
|
|
|
68
62
|
```bash
|
|
69
63
|
CHROMEDRIVER_CDNURL=http://npm.taobao.org/mirrors/chromedriver npm install appium-chromedriver
|
|
@@ -77,7 +71,7 @@ the server returns a proper list of stored drivers in response to requests havin
|
|
|
77
71
|
Since version 5.6 the second environment variable has been added: `CHROMELABS_URL`. By default, it points
|
|
78
72
|
to https://googlechromelabs.github.io, and is expected to contain the actual prefix of
|
|
79
73
|
[Chrome for Testing availability](https://github.com/GoogleChromeLabs/chrome-for-testing#json-api-endpoints)
|
|
80
|
-
JSON API. This API allows retrieval of chromedrivers whose versions are greater than 114
|
|
74
|
+
JSON API. This API allows retrieval of chromedrivers whose major versions are greater than `114`.
|
|
81
75
|
|
|
82
76
|
Similarly to the above it could be also defined in the .npmrc file:
|
|
83
77
|
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"chrome",
|
|
7
7
|
"android"
|
|
8
8
|
],
|
|
9
|
-
"version": "
|
|
9
|
+
"version": "6.0.1",
|
|
10
10
|
"author": "Appium Contributors",
|
|
11
11
|
"license": "Apache-2.0",
|
|
12
12
|
"repository": {
|
|
@@ -31,7 +31,6 @@
|
|
|
31
31
|
},
|
|
32
32
|
"files": [
|
|
33
33
|
"config",
|
|
34
|
-
"install-npm.js",
|
|
35
34
|
"lib",
|
|
36
35
|
"build",
|
|
37
36
|
"!build/test",
|
|
@@ -62,14 +61,13 @@
|
|
|
62
61
|
"dev": "npm run build -- --watch",
|
|
63
62
|
"lint": "eslint .",
|
|
64
63
|
"lint:fix": "npm run lint -- --fix",
|
|
65
|
-
"postinstall": "node install-npm.js",
|
|
66
64
|
"prepare": "npm run build",
|
|
67
65
|
"format": "prettier -w ./lib",
|
|
68
66
|
"test": "mocha --exit --timeout 1m \"./test/unit/**/*-specs.js\"",
|
|
69
67
|
"e2e-test": "mocha --exit --timeout 10m \"./test/functional/**/*-specs.js\""
|
|
70
68
|
},
|
|
71
69
|
"devDependencies": {
|
|
72
|
-
"@appium/eslint-config-appium": "^
|
|
70
|
+
"@appium/eslint-config-appium-ts": "^0.x",
|
|
73
71
|
"@appium/test-support": "^3.0.0",
|
|
74
72
|
"@appium/tsconfig": "^0.x",
|
|
75
73
|
"@semantic-release/changelog": "^6.0.1",
|
package/build/lib/install.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"install.d.ts","sourceRoot":"","sources":["../../lib/install.js"],"names":[],"mappings":"AAmDA,yCASC;AAED,2CAEC"}
|
package/build/lib/install.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.install = install;
|
|
7
|
-
exports.doInstall = doInstall;
|
|
8
|
-
const lodash_1 = __importDefault(require("lodash"));
|
|
9
|
-
const support_1 = require("@appium/support");
|
|
10
|
-
const storage_client_1 = __importDefault(require("./storage-client/storage-client"));
|
|
11
|
-
const chromelabs_1 = require("./storage-client/chromelabs");
|
|
12
|
-
const utils_1 = require("./utils");
|
|
13
|
-
const constants_1 = require("./constants");
|
|
14
|
-
const LATEST_VERSION = 'LATEST';
|
|
15
|
-
/**
|
|
16
|
-
*
|
|
17
|
-
* @param {string} ver
|
|
18
|
-
* @returns {Promise<string>}
|
|
19
|
-
*/
|
|
20
|
-
async function formatCdVersion(ver) {
|
|
21
|
-
if (lodash_1.default.toUpper(ver) !== LATEST_VERSION) {
|
|
22
|
-
return ver;
|
|
23
|
-
}
|
|
24
|
-
let jsonStr;
|
|
25
|
-
const url = `${constants_1.CHROMELABS_URL}/chrome-for-testing/last-known-good-versions.json`;
|
|
26
|
-
try {
|
|
27
|
-
jsonStr = await (0, utils_1.retrieveData)(url, {
|
|
28
|
-
'user-agent': constants_1.USER_AGENT,
|
|
29
|
-
accept: `application/json, */*`,
|
|
30
|
-
}, { timeout: constants_1.STORAGE_REQ_TIMEOUT_MS });
|
|
31
|
-
}
|
|
32
|
-
catch (e) {
|
|
33
|
-
const err = /** @type {Error} */ (e);
|
|
34
|
-
throw new Error(`Cannot fetch the latest Chromedriver version. ` +
|
|
35
|
-
`Make sure you can access ${url} from your machine or provide a mirror by setting ` +
|
|
36
|
-
`a custom value to CHROMELABS_URL enironment variable. Original error: ${err.message}`);
|
|
37
|
-
}
|
|
38
|
-
return (0, chromelabs_1.parseLatestKnownGoodVersionsJson)(jsonStr);
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
*
|
|
42
|
-
* @param {string} platformName
|
|
43
|
-
*/
|
|
44
|
-
async function prepareChromedriverDir(platformName) {
|
|
45
|
-
const chromedriverDir = (0, utils_1.getChromedriverDir)(platformName);
|
|
46
|
-
if (!await support_1.fs.exists(chromedriverDir)) {
|
|
47
|
-
await (0, support_1.mkdirp)(chromedriverDir);
|
|
48
|
-
}
|
|
49
|
-
return chromedriverDir;
|
|
50
|
-
}
|
|
51
|
-
async function install() {
|
|
52
|
-
const osInfo = await (0, utils_1.getOsInfo)();
|
|
53
|
-
const client = new storage_client_1.default({
|
|
54
|
-
chromedriverDir: await prepareChromedriverDir(osInfo.name),
|
|
55
|
-
});
|
|
56
|
-
await client.syncDrivers({
|
|
57
|
-
osInfo,
|
|
58
|
-
versions: [await formatCdVersion(utils_1.CD_VER)],
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
async function doInstall() {
|
|
62
|
-
await install();
|
|
63
|
-
}
|
|
64
|
-
//# sourceMappingURL=install.js.map
|
package/build/lib/install.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"install.js","sourceRoot":"","sources":["../../lib/install.js"],"names":[],"mappings":";;;;;AAkES,0BAAO;AAAE,8BAAS;AAlE3B,oDAAuB;AACvB,6CAA6C;AAC7C,qFAAwE;AACxE,4DAA6E;AAC7E,mCAEiB;AACjB,2CAAiF;AAEjF,MAAM,cAAc,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AM,CAAC,WAAW,CAAC;QACvB,MAAM;QACN,QAAQ,EAAE,CAAC,MAAM,eAAe,CAAC,cAAM,CAAC,CAAC;KAC1C,CAAC,CAAC;AACL,CAAC;AAED,KAAK,UAAU,SAAS;IACtB,MAAM,OAAO,EAAE,CAAC;AAClB,CAAC"}
|
package/install-npm.js
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* This is the `postinstall` script which:
|
|
5
|
-
* 1. Builds the project if it isn't yet built (only happens in a dev environment), and
|
|
6
|
-
* 2. Downloads Chromedriver (which can be disabled);
|
|
7
|
-
*
|
|
8
|
-
* Because `prepare` is run _after_ `postinstall`, we cannot just use `prepare` to build the project
|
|
9
|
-
* because this script depends on the project being built!
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
|
-
const B = require('bluebird');
|
|
13
|
-
const util = require('util');
|
|
14
|
-
|
|
15
|
-
// this is here because we're using async/await, and this must be set _before_ we use async/await,
|
|
16
|
-
// given that bluebird is used elsewhere via `doInstall()`.
|
|
17
|
-
B.config({
|
|
18
|
-
cancellation: true,
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
const fs = require('fs/promises');
|
|
22
|
-
const path = require('path');
|
|
23
|
-
const _ = require('lodash');
|
|
24
|
-
const {exec} = require('teen_process');
|
|
25
|
-
const {logger} = require('@appium/support');
|
|
26
|
-
|
|
27
|
-
const log = logger.getLogger('CDInstaller');
|
|
28
|
-
const BUILD_PATH = path.join(__dirname, 'build', 'lib', 'install.js');
|
|
29
|
-
|
|
30
|
-
async function main() {
|
|
31
|
-
// always build if not yet built.
|
|
32
|
-
// this should only happen in a working copy / dev environment.
|
|
33
|
-
try {
|
|
34
|
-
await fs.stat(BUILD_PATH);
|
|
35
|
-
} catch {
|
|
36
|
-
log.info(
|
|
37
|
-
`The Chromedriver install script cannot be found at '${BUILD_PATH}'. ` +
|
|
38
|
-
`Building appium-chromedriver package`
|
|
39
|
-
);
|
|
40
|
-
const isWindows = process.platform === 'win32';
|
|
41
|
-
const npmCommand = `npm${isWindows ? '.cmd' : ''}`;
|
|
42
|
-
try {
|
|
43
|
-
await exec(npmCommand, ['run', 'build'], {
|
|
44
|
-
logger: log,
|
|
45
|
-
cwd: __dirname,
|
|
46
|
-
shell: isWindows,
|
|
47
|
-
});
|
|
48
|
-
} catch (e) {
|
|
49
|
-
throw new Error(`appium-chromedriver package cannot be built: ${util.inspect(e)}`);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
// check if we should skip install
|
|
54
|
-
if (
|
|
55
|
-
!_.isEmpty(process.env.APPIUM_SKIP_CHROMEDRIVER_INSTALL) ||
|
|
56
|
-
!_.isEmpty(process.env.npm_config_chromedriver_skip_install)
|
|
57
|
-
) {
|
|
58
|
-
log.warn(
|
|
59
|
-
`'APPIUM_SKIP_CHROMEDRIVER_INSTALL' environment variable is set; skipping Chromedriver installation.`
|
|
60
|
-
);
|
|
61
|
-
log.warn(`Android web/hybrid testing will not be possible without Chromedriver.`);
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
try {
|
|
66
|
-
await require(BUILD_PATH).doInstall();
|
|
67
|
-
} catch (err) {
|
|
68
|
-
log.error(`Error installing Chromedriver: ${err.message}`);
|
|
69
|
-
log.error(err.stack ? err.stack : err);
|
|
70
|
-
log.error(
|
|
71
|
-
`Downloading Chromedriver can be skipped by setting the` +
|
|
72
|
-
`'APPIUM_SKIP_CHROMEDRIVER_INSTALL' environment variable.`
|
|
73
|
-
);
|
|
74
|
-
process.exit(1);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
if (require.main === module) {
|
|
79
|
-
main();
|
|
80
|
-
}
|
package/lib/install.js
DELETED
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import _ from 'lodash';
|
|
2
|
-
import { fs, mkdirp } from '@appium/support';
|
|
3
|
-
import ChromedriverStorageClient from './storage-client/storage-client';
|
|
4
|
-
import {parseLatestKnownGoodVersionsJson} from './storage-client/chromelabs';
|
|
5
|
-
import {
|
|
6
|
-
CD_VER, retrieveData, getOsInfo, getChromedriverDir,
|
|
7
|
-
} from './utils';
|
|
8
|
-
import { USER_AGENT, STORAGE_REQ_TIMEOUT_MS, CHROMELABS_URL } from './constants';
|
|
9
|
-
|
|
10
|
-
const LATEST_VERSION = 'LATEST';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
*
|
|
14
|
-
* @param {string} ver
|
|
15
|
-
* @returns {Promise<string>}
|
|
16
|
-
*/
|
|
17
|
-
async function formatCdVersion (ver) {
|
|
18
|
-
if (_.toUpper(ver) !== LATEST_VERSION) {
|
|
19
|
-
return ver;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
let jsonStr;
|
|
23
|
-
const url = `${CHROMELABS_URL}/chrome-for-testing/last-known-good-versions.json`;
|
|
24
|
-
try {
|
|
25
|
-
jsonStr = await retrieveData(
|
|
26
|
-
url, {
|
|
27
|
-
'user-agent': USER_AGENT,
|
|
28
|
-
accept: `application/json, */*`,
|
|
29
|
-
}, {timeout: STORAGE_REQ_TIMEOUT_MS}
|
|
30
|
-
);
|
|
31
|
-
} catch (e) {
|
|
32
|
-
const err = /** @type {Error} */ (e);
|
|
33
|
-
throw new Error(`Cannot fetch the latest Chromedriver version. ` +
|
|
34
|
-
`Make sure you can access ${url} from your machine or provide a mirror by setting ` +
|
|
35
|
-
`a custom value to CHROMELABS_URL enironment variable. Original error: ${err.message}`);
|
|
36
|
-
}
|
|
37
|
-
return parseLatestKnownGoodVersionsJson(jsonStr);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
*
|
|
42
|
-
* @param {string} platformName
|
|
43
|
-
*/
|
|
44
|
-
async function prepareChromedriverDir (platformName) {
|
|
45
|
-
const chromedriverDir = getChromedriverDir(platformName);
|
|
46
|
-
if (!await fs.exists(chromedriverDir)) {
|
|
47
|
-
await mkdirp(chromedriverDir);
|
|
48
|
-
}
|
|
49
|
-
return chromedriverDir;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
async function install () {
|
|
53
|
-
const osInfo = await getOsInfo();
|
|
54
|
-
const client = new ChromedriverStorageClient({
|
|
55
|
-
chromedriverDir: await prepareChromedriverDir(osInfo.name),
|
|
56
|
-
});
|
|
57
|
-
await client.syncDrivers({
|
|
58
|
-
osInfo,
|
|
59
|
-
versions: [await formatCdVersion(CD_VER)],
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
async function doInstall () {
|
|
64
|
-
await install();
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export { install, doInstall };
|