Skip to content

Pat9990/Shop_UI_Automation_Framework

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SauceDemo Test Automation

The project automates functional testing of the SauceDemo website using Selenium WebDriver, pytest and Page Object Model (POM).


Contents


Technologies

  • Python 3.11+
  • Selenium 4.x
  • pytest 8.x
  • webdriver-manager 4.x
  • Firefox / Chrome
  • pytest-html (raporty w HTML)

Installation

  1. Clone repository:
git clone <repo-url>
cd <project-folder>
  1. Create virtual environment:
python -m venv .venv

3.Activate virtual environment: Windows

.venv\Scripts\activate
  1. Install dependencies:
pip install -r requirements.txt

Running Tests

pytest -v
  • Tests use Firefox by default.
  • All tests automatically open the browser, perform actions, and close it after the test.

Reports

You can generate reports in HTML using pytest-html:

pytest --html=reports/report.html --self-contained-html

The report will be saved in the reports/ folder (you'll need to create it if it doesn't exist). It contains test details, results, etc.

Project Structure

project/
│
├── core/                 # Configuration and global settings
│   └── config.py         # URLs, test data, constants
│
├── pages/                # Page Object Models
│   ├── base_page.py
│   ├── login_page.py
│   ├── inventory_page.py
│   ├── cart_page.py
│   └── checkout_page.py
│
├── tests/                # Automated tests
│   ├── test_login.py
│   ├── test_inventory.py
│   ├── test_cart.py
│   └── test_checkout.py
│
├── conftest.py           # Pytest fixtures
├── requirements.txt      # Dependency list
├── reports/              # HTML test reports
└── README.md             # Documentation

Conventions

  • Page Object Model – each page has its own class in pages/.
  • Private locators begin with __, helper methods begin with _.
  • Public methods describe user actions (e.g., login, add_to_cart, checkout_overview).
  • checkout_overview).
  • Configuration data (URLs, logins, passwords) is located in core/config.py.

Sample Tests

  • Login success and failure (test_login.py)
  • Sorting products by name and price (test_inventory.py)
  • Adding/removing products from the cart (test_cart.py)
  • Checkout and price total verification (test_checkout.py)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages