I have seen other similar questions in this site, but non of them have a satisfatory solution for me. I don't have any webpack.config.js file since we take the default configuration from angular. Please, see below the corresponding image to have a better sight of my problem.
Other configurations in my project:
package.json
"cypress-cucumber-preprocessor": {
"nonGlobalStepDefinitions": true,
"json": {
"enabled": true
},
"stepDefinitions": "**/cypress/e2e/**/*.js",
"step_definitions": "**/cypress/e2e/**/*.js"
},
cypress.config.ts
import { defineConfig } from 'cypress'
export default defineConfig({
e2e: {
// We've imported your old cypress plugins here.
// You may want to clean this up later by importing these.
setupNodeEvents(on, config) {
return require('./cypress/plugins/index.js')(on, config)
},
specPattern: '**/e2e/**/*.feature',
"supportFile": false,
chromeWebSecurity: false
},
})
Update 1: Hello @Wirtuald, thanks for responding me. I began getting this issue on a quite complex angular project. So, I created a basic project from scratch and I still have the same issue. Then, I give you below all the information of this new project:
I dont have "plugins" folder
versions on package.json:
"devDependencies": { "@badeball/cypress-cucumber-preprocessor": "^11.2.0", "cypress": "^10.2.0" },preprocessor config on package.json
"cypress-cucumber-preprocessor": { "nonGlobalStepDefinitions": true, "json": { "enabled": true }, "stepDefinitions": [ "[filepath].{js,ts}", "cypress/e2e/**/*.{js,ts}" ]}
cypress.config.js:
const { defineConfig } = require("cypress"); module.exports = defineConfig({ e2e: { specPattern: "**/*.feature", chromeWebSecurity: false, setupNodeEvents(on, config) { // implement node event listeners here }, }, });
-project structure
- direct-attention-steps.js
import { Given, When, Then } from "@badeball/cypress-cucumber-preprocessor";
Given("Access to NXSuite", () => {
cy.visit("https://www.nxsuite.com");
})

