Skip to content
Projets

nirtal85/Selenium-Python-Example

Voir sur GitHub

À propos

Enterprise-Grade Selenium Python Architecture | Scalable Boilerplate with Pytest, Allure & Design Patterns.

Apprentissage et éducation

Comment ces chiffres sont mesurés

What 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

Original

Enterprise-Grade Selenium Python Architecture

The Ultimate Boilerplate for Scalable, Robust, and Modern UI Automation

Twitter Follow YouTube Architecture by TestShift CI Status Monthly Build Tests uv Ruff

View Live Report • Read The Docs • Report Bug


🚀 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 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.

📃 Articles written about this project

This project implements the concepts discussed in the following TestShift articles:


🛠️ 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!

Buy Me A Coffee


Visit TestShift.com for more Architectural Insights

Explorer des projets similaires

Chargement…