This is a minimal example setup showing how to configure Puppeteer, Cucumber, Jest and Enzyme with create-react-app. You can use this setup for BDD/TDD in React projects.
git clone https://www.github.com/rishispeets/react-puppeteer-cucumber-example
cd react-puppeteer-cucumber-example
npm i
- Run
test
to start Jest in watchmode for unit testing. - Run
e2e
to run Cucumber for functional testing. - Run
e2e-headless
to run Cucumber with Chrome in headless mode for functional testing.
"test": "react-scripts test",
"e2e": "NODE_ENV=debug cucumber-js src/tests/features",
"e2e-headless": "cucumber-js src/tests/features",
- Add script for single run Jest execution.
- Add high-level description of file and folder structure.
PRs accepted.
- Slides by @paulbjensen: E2E testing Single Page Apps and Apis with Cucumber.js and Puppeteer
- Different setup by @spirosikmd: cucumber-puppeteer-example
MIT ยฉ Rishi Speets