I just want to ask for help because I can't run my feature file since the step definitions cannot be found

enter image description here

Folder pattern enter image description here

package.json

{
  "name": "sample project",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "cypress": "^13.6.2"
  },
  "devDependencies": {
    "cypress-cucumber-preprocessor": "^4.3.1"
  },
  "cypress-cucumber-preprocessor": {
    "nonGlobalStepDefinitions": true,
    "step_definitions": "cypress/e2e/cucumber/stepDefinitions/*"
  

} }

cypress.config.js

const cucumber = require('cypress-cucumber-preprocessor').default
const { defineConfig } = require("cypress");



module.exports = defineConfig({
  e2e: {
    setupNodeEvents(on, config) {
      on('file:preprocessor',cucumber())
    },
    specPattern: "cypress/e2e/cucumber/feature/*.feature",
  },
});

I'm trying to run my feature file, and getting an error

1

There are 1 best solutions below

0
Chas Sneed On

You should change this dependency

"cypress-cucumber-preprocessor": "^4.3.1"

to this one

"@badeball/cypress-cucumber-preprocessor": "^20.0.1",

The one you are using is no longer maintained, but the package has been taken over and re-branded with @badeball to allow you to pick the update a little easier.

The instructions for installing are given here quick start