Skip to content

Cyber9933/Final-Sweet-Shop-present

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

13 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🍭 Sweet Shop - Cypress E2E Testing Suite

Project Description

Sweet Shop is an e-commerce website dedicated to selling retro sweets and candies. This project is designed for a final thesis and includes a comprehensive Cypress E2E testing suite for testing the website 🍬SWEETSHOP. The Sweet Shop application serves as a demonstration platform that intentionally incorporates common web development issues to showcase testing methodologies and debugging techniques. As stated by the original developers, this is "an intentionally broken web application to help demonstrate Chrome DevTools" and encompasses real-world scenarios that QA engineers encounter when testing e-commerce platforms. The project demonstrates practical application of modern testing frameworks in identifying functionality gaps, user interface inconsistencies, and performance bottlenecks that could affect customer satisfaction and conversion rates. The implementation utilizes structured documentation through testCases.md for comprehensive test case specifications, proper version control practices with .gitignore configuration, automated dependency management via package.json, and CI/CD integration through GitHub Actions workflows. The project architecture incorporates Cypress configuration files, custom commands, and organized test suites that follow industry best practices for maintainable test automation.

🎯 Project Goals

  • Learn Cypress E2E testing principles
  • Automate web application testing
  • Ensure website functionality quality
  • Evaluate performance and accessibility aspects

πŸ›οΈ Target Website

URL: 🍬SWEETSHOP

πŸ“Š Test Scenarios Coverage

Test Suite Test Cases Status
TS01: Homepage 1 TC βœ… Complete
TS02: Navigation Menu 18 TC βœ… Complete
TS03: Sweets Page 3 TC βœ… Complete
TS04: About Page 3 TC βœ… Complete
TS05: Shopping Basket 4 TC βœ… Complete
TS06: Login Page 4 TC βœ… Complete
TS07: Checkout Process 3 TC βœ… Complete

Create Cypress folder structure

cypress/
β”œβ”€β”€ e2e/
β”‚   β”œβ”€β”€ TS01-page-loading.cy.js
β”‚   β”œβ”€β”€ TS02-navigation-menu.cy.js  
β”‚   β”œβ”€β”€ TS03-sweets-page.cy.js
β”‚   β”œβ”€β”€ TS04-about-page.cy.js
β”‚   β”œβ”€β”€ TS05-shopping-basket.cy.js
β”‚   β”œβ”€β”€ TS06-login-page.cy.js
β”‚   └── TS07-checkout-process.cy.js
β”œβ”€β”€ support/
β”‚   β”œβ”€β”€ e2e.js
β”‚   └── commands.js
└── .github/
    └── workflows/
        └── node.js.yml

πŸš€ Installation & Setup

Requirements

  • Node.js v22
  • npm

Installation Steps

  1. Clone
git clone https://github.com/Cyber9933/Final-Sweet-Shop-present.git
cd final_candy_shop
  1. Install dependencies
npm install
  1. Install Cypress
npm install cypress --save-dev

πŸƒβ€β™‚οΈ Running Tests

Cypress Test Runner (GUI)

npm run cypress:open

Headless Mode

npm run cypress:run

Run Specific Test

# npx cypress run --spec "file name"
npx cypress run --spec "cypress/e2e/TS01_page_loading.cy.js"

πŸ› οΈ GitHub Actions Integration

Tests automatically run on:

  • Push to main branch
  • Pull requests to main branch

Configuration: .github/workflows/node.js.yml

Browsers

# Chrome
npx cypress run --browser chrome

πŸ“Š Test Methods

1. Smoke Tests

βœ… Homepage loading and title verification
βœ… Sweet Shop branding elements display
βœ… Navigation menu visibility
βœ… Primary links functionality (Home, Sweets, About, Login, Basket)
βœ… "Browse sweets" page loading
βœ… Product catalog display

2. Functional Tests

βœ… Navigation between all pages from all pages
βœ… URL routing verification
βœ… Page headers validation
βœ… All products display with prices
βœ… Product information accuracy (Wham Bars Β£0.15, Chocolate Cups Β£1.00)
βœ… Product images and accessibility verification
βœ… Adding items to basket
βœ… Basket content display
βœ… Removing items from basket
βœ… Empty basket state handling
βœ… Login form accessibility
βœ… Form field validation
βœ… Error handling for incorrect credentials

3. Regression Tests

βœ… About page content quality
βœ… Navigation stability
βœ… Error page handling ("Page not found" scenarios)
βœ… Checkout page accessibility verification
βœ… Form elements structure maintenance
βœ… Order summary verification with different basket content
βœ… Navigation functionality across all pages
βœ… Form validation functionality
βœ… Sweet Shop "intentionally broken" application behavior handling

πŸ“ˆ Test Reports

Screenshots

  • Automatically generated on failures
  • Saved to cypress/screenshots/
  • Included into .gitignore file

πŸ“Š Results Analysis

Successful Test Criteria

  • βœ… All tests pass (100% pass rate)
  • βœ… Page loading < 4s
  • βœ… No console errors

πŸ“š Useful Links

πŸ“ž Contact

Project Author: Lina PanavaitΔ—

Email: linate.pa@gmail.com

GitHub: github.com/Cyber9933


πŸ“„ License

This project is intended for educational purposes for final thesis.


Sweet Shop Cypress Testing Suite - Automated e-commerce website testing 🍭✨