vue-cli-plugin-jest-puppeteer
v0.1.5
Published
Vue CLI 3 plugin for writing E2E tests with jest and puppeteer
Downloads
398
Maintainers
Readme
vue-cli-plugin-jest-puppeteer
In development!
This plugin configures your project with everything necessary to write E2E tests using Jest and Puppeteer:
- adds jest, jest-puppeteer and puppeteer as dev-dependencies
- adds the necessary config files
- setups babel to support ES6 modules in the E2E test files
- adds the
test:e2e
command to the package.json - adds a sample E2E test
Installation
Run the following command from your project's root folder: vue add jest-puppeteer
- For more information on how to add plugins to your project, see: https://cli.vuejs.org/guide/plugins-and-presets.html#installing-plugins-in-an-existing-project
Adding the plugin will update your project as in:
- Adding the
test:e2e
script to your package.json - Adding the E2E tests folder with a sample test in
/test/e2e/basic.spec.js
- Adding the necessary config files
jest-puppeteer.config.js
andjest.e2e.config.js
to the project root, and.babelrc.js
to thetest/e2e
folder. - Installing the necessary devDependencies, jest, jest-puppeteer, puppeteer, babel-jest and babel-plugin-transform-es2015-modules-commonjs
Options (In development!)
- e2e test folder location
- package.json command name
Usage
Once installed, run the tests with npm run test:e2e
.
- You might want to update the
test
script in package.json to also include a call to the newtest:e2e
script. - By default it will run tests with the
--runInBand
option. If you want to change it, modify thetest:e2e
script in package.json, see https://github.com/smooth-code/jest-puppeteer#running-puppeteer-in-ci-environments for more information.
Feel free to update the default settings
- For more info on
jest-puppeteer.config.js
see https://github.com/smooth-code/jest-puppeteer - For more info on
jest.e2e.config.js
see https://jestjs.io/docs/en/configuration