Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Isolate E2E tests and update puppeteer. #9711

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,19 @@ jobs:
- name: Start environment
run: npm run env:start

- name: Switch to Node.js 18 (/tests/e2e/.nvmrc)
uses: actions/setup-node@v4
with:
node-version-file: './tests/e2e/.nvmrc'
cache: 'npm'

- name: npm install
run: npm ci
working-directory: ./tests/e2e

- name: Run the tests
run: npm run test:e2e
working-directory: ./tests/e2e

- name: Upload artifacts
uses: actions/upload-artifact@v4
Expand Down
104,351 changes: 51,180 additions & 53,171 deletions package-lock.json

Large diffs are not rendered by default.

16 changes: 1 addition & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@
"test:js:watch": "npm run test:js -- --watch",
"test:storybook": "npm run test:js -- --testMatch '<rootDir>/.storybook/*.test.js'",
"pretest:e2e": "./bin/local-env/env-check.sh && ./tests/e2e/bin/test-docker-connectivity",
"test:e2e": "cross-env WP_BASE_URL=http://localhost:9002 ./tests/e2e/script.js",
"test:e2e:interactive": "npm run test:e2e -- --puppeteer-interactive",
"test:e2e:watch": "npm run test:e2e -- --watch",
"test:e2e:watch:interactive": "npm run test:e2e -- --watch --puppeteer-interactive",
"storybook": "start-storybook -p 9001 -c .storybook --no-version-updates",
"storybook:vrt": "npm run storybook -- --ci --quiet",
"backstopjs": "./bin/backstop",
Expand Down Expand Up @@ -77,12 +73,7 @@
]
},
"config": {
"storybook_wordpress_version": "5.5.1",
"puppeteer": {
"skip": {
"download": true
}
}
"storybook_wordpress_version": "5.5.1"
},
"keywords": [
"google",
Expand Down Expand Up @@ -177,7 +168,6 @@
"@storybook/addon-postcss": "^2.0.0",
"@storybook/addon-queryparams": "^6.2.9",
"@storybook/addon-storyshots": "^6.5.16",
"@storybook/addon-storyshots-puppeteer": "^6.3.6",
"@storybook/addon-viewport": "^6.3.0",
"@storybook/react": "^6.5.14",
"@svgr/webpack": "^5.4.0",
Expand Down Expand Up @@ -214,7 +204,6 @@
"eslint-plugin-sitekit": "file:packages/eslint-plugin",
"eslint-scope": "^5.1.0",
"eslint-webpack-plugin": "^2.5.1",
"expect-puppeteer": "^4.4.0",
"faker": "^5.5.3",
"fetch-mock": "^9.10.3",
"fetch-mock-jest": "^1.3.0",
Expand All @@ -227,7 +216,6 @@
"husky": "^3.1.0",
"jest": "^26.6.3",
"jest-localstorage-mock": "^2.4.2",
"jest-puppeteer": "^4.4.0",
"jsdom": "^16.5.0",
"jsdom-testing-mocks": "^1.6.0",
"lint-staged": "^10.2.11",
Expand All @@ -239,8 +227,6 @@
"postcss-loader": "^4.0.0",
"postcss-preset-env": "^9.5.11",
"prettier": "npm:wp-prettier@2.6.2",
"puppeteer": "^10.4.0",
"puppeteer-core": "^3.3.0",
"rimraf": "^3.0.2",
"rxjs": "^6.6.7",
"sanitize-filename": "^1.6.3",
Expand Down
1 change: 1 addition & 0 deletions tests/e2e/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18
2 changes: 1 addition & 1 deletion tests/e2e/config/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
/**
* External dependencies
*/
import { setDefaultOptions } from 'expect-puppeteer';

Check failure on line 22 in tests/e2e/config/bootstrap.js

View workflow job for this annotation

GitHub Actions / JS + CSS

Unable to resolve path to module 'expect-puppeteer'
import { get } from 'lodash';
import { ConsoleMessage } from 'puppeteer';

Check failure on line 24 in tests/e2e/config/bootstrap.js

View workflow job for this annotation

GitHub Actions / JS + CSS

Unable to resolve path to module 'puppeteer'

/**
* WordPress dependencies
Expand Down Expand Up @@ -123,7 +123,7 @@
function removePageEvents() {
while ( pageEvents.length ) {
const [ eventName, handler ] = pageEvents.pop();
page.removeListener( eventName, handler );
page.off( eventName, handler );
}
}

Expand Down
Loading
Loading