A production-grade Test Automation Framework built with Playwright (Python), Pytest-BDD, Page Object Model, and integrated CI/CD pipeline. Designed to mirror enterprise-level automation used in real banking/fintech projects.
playwright-python-bdd-framework/
├── .github/
│ └── workflows/
│ └── ci.yml # GitHub Actions CI/CD pipeline
├── features/
│ └── login.feature # BDD feature files (Gherkin)
├── pages/
│ ├── base_page.py # Base Page Object (reusable actions)
│ └── login_page.py # Login Page Object
├── steps/
│ └── test_login_steps.py # BDD step definitions
├── conftest.py # Pytest fixtures & browser setup
├── requirements.txt # Python dependencies
└── README.md
- BDD with Gherkin — Human-readable test scenarios using
pytest-bdd - Page Object Model — Reusable, maintainable page components
- Playwright — Fast, reliable cross-browser automation (Chromium/Firefox/WebKit)
- CI/CD Pipeline — Automated test runs on every push via GitHub Actions
- Allure Reports — Rich test reporting with screenshots on failure
- Tagged Scenarios — Run targeted suites:
@smoke,@regression,@login
| Tool | Version | Purpose |
|---|---|---|
| Python | 3.11+ | Core language |
| Playwright | 1.42+ | Browser automation |
| pytest-bdd | 7.x | BDD test framework |
| pytest | 8.x | Test runner |
| Allure | 2.x | Test reporting |
| GitHub Actions | — | CI/CD pipeline |
python --version # Python 3.11+# Clone the repository
git clone https://github.com/rajTestAutomationNL/playwright-python-bdd-framework.git
cd playwright-python-bdd-framework
# Create virtual environment
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Install Playwright browsers
playwright install chromium# Run all BDD tests
pytest steps/ -v
# Run only smoke tests
pytest steps/ -v -m smoke
# Run with Allure reporting
pytest steps/ -v --alluredir=allure-results
allure serve allure-results
# Run headless (CI mode)
pytest steps/ -v --headed=false@login @smoke
Feature: Login Functionality
As a registered user of OrangeHRM
I want to log into the application
So that I can access the HR dashboard
Scenario: Successful login with valid credentials
Given I am on the OrangeHRM login page
When I enter username "Admin" and password "admin123"
And I click the login button
Then I should be redirected to the dashboardThe GitHub Actions workflow (.github/workflows/ci.yml) automatically:
- Sets up Python 3.11 on Ubuntu
- Installs all dependencies
- Installs Playwright Chromium browser
- Runs the full BDD test suite
- Uploads Allure test results as artifacts
- Uploads screenshots on test failure
Triggers on: push to main/develop and pull requests.
Raj | Senior Test Automation Engineer
- 14+ years in software testing & QA
- Expertise: Playwright, Selenium, Java, Python, CI/CD, BDD
- Based in the Netherlands
MIT License — free to use and adapt.