View Live Report β’ Read The Docs β’ Report Bug
This repository serves as a Production-Ready Reference Architecture for building high-scale automated testing frameworks using Python.
It demonstrates advanced design patterns, seamless CI/CD integration, and rich reporting capabilities that define modern Quality Engineering.
- Modern Python Tooling: Built with
uvfor lightning-fast dependency management andRufffor linting. - Robust Reporting: Full integration with Allure Report, including screenshots, logs, and video.
- Visual Regression: Integrated with Visual Regression Tracker for pixel-perfect UI validation.
- CI/CD Ready: Complete GitHub Actions workflows for Nightly runs, PR checks, and Report deployment.
This project implements the concepts discussed in the following TestShift articles:
- Test Automation - How To Build a CI/CD Pipeline Using Pytest and GitHub Actions
- Test Automation - How To Attach Public IP Address to Allure report using Pytest and Requests
- Test Automation - Selenium Example Python Project 2022 Updates
- Test Automation - How To Add Git Version Control Data To Allure Report in Python
- Test Automation - How To Attach Session Storage, Local Storage, Cookies, and Console logs To Allure Report in Selenium Python
- Test Automation - How To Capture Full-Page Screenshots In Selenium Python Using Chrome DevTools Protocol
- Test Automation - How To Edit Cookies in Selenium Python
- Test Automation - Pre-Merge Testing with GitHub Actions: A Step-by-Step Guide
- Test Automation - How To Use Custom User Agent in Selenium Python or Playwright Python to Avoid Security Bots
- Test Automation - How to Use Dynamic Base URLs with Selenium And Playwright Python in GitHub Actions
- Test Automation Best Practices: Pinning Browser Version in Selenium Python for Stability
- Test Automation - Capturing Console Logs and JavaScript Errors with Selenium WebDriver BiDi in Python
| Tool | Description & Why We Use It |
|---|---|
| Selenium | The industry standard for browser automation. |
| Pytest | The most powerful and flexible testing framework for Python. |
| Allure | For beautiful, data-rich test reports including screenshots and logs. |
| Visual Regression Tracker | To catch UI bugs that functional tests miss (Pixel Perfect). |
| Assertpy | An expressive assertion library for readable tests. |
| Dataclasses JSON | Easy serialization of objects for API/Data handling. |
| MySQL Connector | Direct database validation. |
| Mailinator Client | For testing real email delivery workflows. |
| Tenacity | Robust retrying mechanism for flaky network operations. |
git clone https://github.com/nirtal85/Selenium-Python-Example.git
cd selenium-python-exampleWe use uv for lightning-fast installations.
Windows:
pip install uv
uv venv
.\env\Scripts\activate
uv sync --all-extras --devMac/Linux:
pip install uv
uv venv
source .venv/bin/activate
uv sync --all-extras --devCreate a .env file in the project root directory to securely store project secrets. This file is essential for authentication and environment configuration.
EMAIL="your@email.com"
PASSWORD="your_secret_password"
# ... add other variables as needed (see .env.example)Run all tests (Headless Chrome by default):
pytestRun with specific browser:
pytest --driver firefoxRun specific suite (Tags):
pytest -m sanityWe use Allure for reporting. To view results locally:
Windows (via Scoop):
scoop install allure
allure serve allure-resultsMac (via Brew):
brew install allure
allure serve allure-resultsπ See a Live Example of the Report Here
Found this project useful? If this architecture helped you solve a problem or save time, consider supporting the work!