This repository includes 17 automated tests written using the Cypress framework, Cucumber, and JavaScript. These tests validate the functionality of key elements on the Sauce Demo website, including the login, inventory, cart, and checkout pages.
- Node.js v14 or higher
- Cypress
- @badeball/cypress-cucumber-preprocessor
- @bahmutov/cypress-esbuild-preprocessor
- multiple-cucumber-html-reporter
- cucumber-json-formatter
- Clone the repository:
git clone https://github.com/haite4/cypress-cucumber-task
- Navigate to the project directory:
cd cypress-cucumber-task
- Install dependencies:
npm install cypress --save-dev npm install
-
Run all Cypress tests in headless mode:
npm run cypress:run
To use a configuration file for mobile testing:
npm run test:mobile
-
Run tests with a specific browser:
- For Chrome:
npm run test:chrome
- For Firefox:
npm run test:firefox
- For Edge:
npm run test:edge
- For Chrome:
-
Open Cypress Test Runner for interactive testing:
npm run cypress:open
This command will open the Cypress Test Runner, allowing you to run and debug tests interactively in the Cypress GUI.
-
Run tests for specific pages:
- Login Page Tests:
npm run test:login:run
- Inventory Page Tests:
npm run test:inventory:run
- Cart Page Tests:
npm run test:cart:run
- Checkout Page Tests:
npm run test:checkout:run
- Login Page Tests:
- Serve the html report:
npm run cypress:report