Skip to content

Commit

Permalink
Use puppeteer-core in all places
Browse files Browse the repository at this point in the history
  • Loading branch information
gziolo committed Sep 14, 2021
1 parent cd51ffa commit a78030a
Show file tree
Hide file tree
Showing 13 changed files with 45 additions and 377 deletions.
378 changes: 18 additions & 360 deletions package-lock.json

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion packages/e2e-test-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@
},
"peerDependencies": {
"jest": ">=26",
"puppeteer": ">=1.19.0"
"puppeteer-core": ">=10.0.0"
},
"peerDependenciesMeta": {
"puppeteer-core": {
"optional": true
}
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/e2e-test-utils/src/enable-page-dialog-accept.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/** @typedef {import('puppeteer').Dialog} Dialog */
/** @typedef {import('puppeteer-core').Dialog} Dialog */

/**
* Callback which automatically accepts dialog.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import { first } from 'lodash';

/** @typedef {import('puppeteer').ElementHandle} ElementHandle */
/** @typedef {import('puppeteer-core').ElementHandle} ElementHandle */

/**
* Finds a sidebar panel with the provided title.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/** @typedef {import('puppeteer').ElementHandle} ElementHandle */
/** @typedef {import('puppeteer-core').ElementHandle} ElementHandle */

/**
* Finds the button responsible for toggling the sidebar panel with the provided title.
Expand Down
2 changes: 1 addition & 1 deletion packages/e2e-test-utils/src/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import { last } from 'lodash';

/** @typedef {import('puppeteer').Page} Page */
/** @typedef {import('puppeteer-core').Page} Page */

/**
* Opens the preview page of an edited post.
Expand Down
7 changes: 6 additions & 1 deletion packages/e2e-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@
"peerDependencies": {
"jest": ">=26",
"jest-snapshot": ">=26",
"puppeteer": ">=1.19.0"
"puppeteer-core": ">=10.0.0"
},
"peerDependenciesMeta": {
"puppeteer-core": {
"optional": true
}
},
"publishConfig": {
"access": "public"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
getEditedPostContent,
} from '@wordpress/e2e-test-utils';

/** @typedef {import('puppeteer').ElementHandle} ElementHandle */
/** @typedef {import('puppeteer-core').ElementHandle} ElementHandle */

describe( 'adding patterns', () => {
beforeEach( async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
showBlockToolbar,
} from '@wordpress/e2e-test-utils';

/** @typedef {import('puppeteer').ElementHandle} ElementHandle */
/** @typedef {import('puppeteer-core').ElementHandle} ElementHandle */

/**
* Waits for all patterns in the inserter to have a height, which should
Expand Down
2 changes: 1 addition & 1 deletion packages/e2e-tests/specs/editor/various/preview.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
pressKeyWithModifier,
} from '@wordpress/e2e-test-utils';

/** @typedef {import('puppeteer').Page} Page */
/** @typedef {import('puppeteer-core').Page} Page */

/**
* Given the Page instance for the editor, opens preview drodpdown, and
Expand Down
7 changes: 6 additions & 1 deletion packages/jest-puppeteer-axe/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@
},
"peerDependencies": {
"jest": ">=26",
"puppeteer": ">=1.19.0"
"puppeteer-core": ">=10.0.0"
},
"peerDependenciesMeta": {
"puppeteer-core": {
"optional": true
}
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-puppeteer-axe/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import AxePuppeteer from '@axe-core/puppeteer';

/** @typedef {import('puppeteer').Page} Page */
/** @typedef {import('puppeteer-core').Page} Page */

/** @typedef {import('axe-core').RunOptions} RunOptions */

Expand Down
7 changes: 1 addition & 6 deletions packages/scripts/config/jest-environment-puppeteer/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,7 @@ async function readConfig() {
function getPuppeteer( { browser } ) {
switch ( browser.toLowerCase() ) {
case 'chromium':
try {
// eslint-disable-next-line import/no-extraneous-dependencies
return require( 'puppeteer' );
} catch ( e ) {
return require( 'puppeteer-core' );
}
return require( 'puppeteer-core' );
case 'firefox':
return require( 'puppeteer-firefox' );
default:
Expand Down

0 comments on commit a78030a

Please sign in to comment.