View Live Report β’ Read The Docs β’ Report Bug
This repository is a Production-Ready Reference Architecture for building next-generation test automation using Playwright and Python.
It goes beyond basic scripts to demonstrate a fully scalable framework with advanced features like Accessibility Testing (A11y), visual tracing, and cloud integration, tailored for modern DevOps pipelines.
- Modern Tooling: Powered by
uvfor blazing fast package management andRufffor linting. - Accessibility First: Integrated Axe scans to ensure your app is accessible to everyone.
- Deep Debugging: Full integration with Playwright Traces and Video recording linked directly to Allure Reports.
- Cloud Scale: Native integration with BrowserStack for cross-browser testing on real devices.
- CI/CD Optimization: Parallel execution strategies and dynamic version syncing for GitHub Actions.
This project implements the concepts discussed in the following TestShift articles:
- 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 - Maximizing Browser Window With Playwright Python And Pytest
- Test Automation - How to Bypass Re-Login With Playwright Python And Pytest
- Test Automation - How To Perform Automated Accessibility Checks Using Playwright Python And Axe
- Test Automation - How To Link Playwright Traces and Videos to Allure Report using GitHub Actions
- Test Automation - Speeding Up Testing with Playwright Python using Local Storage
- Test Automation - Efficient Element Selection with Playwright Python using Test IDs
- Test Automation - Flexible Test Execution with Playwright Python and GitHub Actions
- Test Automation - Accelerating Playwright Python Tests with Parallel Execution in GitHub Actions
- Test Automation - How to Sync Playwright Versions Between Python and GitHub Actions
- From Open Source to Industry Sponsorship: The TestShift Journey with BrowserStack
- From Selenium to Playwright: A Data-Driven Look at the Shifting Landscape of Test Automation
| Tool | Description & Why We Use It |
|---|---|
| Playwright | The modern standard for reliable, flaky-free browser automation. |
| Pytest | The most powerful testing framework for Python. |
| Axe Playwright | For automated accessibility (A11y) compliance testing. |
| Allure | For beautiful, data-rich test reports including Traces & Video. |
| Pytest Split | To intelligently split test suites for parallel execution. |
| Requests | For API interactions and test data setup. |
This project is powered by BrowserStack, enabling high-scale cross-browser and mobile testing on real devices in the cloud.
git clone https://github.com/nirtal85/Playwright-Python-Example
cd playwright-pythonWe use uv for lightning-fast installations.
Windows (PowerShell):
python -m pip install uv
python -m uv venv
.venv\Scripts\Activate.ps1
uv sync --all-extras --dev
playwright installMac/Linux:
python3 -m pip install uv
uv venv
source .venv/bin/activate
uv sync --all-extras --dev
playwright installRun all tests (Chromium by default):
pytestRun specific suite (Tags):
pytest -m sanityWe use Allure for reporting and Playwright Traces for debugging.
Viewing Reports Locally Windows (via Scoop):
scoop install allure
allure serve allure-resultsMac (via Brew):
brew install allure
allure serve allure-resultsπ See a Live Example of the Report Here
Navigate to the Playwright Trace Viewer.
Drag & Drop the trace file (located in test-results/) generated after a failure.
Time Travel: Move back and forth in the timeline to see exactly what happened (Network, DOM, Console).
Found this project useful? If this architecture helped you solve a problem or save time, consider supporting the work!