Search code examples
testingautomationcucumbercypress

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

enter image description here

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

  • most probably you need to add to your package.json

      "cypress-cucumber-preprocessor": {
        "step_definitions": "cypress/integration/**/"
      }