Skip to content

sahu-sourabh/playwright-python-hybrid-framework

Repository files navigation

Playwright Python Hybrid Framework 🚀

An R&D Repository for Asynchronous Quality Engineering.

Playwright Tests

🏗️ Modern Modular Architecture

This lab is built using a Domain-Driven Design (DDD) approach to ensure scalability and separation of concerns:

  • core/: The engine room containing Custom Async API Clients and Browser configurations.
  • pages/: Page Object Models (POM) representing the application state and UI interactions.
  • infra/: Infrastructure as Code, including Docker-compose and environment utilities.
  • configs/: Centralized environment-specific settings and secret management.
  • data/: Structured test data and Pydantic models for API request/response validation.
  • legacy/: Archived previous implementations for historical reference.

🛠️ Tech Stack

  • Language: Python 3.12+ (Optimized for Async/Await patterns)
  • Framework: Pytest + Playwright (Plugin-based architecture)
  • API Engine: HTTPX (High-performance asynchronous HTTP client)
  • Config Management: Pydantic-Settings (Environment variable validation)
  • Build System: pyproject.toml (Following PEP 518/621 Standards)
  • Linting/Formatting: Ruff (Ensuring high-quality, code standards)
  • CI/CD: GitHub Actions using Node 24 runners for modern performance.

🚀 Quick Start (Local Setup)

Follow these steps to replicate the lab environment:

  1. Clone & Create Virtual Env:
  • python -m venv .venv
  • Windows: .venv\Scripts\activate
  • Mac/Linux: source .venv/bin/activate
  1. Install Local Package & Dependencies:
  • pip install .
  • playwright install chromium
  1. Configure Environment:
  • Create a .env file in the root directory (referencing .env_example)
  1. Run Tests:
  • pytest

🚀 Latest Milestones

  • Async API Engine: Implemented AsyncAPIClient with centralized logging.
  • Type-Safe Configuration: Migrated to Pydantic-Settings for robust .env management.
  • Multi-Target Support: Infrastructure ready for both SauceDemo (UI) and Restful-Booker (API/Hybrid).

📈 Engineering Objectives

  • Hybrid Testing Flow: Executing API-first setups (e.g., Auth/Data seeding) followed by UI verification.
  • Asynchronous Execution: Reducing CI/CD bottleneck by leveraging non-blocking I/O.
  • Correlation Tracing: Implementing X-Correlation-ID in API clients for observability.
  • Atomic Commits: Maintaining a clean, traceable Git history for collaborative growth.
  • Modern Standards: Using pyproject.toml for unified, standardized configuration.

About

A professional-grade Playwright Python automation framework featuring POM, CI/CD integration, and data-driven testing.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages