Simplify and improve E2E Puppeteer Config
See original GitHub issueBug Description
As pointed out by @aaemnnosttv, @wordpress/scripts
already supports passing some custom configs to Puppeteer, so that we don’t actually need to maintain a custom jest-puppeteer.config.js
file.
More specifically, it allows setting PUPPETEER_HEADLESS
to disable headless mode and PUPPETEER_SLOWMO
to slow down tests.
Example:
PUPPETEER_HEADLESS=false npm run test:e2e
PUPPETEER_SLOWMO=200 npm run test:e2e
There’s also a third option, passing a --puppeteer-interactive
argument to the command that would result in non-headless mode with a slowMo
value of 80
. In other words, npm run test:e2e -- --puppeteer-interactive
is equivalent to running
PUPPETEER_HEADLESS=false PUPPETEER_SLOWMO=80 npm run test:e2e
Second, the default config also ensures that the --runInBand
argument is always passed to Jest, which can speed up tests on CI servers in some cases.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
- More straightforward and better documented way of running E2E tests
- Tests run serially on Travis CI
Implementation Brief
- Remove custom
jest-puppeteer.config.js
file. - Alter documentation to suggest using
PUPPETEER_HEADLESS
/PUPPETEER_SLOWMO
or the--puppeteer-interactive
argument. - Add new npm script
npm run test:e2e:interactive
that runsnpm run test:e2e -- --puppeteer-interactive
- Add new npm script
npm run test:e2e:ci
that runsnpm run test:e2e -- --runInBand
- Change
.travis.yml
to usenpm run test:e2e:ci
Changelog entry
- N/A
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:6 (4 by maintainers)
That’s right, sorry for the lapse, thanks for providing the link @swissspidy.
Ready for CR and added suggestions to the contributor handbook doc.
Current documentation is in the contributor handbook: https://docs.google.com/document/d/1M1gUI0FKnP3RcbgMsU6YltEtNCHaH_9YGbH8F-7JefA/edit#heading=h.21tk21w0qtqj
My understanding is that this doc will be moved to the wiki here on GitHub eventually.