Skip to content

Commit

Permalink
Merge pull request #12442 from timvandermeij/upgrade-puppeteer
Browse files Browse the repository at this point in the history
Upgrade Puppeteer to version 5.3.1
  • Loading branch information
timvandermeij authored Oct 4, 2020
2 parents 2823beb + c10aac9 commit 4713170
Show file tree
Hide file tree
Showing 3 changed files with 99 additions and 39 deletions.
123 changes: 94 additions & 29 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"postcss-calc": "^7.0.4",
"postcss-css-variables": "^0.14.0",
"prettier": "^2.1.2",
"puppeteer": "~3.3.0",
"puppeteer": "^5.3.1",
"rimraf": "^2.7.1",
"streamqueue": "^1.1.2",
"stylelint": "^13.7.1",
Expand All @@ -64,7 +64,7 @@
"yargs": "^11.1.1"
},
"scripts": {
"postinstall": "node -e \"require('child_process').execSync('cross-env PUPPETEER_PRODUCT=firefox node node_modules/puppeteer/install.js');\"",
"postinstall": "cross-env PUPPETEER_PRODUCT=firefox node node_modules/puppeteer/install.js",
"test": "gulp npm-test"
},
"repository": {
Expand Down
11 changes: 3 additions & 8 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -769,11 +769,10 @@ function unitTestPostHandler(req, res) {
}

async function startBrowser(browserName, startUrl) {
const revisions = require("puppeteer/package.json").puppeteer;
const revisions = require("puppeteer/lib/cjs/puppeteer/revisions.js")
.PUPPETEER_REVISIONS;
const wantedRevision =
browserName === "chrome"
? revisions.chrome_revision
: revisions.firefox_revision;
browserName === "chrome" ? revisions.chromium : revisions.firefox;

// Remove other revisions than the one we want to use. Updating Puppeteer can
// cause a new revision to be used, and not removing older revisions causes
Expand All @@ -795,10 +794,6 @@ async function startBrowser(browserName, startUrl) {
product: browserName,
headless: false,
defaultViewport: null,
// Firefox must complete its execution before starting, mainly on Windows.
// Refer to https://github.com/puppeteer/puppeteer/issues/5376 and
// https://phabricator.services.mozilla.com/D6702.
args: browserName === "firefox" ? ["--wait-for-browser"] : [],
});
const pages = await browser.pages();
const page = pages[0];
Expand Down

0 comments on commit 4713170

Please sign in to comment.