|
1 | | -Automated Web Testing Framework with Selenium and PytestA beginner-friendly QA automation project demonstrating end-to-end (E2E) testing for the SauceDemo e-commerce demo app (https://www.saucedemo.com/). This framework uses the Page Object Model (POM) for maintainable tests, covering login scenarios (successful and error cases), inventory management (add/sort), cart operations (add/remove/verify), and full checkout flows. Built with Python, Selenium, and Pytest for modular, scalable testing. Includes data-driven tests, cross-browser support (Firefox/Chrome), and advanced reporting. |
| 1 | +# 🛡️ Selenium + Pytest SauceDemo E2E Framework with Allure |
2 | 2 |
|
3 | | -[](https://www.python.org/) |
4 | | -[](https://www.selenium.dev/) |
5 | | -[](https://pytest.org/) |
| 3 | +[](https://www.python.org/) |
| 4 | +[](https://www.selenium.dev/) |
| 5 | +[](https://pytest.org/) |
| 6 | +[](https://allurereport.org/) |
| 7 | +[](https://github.com/jerryfinol17/Automated-testing-project/actions) |
| 8 | +[](LICENSE) |
6 | 9 |
|
7 | | -## Overview |
8 | | -Goal: Automate key user flows like authentication, product sorting/adding to cart, item management, and complete checkout processes. |
9 | | -App Under Test: SauceDemo – a sample e-commerce site for testing login, inventory, cart, and checkout. |
10 | | -Current Coverage: 12+ tests (4 login variants, 4 inventory flows, 4 cart/E2E checkouts) with data-driven parametrization and ~90% pass rate. |
11 | | -Run Environment: Firefox/Chrome (headless for CI; non-headless for local debugging) via WebDriver Manager (no manual driver setup needed). |
12 | | -Scalability: Easy to extend with more browsers, APIs, or mobile emulation. |
| 10 | +**Enterprise-ready End-to-End automation framework** for SauceDemo using **Selenium WebDriver**, **pytest**, **Page Object Model** and **Allure reporting** — with rich interactive dashboards, screenshots, timelines and CI/CD artifacts. |
13 | 11 |
|
| 12 | +Demonstrates key skills companies seek: stable Selenium automation, beautiful stakeholder reports (Allure), maintainable POM, data-driven tests, cross-browser, and automated pipelines. |
14 | 13 |
|
15 | | -## Tech Stack |
16 | | -## Languages/Tools: |
17 | | -- Python 3.9+ |
18 | | -- Selenium WebDriver |
19 | | -- Pytest |
20 | | -- WebDriver Manager |
21 | | -## Reporting: |
22 | | -- Pytest-HTML (basic logs) |
23 | | -- Allure (interactive dashboards with steps, timelines, and screenshots). |
24 | | -## Design Pattern: |
25 | | --Page Object Model (POM) for clean separation of locators, actions, and config. |
26 | | -## CI/CD: |
27 | | --GitHub Actions for automated runs on push/PR, with report artifacts. |
28 | | -## Other: |
29 | | -- Data-driven testing via @pytest.mark.parametrize, explicit waits for stability. |
| 14 | +### ✨ Key Highlights |
| 15 | +- ✅ Full **Page Object Model** (dedicated pages + config modules) |
| 16 | +- ✅ Cross-browser (Chrome & Firefox via WebDriver Manager) |
| 17 | +- ✅ All SauceDemo users & edge cases (locked-out, invalid creds, empty fields) |
| 18 | +- ✅ Comprehensive flows: login, inventory (add/multi/sort/price validation), cart (consistency/remove), full parametrized checkout E2E |
| 19 | +- ✅ **Allure reporting** — steps, attachments, timelines, screenshots, failure details |
| 20 | +- ✅ Pytest-HTML fallback + auto artifacts in CI |
| 21 | +- ✅ GitHub Actions CI (runs on push/PR, green status, reports downloadable) |
| 22 | +- ✅ Data-driven with `@pytest.mark.parametrize` |
30 | 23 |
|
31 | | -automated-testing-project/ |
32 | | -├── config/ |
33 | | -│ ├── config_for_login_page.py # Test credentials (standard_user, locked_out, invalid, empty) |
34 | | -│ ├── config_for_inventory_page.py # Product locators and details (add/remove selectors) |
35 | | -│ └── config_for_cart_page.py # Cart product mappings (display names, actions) |
36 | | -├── pages/ |
37 | | -│ ├── login_page.py # Login actions (open, enter creds, error handling, logout) |
38 | | -│ ├── inventory_page.py # Inventory actions (add single/multi, sort by price, badge count, go to cart) |
39 | | -│ ├── cart_page.py # Cart verification (get items, remove, badge, start checkout) |
40 | | -│ └── checkout_page.py # Checkout steps (fill info, continue, complete) |
41 | | -├── tests/ |
42 | | -│ ├── test_login.py # Login tests (success, errors) |
43 | | -│ ├── test_inventory.py # Inventory tests (add, multi-add, sort, prices) |
44 | | -│ └── test_cart.py # Cart and E2E tests (verify, remove, checkout) |
45 | | -├── reports/ # Generated HTML reports (run pytest to create) |
46 | | -├── allure-results/ # Raw Allure data (auto-generated) |
47 | | -├── allure-report/ # Generated Allure HTML dashboard |
48 | | -├── docs/ # Screenshots and docs (e.g., report_screenshot.png) |
49 | | -├── requirements.txt # Dependencies (selenium, pytest, allure-pytest, etc.) |
50 | | -├── .github/workflows/ci.yml # GitHub Actions for CI/CD |
51 | | -└── README.md # You're reading it! |
| 24 | +### 📁 Project Structure |
52 | 25 |
|
53 | | -## Quick StartClone the Repo: |
| 26 | +```bash |
| 27 | +Automated-testing-project/ |
| 28 | +├── config/ # Credentials & locators per page |
| 29 | +├── pages/ # POM core (login, inventory, cart, checkout) |
| 30 | +├── test/ # Test suites (login, inventory, cart/E2E) |
| 31 | +├── reports/ # Pytest-HTML reports |
| 32 | +├── allure-results/ # Raw Allure data |
| 33 | +├── allure-report/ # Generated Allure dashboard |
| 34 | +├── docs/ # Screenshots & extras |
| 35 | +├── .github/workflows/ # CI pipeline (main.yml) |
| 36 | +└── requirements.txt |
| 37 | +``` |
54 | 38 |
|
55 | | -- git clone https://github.com/your-username/automated-testing-project.git |
56 | | -- cd automated-testing-project |
57 | | -- Install Dependencies: |
58 | | -- pip install -r requirements.txt |
59 | | -- Run Tests:All tests: pytest tests/ -v |
60 | | -- With HTML report: pytest tests/ --html=reports/report.html --self-contained-html -v |
61 | | -- With Allure: pytest tests/ --alluredir=allure-results -v then allure serve allure-results |
62 | | -## Specific test: |
63 | | -- pytest tests/test_cart.py::test_full_e2e_checkout -v |
64 | | -- Cross-browser (if marked): pytest -m cross_browser -v |
| 39 | +### 🚀 Quick Start |
| 40 | +```bash |
| 41 | +git clone https://github.com/jerryfinol17/Automated-testing-project.git |
| 42 | +cd Automated-testing-project |
| 43 | +pip install -r requirements.txt |
| 44 | +``` |
65 | 45 |
|
66 | | -## View Reports: |
67 | | -:HTML: Open reports/report.html in your browser for logs and pass/fail summaries. |
68 | | -- HTML Report Example |
69 | | -- Allure: Run allure serve allure-results for an interactive dashboard (timelines, steps, attachments). Example screenshot: |
70 | | -- Allure Dashboard |
71 | | -## Tests CoveredLogin (test_login.py): |
72 | | -- Successful login |
73 | | -- Locked-out user |
74 | | -- Invalid credentials |
75 | | -- Empty username (4 tests). |
76 | | -## Inventory (test_inventory.py): |
77 | | -- Add single product to cart |
78 | | -- Multi-add products |
79 | | -- Sort by price (lo-hi/hi-lo) |
80 | | -- Validate prices (4 tests). |
81 | | -## Cart & E2E (test_cart.py): |
82 | | -- Verify cart items/badge |
83 | | -- Remove single/all items |
84 | | -- Start checkout |
85 | | -- Full E2E checkout (parametrized with user data) (4+ tests). |
| 46 | +### Run Tests: |
| 47 | +```bash |
| 48 | +pytest test/ -v # Full suite |
| 49 | +pytest --alluredir=allure-results -v # With Allure |
| 50 | +allure serve allure-results/ # Open interactive report |
| 51 | +``` |
86 | 52 |
|
87 | | -All tests include asserts for URLs, elements, text, and edge cases. Data-driven for efficiency (e.g., multiple products/usernames). |
88 | | - |
89 | | -CI/CD IntegrationGitHub Actions runs tests on every push/PR to main. |
90 | | -Artifacts: Download allure-report or html-report from Actions tab for post-run analysis. |
91 | | -Badges update automatically for build status. |
92 | | - |
93 | | -Contributing & Next StepsFork, PRs welcome! Add more tests (e.g., responsive checks) or browsers. |
94 | | -For production: Integrate coverage (pytest-cov) or parallel runs (pytest-xdist). |
95 | | -Questions? Open an issue. |
| 53 | +### CI Reports: |
| 54 | +Download Allure/HTML artifacts from Actions tab after runs. |
| 55 | +### Reporting Demo |
| 56 | +Allure dashboard: steps, screenshots, failure reasons — perfect for sharing with PMs/devs. |
| 57 | +(Agrega screenshot de Allure si podés: sube uno a docs/ y enlaza: Allure Sample) |
96 | 58 |
|
97 | 59 |  |
98 | 60 |  |
99 | | -Built by Jerry Finol | Last Updated: October 6, 2025 |
100 | | -https://github.com/jerryfinol17/Automated-testing-project/actions/runs/18293106423/artifacts/4196777875 |
| 61 | + |
| 62 | +### Why this Framework stands out |
| 63 | +Classic Selenium (enterprise staple) + modern Allure reporting = combo que muchas compañías pagan bien. Listo para escalar a tu proyecto real.Open for freelance/contract QA roles (Selenium/Playwright/Python/API/CI). → DM @GordoRelig3d |
| 64 | + |
| 65 | +→ Email: jerrytareas17@gmail.com¡Tests green, reports stunning! |
| 66 | + |
| 67 | +Built by Jerry Finol | Last Updated: March 20, 2026 |
0 commit comments