Skip to content

Full UI test automation suite for saucedemo.com using Python, Selenium, and Pytest. Covers login flow, cart, checkout, and negative test scenarios.

Notifications You must be signed in to change notification settings

Puchao64/saucedemo-pytest-autotest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

πŸ§ͺ Saucedemo UI Automation β€” Python + Selenium + Pytest

This repository contains automated UI tests for the saucedemo.com demo shop, implemented in Python using Selenium WebDriver and Pytest.
Each test is validated and followed by a screenshot stored in /screenshots/.


πŸ“Œ Description

The test suite covers the following UI scenarios:

  • βœ… Login (valid, invalid, locked user)
  • πŸ›’ Cart operations (add, remove, badge counter)
  • πŸ“¦ Checkout process (form, overview, confirmation)
  • 🧭 Navigation and product sorting

Each test saves a screenshot by name in /screenshots/.


πŸ›  Tech Stack

  • Python
  • Pytest
  • Selenium WebDriver
  • ChromeDriver
  • GitHub

βœ… Test Cases

# Test Case Status
1 Invalid login (wrong password) βœ…
2 Locked out user login βœ…
3 Valid login βœ…
4 Inventory items visible after login βœ…
5 Screenshot after successful login βœ…
6 Add item to cart βœ…
7 Cart badge shows 1 βœ…
8 Remove item from cart βœ…
9 Navigate to cart page βœ…
10 Cart is empty after removal βœ…
11 Sort products: Name (Z to A) βœ…
12 Sort products: Price (Low to High) βœ…
13 Sort products: Price (High to Low) βœ…
14 Add two items and go to checkout βœ…
15 Complete full checkout process βœ…

πŸ“‚ Project Structure

qa-login-saucedemo-pytest/
β”œβ”€β”€ conftest.py
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ README.md
β”œβ”€β”€ screenshots/
β”‚   └── 01_invalid_login.png ... 15_checkout_complete.png
└── tests/
    └── test_saucedemo.py

πŸ–Ό Screenshots

❌ 01 – Invalid Login

01_invalid_login

❌ 02 – Locked Out User

02_locked_out_user

βœ… 03 – Valid Login

03_valid_login

βœ… 04 – Inventory Items Present

04_inventory_items_present

πŸ“Έ 05 – Logged In Screenshot

05_logged_in

πŸ›’ 06 – Add to Cart

06_add_to_cart

πŸ›’ 07 – Cart Badge Shows 1

07_cart_badge_one

πŸ”„ 08 – Remove from Cart

08_remove_from_cart

πŸ“¦ 09 – Navigate to Cart

09_navigate_to_cart

πŸ“¦ 10 – Cart Empty After Removal

10_cart_empty_after_removal

πŸ”€ 11 – Sort Name Zβ†’A

11_sort_name_z_to_a

πŸ’² 12 – Sort Price Lowβ†’High

12_sort_price_low_to_high

πŸ’² 13 – Sort Price Highβ†’Low

13_sort_price_high_to_low

🧾 14 – Two Items to Checkout

14_two_items_checkout

βœ… 15 – Checkout Complete

15_checkout_complete


πŸš€ Run Locally

  1. Install Python 3.x and Chrome
  2. Clone this repository
  3. Install dependencies:
pip install -r requirements.txt
  1. Run tests:
pytest tests/
  1. Screenshots will be saved automatically to /screenshots/

About

Full UI test automation suite for saucedemo.com using Python, Selenium, and Pytest. Covers login flow, cart, checkout, and negative test scenarios.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages