This project is a practice exercise for creating End-to-End (E2E) automation tests using SauceDemo with Cypress. It helps in understanding test automation concepts and improving skills in writing Cypress test scripts.
Before running the tests, ensure you have the following installed:
- Clone the repository:
git clone <repository-url> cd <repository-folder>
- Install dependencies:
npm install
The test suite consists of the following test scenarios:
- Login Test: Verifies login functionality with valid credentials.
- Product Selection & Validation: Selects a product and verifies its details.
- Purchase Process: Adds all products to the cart, proceeds to checkout, and completes the purchase.
- Logout Test: Ensures a user can log out successfully.
To execute the tests, use one of the following commands:
-
Run tests in headless mode:
npx cypress run
-
Open Cypress UI for interactive testing:
npx cypress open
The main test script is located in:
/cypress/e2e/saucelab.cy.js
This file contains:
- LoginPage class for handling login interactions.
- InventoryPage class for managing product interactions.
- CartPage class for handling cart operations.
- ProductPage class for validating product details.
- YourInformationPage class for user information input.
- OverviewPage class for reviewing order details.
- CompletePage class for order confirmation.
Cypress provides test execution reports which can be accessed after running tests. You can integrate additional reporting tools like Mochawesome for enhanced reports.
This project is designed to practice automation testing using SauceDemo, providing hands-on experience with Cypress. Contributions and improvements are welcome!