Skip to content

LuisVu99/playwright-pytest-framework

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎭 Playwright Pytest Framework

CI Allure Report LinkedIn License

A scalable Playwright + Pytest automation framework for UI & API testing with CI/CD integration and Allure reporting.


📖 Overview

This repository contains a modular automation framework built with Python, Playwright, and Pytest.

✨ Key features:

  • Page Object Model (POM) for UI tests
  • Parallel execution, retries, and multi-browser support
  • API testing with Playwright
  • Rich Allure Reports with screenshots & logs
  • CI/CD via GitHub Actions + auto-published reports

🔗 Live Demo ReportAllure Report on GitHub Pages


⚙️ Tech Stack

  • 🐍 Python 3.10+
  • 🧪 Pytest (test framework)
  • 🎭 Playwright (UI & API automation)
  • 📊 Allure (reporting)
  • GitHub Actions (CI/CD)
  • 🗂️ Page Object Model (POM)

🚀 Getting Started

1️⃣ Clone repo

git clone https://github.com/LuisVu1999/playwright-pytest-framework.git
cd playwright-pytest-framework

2️⃣ Install dependencies

pip install -r requirements.txt

3️⃣ Install Playwright browsers

playwright install

🧪 Running Tests

  • ▶️ Default (Chromium)

    pytest --env=dev --browser=chromium
  • 🌍 All browsers

    pytest --env=dev --browser=all
  • 🔄 With retries (2 times)

    pytest --env=dev --browser=chromium --reruns 2
  • Parallel (3 workers)

    pytest -n 3 --env=dev --browser=chromium

📊 Reporting

  • Generate local Allure Report

    allure generate allure-results --clean -o allure-report
    allure open allure-report
  • GitHub Pages (CI/CD)
    Auto-published after each pipeline run → 👉 Latest Allure Report


🔗 CI/CD Integration

This project integrates with GitHub Actions:

  • ✅ Run tests on push/PR
  • ✅ Multi-browser execution
  • ✅ Auto-generate & publish Allure Report

Workflow file:

.github/workflows/ci.yml

📂 Project Structure

playwright-pytest-framework/
├── pages/              # Page Object Models (POM)
├── tests/              # Test cases (UI & API)
│   ├── ui/             # UI test cases
│   └── api/            # API test cases
├── helpers/            # Utility functions & common modules
├── .github/workflows/  # CI/CD configurations
├── config.py           # Environment & config management
├── conftest.py         # Pytest fixtures setup
├── requirements.txt    # Project dependencies
├── pytest.ini          # Pytest configurations
└── README.md           # Project documentation


👤 Author


🏆 Highlights

  • ✅ Built with best practices in automation testing
  • Scalable design ready for CI/CD pipelines
  • Portfolio-ready framework for freelance & enterprise projects

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages