Manual e2e suite for Gutenberg v4.5.1 running in a WPCOM Sandbox.
- Install the dependencies:
npm install
-
Copy the
config-example.jsonfile asconfig.jsonand fill thesandboxobject with the URL of a WPCOM Sandbox site and the credentials of an editor (or higher role) user.
To observe the tests visually, setpuppeteer.headless = falseinconfig.json, and increasepuppeteer.slowMountil the tests are slow enough (I've found50to be my sweet spot). -
Obtain the e2e tests from a Gutenberg release (e.g.
v4.5.1):
npm run update-e2e v4.5.1
-
Update
/e2e-overridesif needed. -
Turn on the Sandbox.
-
Finally start testing! (This will also automatically merge
/e2e-overridesinto/e2e).
npm run test
Note: to test a single spec, please update the Jest config (/e2e-overrides/jest.config.json) before running npm run test:
"testMatch": [
- "<rootDir>/e2e/specs/**/(*.)test.js"
+ "<rootDir>/e2e/specs/foo-bar.test.js"
],As of 2018-11-23, this uses Gutenberg 4.5.1 as it's the version used by the WPCOM Sandbox.
To update it as needed:
-
Run
npm run update-e2ewith the tag of a new Gutenberg release (e.g.npm run update-e2e v5.0.0). -
Check if there are big changes between
/e2e-overridesand the new/e2efolder, and update the overrides as needed. (IMPORTANT: keep the same folder structure!)
E.g. currently, most overrides are in/support/utils.js, but in future versions, all the utils functions will be moved into their own files. -
Run
npm run overwrite-e2eto copy the overrides in the/e2efolder.