Skip to content

Kuplays/PythonPytestPlaywrightFrameworkUI

Repository files navigation

Python Pytest Playwright UI Automation Framework

Simple demo project for UI automation framework powered by pytest and playwright.


Features

  • Python 3.12, Pytest, Playwright
  • Page Object Model (POM)
  • Using Fixtures
  • Cross-browser support: Chromium, Firefox, Safari
  • Allure Reports generation
  • Screenshots and running environment in reports
  • CI/CD using Github Actions
  • Matrix and CLI runs
  • Live reports on Github Pages: Report

Installation

# clone repository
git clone https://github.com/Kuplays/PythonPytestPlaywrightFrameworkUI.git
cd PythonPytestPlaywrightFrameworkUI

# Create Virtual Environment (venv)
python -m venv my_venv
my_venv\Scripts\activate      # Activating on Windows
source my_venv/bin/activate   # Activating on Unix

# install required dependencies
pip install -r requirements.txt

# install playwright browsers
playwright install

# Install Allure reports for Python
pip install allure-pytest

# Install Allure CLI
https://allurereport.org/docs/install-for-windows/ # For Windows
https://allurereport.org/docs/install-for-linux/   # For Linux

Test run example

# Run smoke tests on Chromium and generate Allure report with given directory
pytest -m smoke --headed --browser=chromium --alluredir=reports/allure-reports --clean-alluredir
# Serve reports to a browser page
allure serve .\reports\allure-reports 

License

MIT License – Feel free to use in any way.


CI
ALLURE REPORT: https://kuplays.github.io/PythonPytestPlaywrightFrameworkUI/

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages