This project is created to show how we can leverage Cucumber BDD framework in Cypress. Steps involved in configuring your project are following:
- Clone the project and run
npm i
to install all dependencies.
npx cypress run --help
- cypress - v10.7
- multiple-cucumber-html-reporter - v1.21.4
- cucumber-json-report-formatter - v0.0.9
- cypress-xpath - v2.0.1
- moment - v2.29.4
- moment-timezone - v0.5.37
- @badeball/cypress-cucumber-preprocessor - v12.1.0
- @bahmutov/cypress-esbuild-preprocessor - v2.1.3
- @shelex/cypress-allure-plugin - v2.29.0
Use ctrl + shift + p
and search for Preferences: Open Settings (JSON)
and open VS Codes settings. Add the following in settings.json
"[feature]":{
"editor.formatOnSave": true,
},
"cucumberautocomplete.strictGherkinCompletion": true,
"cucumberautocomplete.steps": [
"cypress/integration/**/*.js",
"cypress/e2e/**/*.js",
]
- BDD Framework
- Page Object Model
- Cucumber HTML Report
- Allure Report
- https://www.youtube.com/watch?v=FlQ9Carxeds
- https://testersdock.com/cypress-cucumber-bdd/
- https://github.com/badeball/cypress-cucumber-preprocessor/blob/master/docs/readme.md
- https://www.npmjs.com/package/@badeball/cypress-cucumber-preprocessor
- https://github.com/Shelex/cypress-allure-plugin
- https://www.npmjs.com/package/cypress-xpath
npx cypress open
npm run allure:clear
npm run cy:run
npm run allure:report
npx cypress run --browser "chrome" --spec "cypress/integration/LoginTest/Login.feature"
or
npx cypress-tags run -g 'cypress/integration/LoginTest/Login.feature' --browser "chrome"
or
npx cypress-tags run --browser "chrome" -e tags=@stage --spec "cypress/integration/LoginTest/Login.feature" --env configFile=qa
npm run allure:report
npm run allure:clear
$env:PERCY_TOKEN = "<token>"
npx cypress-tags run --browser "chrome" -e tags=@stage --spec "cypress/integration/LoginTest/Login.feature" --env configFile=qa
npm run cy:report
npm run allure:report