Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with stepDefinitions #1227

Closed
3 tasks done
AlbaSS18 opened this issue Aug 23, 2024 · 2 comments
Closed
3 tasks done

Error with stepDefinitions #1227

AlbaSS18 opened this issue Aug 23, 2024 · 2 comments

Comments

@AlbaSS18
Copy link

AlbaSS18 commented Aug 23, 2024

Hello,

First of all, I want to apologize because this is not really an issue or bug. I search help with migration.

I am trying to migrate Cypress to v10.11.0. In this app, I have installed v20.1.0 cucumber. The problem is when I try to run a test, the next error appears:
image
Mi folder system is:

cypress
└── e2e
    ├── Wiring
    │   ├── Wiring.feature
    │   └── Wiring.js

My cypress configuration file is:

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

module.exports = defineConfig({
  viewportHeight: 1080,
  viewportWidth: 1080,
  chromeWebSecurity: false,
  e2e: {
    setupNodeEvents(on, config) {
      on("file:preprocessor", cucumber());
    },
    baseUrl: 'https://sis.tsk.cloud',
    specPattern: 'cypress/e2e/**/*.feature',
  }
});

And my package.json is:

  "cypress-cucumber-preprocessor": {
    "nonGlobalStepDefinitions": true,
    "stepDefinitions": "cypress/e2e/Wiring/*.js"
  },
  "devDependencies": {
    "@babel/core": "^7.7.4",
    "@babel/preset-env": "^7.7.4",
    "@badeball/cypress-cucumber-preprocessor": "^20.1.0",
    "@types/systemjs": "^6.1.0",
    "babel-eslint": "^11.0.0-beta.2",
    "babel-loader": "^8.0.6",
    "clean-webpack-plugin": "^3.0.0",
    "copy-webpack-plugin": "^5.0.4",
    "cypress": "10.11.0",
    "cypress-cucumber-preprocessor": "^4.3.1",
    "cypress-downloadfile": "^1.2.3",
    "cypress-file-upload": "^5.0.8",
    "eslint": "^6.7.2",
    "eslint-config-important-stuff": "^1.1.0",
    "eslint-config-prettier": "^6.7.0",
    "eslint-plugin-prettier": "^3.1.1",
    "html-webpack-plugin": "^3.2.0",
    "husky": "^3.1.0",
    "prettier": "3.1.0",
    "pretty-quick": "^2.0.1",
    "serve": "^11.2.0",
    "ts-node": "^8.5.4",
    "tslint": "^5.17.0",
    "typescript": "^3.5.1",
    "uglify-js": "^3.17.4"
  }

I have reviewed others questions in StackOverflow but any answer helped me. What am I doing wrong? Can anyone help me?Thank you in advance.

Versions

  • Cypress version: 10.11.0
  • Preprocessor version: 20.1.0
  • Node version: 18.13.0

Checklist

  • I've read the FAQ.
  • I've read instructions for logging issues.
  • I'm not using cypress-cucumber-preprocessor@4.3.1 (package name has changed and it is no longer the most recent version, see #689).
@badeball
Copy link
Owner

You've added @badeball/cypress-cucumber-preprocessor to your package.json, but you're still importing cypress-cucumber-preprocessor. Although named similarly, they're different packages and they might as well be named abc and xyz. Remove abc from your project altogether.

Take a look at any of the many examples, which all work. If something doesn't work, it's always because you're doing something different.

@AlbaSS18
Copy link
Author

AlbaSS18 commented Sep 2, 2024

Yes, you're right. I have already solved. Thank you very much and sorry for my error. I was desperate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants