nirtal85/Selenium-Python-Example
À propos
Enterprise-Grade Selenium Python Architecture | Scalable Boilerplate with Pytest, Allure & Design Patterns.
Apprentissage et éducationWhat you can do
- Modern Python Tooling: Built with uv for lightning-fast dependency management and Ruff for 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 Monthly runs, PR checks, and Report deployment.
Progression mesurée des étoiles
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- +1
- in 1 month
- Historique en cours
Variations nettes sur des périodes qui se chevauchent, pas des totaux quotidiens. Les mesures absentes restent vides. Les étoiles indiquent l’intérêt, pas la qualité.
README.md
OriginalEnterprise-Grade Selenium Python Architecture
The Ultimate Boilerplate for Scalable, Robust, and Modern UI Automation
🚀 About The Project
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.
✨ Key Features
- 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 Monthly runs, PR checks, and Report deployment.
📃 Articles written about this project
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
- Allure 3 Isn’t Just an Upgrade. It’s the Final Piece of the Quality Gate Architecture
🛠️ Tech Stack
| 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. |
Agent environment setup
For an AI coding agent, use the repository's setup-env skill to install dependencies and prepare the browser. In Codex, invoke it with $setup-env.
⚙️ Getting Started
1. Clone
git clone https://github.com/nirtal85/Selenium-Python-Example.git
cd selenium-python-example
2. Install (The Modern Way)
We use uv for lightning-fast installations.
Windows:
pip install uv
uv venv
.\.venv\Scripts\activate
uv sync --all-extras --dev
Mac/Linux:
pip install uv
uv venv
source .venv/bin/activate
uv sync --all-extras --dev
3. Configure
Create a .env file in the project root directory to securely store project secrets. This file is essential for authentication and environment configuration.
EMAIL="[email protected]"
PASSWORD="your_secret_password"
# ... add other variables as needed (see .env.example)
🏃♂️ Execution
Run all tests (Headless Chrome by default):
uv run pytest
Run with specific browser:
uv run pytest --driver firefox
Run specific suite (Tags):
uv run pytest -m sanity
📊 Results & Reporting
We use Allure for reporting. To generate and open the report locally:
npx -y allure generate allure-results --output allure-report --open
For a pull request, download and extract the allure-report artifact from the
workflow run. Serve the extracted directory over HTTP rather than opening its
index.html directly:
npx -y allure open <extracted-report-directory>
👉 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!
Explorer des projets similaires
Chargement…