This repository showcases a focused End-to-End test suite built with Cypress to validate a critical e-commerce purchase flow on the Sauce Demo application.
This project exists to demonstrate how I approach high-value E2E testing when time and scope are limited. Instead of aiming for broad coverage, the focus is on validating the core purchase journey and a representative negative checkout scenario.
-
Critical path validation: login → product selection → cart → checkout → purchase completion.
-
Risk-based scope: only scenarios with direct business impact were automated.
-
Positive and negative coverage: successful purchase and validation error during checkout.
-
Clear, readable E2E tests: straightforward structure prioritizing clarity over abstraction.
-
Fast execution: the entire suite can be executed locally in minutes.
Evidence: All scenarios are implemented as Cypress specs under
cypress/e2e/.📌 Coverage Map: see
docs/coverage/coverage-map.md
To keep the project focused and realistic, the following were intentionally left out:
- Full regression coverage of all user journeys.
- Cross-browser and mobile testing.
- Performance, security, and accessibility testing.
- Extensive edge-case combinations.
- API-level testing (not required to validate this UI flow).
- Login with valid credentials.
- Sort products by Price (high to low).
- Add Sauce Labs Fleece Jacket to the cart.
- Verify product details in the cart and checkout overview.
- Complete the purchase with valid customer information.
- Login with valid credentials.
- Add a product to the cart.
- Proceed to checkout without filling the Postal Code field.
- Verify the correct validation error message.
- Node.js (LTS version recommended)
- Cypress
cypress/
├─ e2e/
│ ├─ tc001_checkout_success.cy.js
│ └─ tc002_checkout_missing_postal.cy.js
├─ fixtures/
└─ support/
├─ commands.js
└─ e2e.js
package.json
cypress.config.js
-
Username:
standard_user -
Password:
secret_sauce -
Sample Checkout Data:
- First Name:
Samuel - Last Name:
Costa - Postal Code:
12341234
- First Name:
git clone https://github.com/Samuel1810/sauce-demo-cypress-tests.git
cd sauce-demo-cypress-testsnpm ci
npm ciis recommended to ensure a clean and reproducible install.
npx cypress opennpx cypress runnpx cypress run --spec "cypress/e2e/tc001_checkout_success.cy.js"{
"scripts": {
"cy:open": "cypress open",
"cy:run": "cypress run"
}
}