cypress-cucumber-example
v1.0.3
Published
Cypress cucumber example Test
Downloads
7
Readme
Cypress Cucumber Example Test
This is the repository of the BDD (Behaviour Driven Development) UI testing scenarios - Example Project
About BDD testing scenarios
- BDD scenarios can be found in the folder 'src\cypress\integration\BDD\features'
- The file 'example.feature' is empty. Add your BDD scenarios written in Gherkin code.
- The folder 'example' contains a js file to add the corresponding step definitions.
Before start executing the test cases
- Install node.js and npm. Access the URL https://nodejs.org/en/download/ to do the installation according to your Operating System.
- Use VS Code to open the project.
Perform this step once to install the required modules
Open a Terminal session, select the 'src' folder (> cd src
) and run npm install
. This action will install the required Cypress modules to execute the test scenarios
Run BDD Cypress test - Visual Mode
Open a Terminal session, select the 'src' folder (> cd src
) and run npm run cypress:open
. This action will open a CY window for you to visualise the testing execution. Click on "example.feature" to visualise the execution.
Run BDD Cypress test in Headless Mode with Reporter
- Open a Terminal session, select the 'src' folder (
> cd src
) - Run
npx cypress run
. This action will open execute the test scenarios in the console. - Once
npx cypress run
finished, generate an HTML report using>node ./cypress/support/cucumber-html-reporter.js
Run BDD Cypress test with Tags
- Open a Terminal session, select the 'src' folder (
> cd src
) - Run
npx cypress run -e TAGS='@TagName'
. This action will open execute the test scenarios related with that tag in headless mode. Change 'TagName' with the name used in the automation.