This document provides step to setup Cypress and BDD in any new project
1. npm install --save-dev cypress
2. run command ./node_modules/.bin/cypress open and choose the type od testing you want to perform
1. This will initialize the folder structure and sample tests
1. npm install --save-dev cypress-cucumber-preprocessor
3. Add below command to cypress.config.js
1. const cucumber = require('cypress-cucumber-preprocessor').default
2. module.exports = (on, config) => {
on('file:preprocessor', cucumber())
}
4. Add below command to cypress.config.js
1. "testFiles": "**/*.{feature,features}",
"ignoreTestFiles": "*.js"
5. Add below code to package.json
1. "cypress-cucumber-preprocessor": {
"nonGlobalStepDefinitions": false,
"step_definitions": "cypress/integration/featureFiles/stepdefinition/",
"commonPath": "cypress/integration/featureFiles/stepdefinition/common/",
"cucumberJson": {
"generate": true,
"outputFolder": "./cypress/results/cucumber-json",
"filePrefix": "",
"fileSuffix": ".cucumber"
}
6. Reference link : https://www.npmjs.com/package/cypress-cucumber-preprocessor
1. npm install --save-dev cucumber-html-reporter
2. Add a index.js file
3. Run command
1. node index.js
4. Reference link : https://www.npmjs.com/package/cucumber-html-reporter
- install ruby 2.6.6-1(X64) from https://rubyinstaller.org/downloads/
- install dependency(MSYs2), if not installed during RUBY installation, run below command:
- ridk install
- install nokogiri
- gem install nokogiri
- install hiptest-publisher
- gem install hiptest-publisher
- Add hiptest-publisher.conf file