npm i -g @angular/cli
ng new <project_name> --routing=true --style=scss
cd <project-name>
rm -rf e2e
mkdir -p e2e/features e2e/plugins e2e/step-definitions e2e/support
yarn remove protractor
yarn add -D cypress cypress-cucumber-preprocessor
Update package.json
script to run e2e test as shown below and add cucumber
pre-processor configuration:
...
{
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "cypress open"
},
...
"cypress-cucumber-preprocessor": {
"step_definitions": "./e2e/step-definitions"
},
"dependencies": {
...
- Add
cypress.json
file to root folder (besidesangular.json
). - Add
index.js
file to e2e/plugins/ folder - Add
home.feature
to e2e/features folder - Add
home.js
to e2e/step-definitions folder