To install and set up Cucumber in a Node.js project, you can follow the steps below. Cucumber is a tool for running automated tests written in plain language (Behavior-Driven Development, or BDD). It helps in writing test cases in a way that can be understood by non-technical stakeholders.
Firstly open the terminal after that move to the root folder of your Nodejs Project then write the below command.
npm install --save-dev cucumber
After installing the cucumber then you can check the package name in the package.json file.
"devDependencies": {
"cucumber": "^7.0.0-rc.0"
}
After installing the package, firstly you have to create a features folder at the root of your project.
after creating the folder you can create a file with .feature extension.
like mytest.feature
Run the cucumber test cases
Now write the test cases and run the test cases through the below command
./node_modules/.bin/cucumber-js