Example how to write E2E tests for a Gutenberg block in WordPress
This is a WordPress plugin which shows how to write E2E tests for a Gutenberg block in WordPress. This blog post explains how it works: https://www.liip.ch/en/blog/how-to-test-your-gutenberg-blocks
Feel free to use this plugin as a starting point to write your own E2E tests for your Gutenberg block.
Clone this repository
Install Node dependencies
$ npm install
Run eslint with the following command:
$ npm run lint
The build process is based on the official
npm start: Compiles the block in development mode. Watches for any changes and reports back any errors in your code.
npm run build: Use to build production code for your block inside
Puppeteer E2E Tests
The Puppeteer E2E Tests are stored in the
To run the tests use the following command:
$ npm run test:e2e
or the following command to run a specific test:
$ npm run test:e2e -- -t 'my test'