|
1 | 1 | # Selenium-Python-E2E-Testing-Suite |
2 | 2 | End-to-End UI test automation for a live e-commerce site – 100% open source, CI-ready, Allure reports, and Dockerized. |
3 | 3 |
|
4 | | -This project was built from scratch to demonstrate a professional, scalable, and maintainable test automation framework using industry-best-practices. |
| 4 | +This project was built from scratch to demonstrate a professional test automation framework using industry best practices. |
| 5 | + |
| 6 | +### Target Site : |
5 | 7 |
|
6 | | -🎯 Target Site |
7 | 8 | URL: https://www.saucedemo.com/ |
8 | 9 |
|
9 | | -✨ Key Features |
10 | | -Page Object Model (POM): Fully implemented for clean, maintainable, and reusable test code. |
| 10 | +### Key Features : |
11 | 11 |
|
12 | | -Pytest Framework: Leverages pytest for test running, fixtures, and assertions. |
| 12 | +Page Object Model (POM) for clean, maintainable, and reusable test code. |
13 | 13 |
|
14 | | -Allure Reports: Generates beautiful, interactive, and shareable HTML reports with step-by-step logging. |
| 14 | +Pytest Framework for test running, fixtures, and assertions. |
15 | 15 |
|
16 | | -Dockerized: The entire suite is containerized with docker-compose. It runs a standalone Selenium Grid headlessly, making it CI/CD ready. |
| 16 | +Allure Reports: Generates interactive and shareable HTML reports with step-by-step logging. |
17 | 17 |
|
18 | | -Robust Waiting: Uses Docker healthchecks to ensure tests only run when the Selenium Grid is 100% ready, eliminating flaky "wait" scripts. |
| 18 | +Dockerized: The entire suite is containerized with docker-compose. It runs a standalone Selenium Grid headlessly, making it CI/CD ready. |
19 | 19 |
|
20 | 20 | Data-Driven: All test data (users, passwords, errors) is stored externally in data/test_data.json. |
21 | 21 |
|
22 | 22 | Configuration Management: Environment details (like the base_url) are stored in pytest.ini, not hardcoded. |
23 | 23 |
|
24 | | -🚀 How to Run |
25 | | -1. The Docker / CI-Ready Way (Recommended) |
26 | | -This is the simplest and most reliable way to run the entire suite. It runs headlessly and exactly as it would in a CI/CD pipeline. |
27 | | - |
28 | | -Prerequisites: |
| 24 | +### How to Run Using Docker |
29 | 25 |
|
30 | | -[suspicious link removed] installed and running. |
| 26 | +**Prerequisites:** |
31 | 27 |
|
32 | | -Run the Suite: |
| 28 | +Docker installed and running. |
33 | 29 |
|
34 | | -Bash |
35 | 30 |
|
36 | | -# 1. Clone the repository |
37 | | -git clone [https://github.com/YOUR_USERNAME/Selenium-Python-E2E-Testing-Suite.git](https://github.com/YOUR_USERNAME/Selenium-Python-E2E-Testing-Suite.git) |
| 31 | +**Clone the repository** |
| 32 | +``` |
| 33 | +git clone https://github.com/AminaSaoudi/Selenium-Python-E2E-Testing-Suite.git |
38 | 34 | cd Selenium-Python-E2E-Testing-Suite |
39 | | -2. Build and run the containers |
| 35 | +``` |
| 36 | + |
| 37 | +**Build and run the containers** |
| 38 | + |
40 | 39 | This command will: |
| 40 | + |
41 | 41 | - Build the 'python-tests' image |
42 | 42 | - Start the 'selenium' container |
43 | 43 | - Wait for Selenium to be healthy |
44 | 44 | - Run pytest, then stop everything. |
| 45 | +``` |
45 | 46 | docker-compose up --build --abort-on-container-exit |
| 47 | +``` |
46 | 48 |
|
| 49 | +### How to Run on your local machine |
47 | 50 |
|
48 | | -### 2\. The Local / Development Way |
49 | 51 | Use this method if you want to run tests locally for development or debugging. |
50 | 52 |
|
51 | | -Prerequisites: |
| 53 | +*Prerequisites:* |
52 | 54 |
|
53 | 55 | Python 3.10+ |
54 | 56 |
|
55 | 57 | Google Chrome |
56 | 58 |
|
57 | 59 | Allure (for viewing reports) |
58 | 60 |
|
59 | | -Run the Suite: |
| 61 | +**Clone the repository** |
60 | 62 |
|
61 | | -Bash |
62 | | - |
63 | | -# 1. Clone the repository |
64 | | -git clone [https://github.com/YOUR_USERNAME/Selenium-Python-E2E-Testing-Suite.git](https://github.com/YOUR_USERNAME/Selenium-Python-E2E-Testing-Suite.git) |
| 63 | +``` |
| 64 | +git clone https://github.com/AminaSaoudi/Selenium-Python-E2E-Testing-Suite.git |
65 | 65 | cd Selenium-Python-E2E-Testing-Suite |
66 | | -2. Create and activate a virtual environment |
| 66 | +``` |
| 67 | + |
| 68 | +**Create and activate a virtual environment** |
| 69 | + |
| 70 | +``` |
67 | 71 | python -m venv venv source venv/bin/activate # (or .\venv\Scripts\activate on Windows) |
| 72 | +``` |
68 | 73 |
|
69 | | -3. Install dependencies |
| 74 | +**Install dependencies** |
| 75 | + |
| 76 | +``` |
70 | 77 | pip install -r requirements.txt |
| 78 | +``` |
| 79 | + |
| 80 | +**Run pytest** |
71 | 81 |
|
72 | | -4. Run pytest |
73 | 82 | (This will run locally using webdriver-manager) |
| 83 | +``` |
74 | 84 | pytest |
| 85 | +``` |
| 86 | + |
75 | 87 |
|
| 88 | +### Viewing the Allure Report |
76 | 89 |
|
77 | | ------ |
78 | | -📊 Viewing the Allure Report |
79 | 90 | After running the tests (with either method), your test results are in the allure-results folder. |
80 | 91 |
|
81 | | -Make sure you have Allure installed (scoop install allure or brew install allure). |
| 92 | +Make sure you have Allure installed |
| 93 | + |
| 94 | +```scoop install allure or brew install allure``` |
82 | 95 |
|
83 | 96 | Serve the report: |
84 | 97 |
|
85 | | -```bash |
| 98 | +``` |
86 | 99 | allure serve allure-results |
87 | 100 | ``` |
88 | | -Your browser will automatically open with a beautiful, interactive dashboard. |
| 101 | +Your browser will automatically open with a beautiful, interactive dashboard (Example below) |
89 | 102 |
|
90 | | -``` |
91 | | -``` |
| 103 | +<img width="1857" height="888" alt="image" src="https://github.com/user-attachments/assets/64a96f21-e8e4-4fd0-8dcf-f05472fbb2e4" /> |
0 commit comments