Skip to content

Commit de2f73c

Browse files
gkalpakjosephperrott
authored andcommitted
build: fix instructions and process for updating Chrome version (angular#40150)
Previously, the instructions and process for updating the version of Chrome ued in tests assumed that there was always going to be a ChromeDriver version that corresponded to a Chrome version. For example, if we wanted to use Chrome v87.0.4272.x, we assumed that there was going to be ChromeDriver v87.0.4272.x. It turns out that this is not always the case. This commit updates the instructions and process for updating the Chrome version to ensure a valid version of ChromeDriver will be used as well. PR Close angular#40150
1 parent be48ad2 commit de2f73c

File tree

3 files changed

+19
-10
lines changed

3 files changed

+19
-10
lines changed

dev-infra/browsers/README.md

+15-6
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,23 @@ The process of updating the Chrome or Firefox version is not straightforward, bu
4343

4444
## Puppeteer
4545

46-
Visit https://github.com/puppeteer/puppeteer/blob/master/docs/api.md to determine which version of puppeteer corresponds to the version of Chrome desired.
47-
Then update `scripts/puppeteer-chrome-versions.js` and all of the puppeteer versions throughout the repo,
46+
1. Visit https://github.com/puppeteer/puppeteer/blob/master/docs/api.md to determine which version of puppeteer corresponds to the version of Chrome desired.
4847

49-
* `package.json`
50-
* `aio/package.json`
51-
* `aio/tools/examples/shared/package.json`
48+
2. Visit https://chromedriver.chromium.org/downloads to determine which version of ChromeDriver should be used for the version of Chrome desired.
5249

53-
and their corresponding `yarn.lock` files.
50+
> NOTE:
51+
> The version of Chrome does not necessarily correspond exactly with the version of ChromeDriver.
52+
> For example, you might have to use ChromeDriver v87.0.4280.x to drive Chrome v87.0.4272.x.
53+
54+
3. Update `scripts/puppeteer-chromedriver-versions.js` to include and entry with the new version of puppeteer as key and the new version of ChromeDriver as value (as determined in the two previous steps).
55+
56+
4. Update all of the puppeteer versions throughout the repo:
57+
58+
* `package.json`
59+
* `aio/package.json`
60+
* `aio/tools/examples/shared/package.json`
61+
62+
...and their corresponding `yarn.lock` files.
5463

5564
## Firefox
5665

scripts/webdriver-manager-update.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
// where this will require /aio/node_modules/puppeteer
1212
const puppeteerPkgPath = require.resolve('puppeteer/package.json', {paths: [process.cwd()]});
1313
const puppeteerVersion = require(puppeteerPkgPath).version;
14-
const chromeVersionMap = require('./puppeteer-chrome-versions');
14+
const chromedriverVersionMap = require('./puppeteer-chromedriver-versions');
1515
const spawnSync = require('child_process').spawnSync;
1616

17-
const version = chromeVersionMap[puppeteerVersion];
17+
const version = chromedriverVersionMap[puppeteerVersion];
1818
if (!version) {
19-
console.error(`[webdriver-manager-update.js] Error: Could not find Chrome version for Puppeteer version '${
20-
puppeteerVersion}' in Chrome/Puppeteer version map. Please update /scripts/puppeteer-chrome-versions.js.`);
19+
console.error(`[webdriver-manager-update.js] Error: Could not find ChromeDriver version for Puppeteer version '${
20+
puppeteerVersion}' in ChromeDriver/Puppeteer version map. Please update /scripts/puppeteer-chromedriver-versions.js.`);
2121
process.exit(1);
2222
}
2323

0 commit comments

Comments
 (0)