'Adding duplicate code in common file cypress
Sorry it this is an obvious question, I just cant seem to figure it out.
I am using cypress and cucumber to create my tests. My file structure looks like this
What I am wanting to do is add steps in the assertionStepDifinition.js file that can be used in my login.feature and my register.feature
This is my cypress.json
{
"chromeWebSecurity": false,
"failOnStatusCode": false,
"defaultCommandTimeout": 60000,
"testFiles": "**/*.feature"
}
Currently I am getting the error Step implementation missing for: I am at the login page
Thanks in advance!
Solution 1:[1]
most probably you need to add to your package.json
"cypress-cucumber-preprocessor": {
"step_definitions": "cypress/integration/**/"
}
Solution 2:[2]
You can add the direct path from where the step definition file is located in your package.json like this:
"cypress-cucumber-preprocessor": {
"nonGlobalStepDefinitions": false,
"stepDefinitions": "cypress/integration/cucumber-test/"
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Zhenëk |
| Solution 2 |

