build: fix instructions and process for updating Chrome version (#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 #40150
This commit is contained in:
parent
be48ad28ea
commit
de2f73c131
|
@ -43,14 +43,23 @@ The process of updating the Chrome or Firefox version is not straightforward, bu
|
||||||
|
|
||||||
## Puppeteer
|
## Puppeteer
|
||||||
|
|
||||||
Visit https://github.com/puppeteer/puppeteer/blob/master/docs/api.md to determine which version of puppeteer corresponds to the version of Chrome desired.
|
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.
|
||||||
Then update `scripts/puppeteer-chrome-versions.js` and all of the puppeteer versions throughout the repo,
|
|
||||||
|
2. Visit https://chromedriver.chromium.org/downloads to determine which version of ChromeDriver should be used for the version of Chrome desired.
|
||||||
|
|
||||||
|
> NOTE:
|
||||||
|
> The version of Chrome does not necessarily correspond exactly with the version of ChromeDriver.
|
||||||
|
> For example, you might have to use ChromeDriver v87.0.4280.x to drive Chrome v87.0.4272.x.
|
||||||
|
|
||||||
|
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).
|
||||||
|
|
||||||
|
4. Update all of the puppeteer versions throughout the repo:
|
||||||
|
|
||||||
* `package.json`
|
* `package.json`
|
||||||
* `aio/package.json`
|
* `aio/package.json`
|
||||||
* `aio/tools/examples/shared/package.json`
|
* `aio/tools/examples/shared/package.json`
|
||||||
|
|
||||||
and their corresponding `yarn.lock` files.
|
...and their corresponding `yarn.lock` files.
|
||||||
|
|
||||||
## Firefox
|
## Firefox
|
||||||
|
|
||||||
|
|
|
@ -11,13 +11,13 @@
|
||||||
// where this will require /aio/node_modules/puppeteer
|
// where this will require /aio/node_modules/puppeteer
|
||||||
const puppeteerPkgPath = require.resolve('puppeteer/package.json', {paths: [process.cwd()]});
|
const puppeteerPkgPath = require.resolve('puppeteer/package.json', {paths: [process.cwd()]});
|
||||||
const puppeteerVersion = require(puppeteerPkgPath).version;
|
const puppeteerVersion = require(puppeteerPkgPath).version;
|
||||||
const chromeVersionMap = require('./puppeteer-chrome-versions');
|
const chromedriverVersionMap = require('./puppeteer-chromedriver-versions');
|
||||||
const spawnSync = require('child_process').spawnSync;
|
const spawnSync = require('child_process').spawnSync;
|
||||||
|
|
||||||
const version = chromeVersionMap[puppeteerVersion];
|
const version = chromedriverVersionMap[puppeteerVersion];
|
||||||
if (!version) {
|
if (!version) {
|
||||||
console.error(`[webdriver-manager-update.js] Error: Could not find Chrome version for Puppeteer version '${
|
console.error(`[webdriver-manager-update.js] Error: Could not find ChromeDriver version for Puppeteer version '${
|
||||||
puppeteerVersion}' in Chrome/Puppeteer version map. Please update /scripts/puppeteer-chrome-versions.js.`);
|
puppeteerVersion}' in ChromeDriver/Puppeteer version map. Please update /scripts/puppeteer-chromedriver-versions.js.`);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue