I am trying to configure cucumber with cypress in my Angular project. I have changed Cypress.json as followed :
{
"fileServerFolder": ".",
"fixturesFolder": "./src/fixtures",
"integrationFolder": "./src/integration",
"pluginsFile": "./src/plugins",
"supportFile": "./src/support",
"testFiles": "**/*.feature",
}
Then under integration folder, I have organized files and folders as shown in the screenshot bellow:
Then I have added this under my package.json file :
"cypress-cucumber-preprocessor": {
"step_definitions": "./e2e/src/integration",
"nonGlobalStepDefinitions": true
}
When I run cypress, then run the feature firstOne.feature, I get the following error:
Your feature
files should not be in a separate folder. They should be where you specified in your package.json
at stepDefinitions
Cypress-cucumber-preprocessor recommends this folder structure when you set "nonGlobalStepDefinitions": true
and "stepDefinitions": "./src/integration"
in package.json
.
See doc here.
- src/
- integration/
- firstOne.feature
- firstOne/
- firstOne.js
- secondOne.feature
- secondOne/
- secondOne.js
So:
.feature
file in ./src/integration
.feature
file, also in cypress/integration
.js
file in the newly created folder with your step definitionsIf you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With