An end-to-end automated testing framework built with Python, Playwright, Pytest, Requests, and SQLite, integrated with Postman and GitHub Actions for CI/CD continuous regression testing.
- Web UI Functional & Regression Testing:
- Implemented the Page Object Model (POM) pattern for clean separation of test scripts and UI locators.
- Automated positive and negative workflows for authentication, catalog navigation, sorting, cart interactions, and multi-step checkout.
- Parameterized negative test scenarios to validate field boundary conditions and error messaging.
- REST API Testing & Response Validation:
- Reusable HTTP client wrapping
requests.Sessionfor CRUD endpoints (GET,POST,PUT,DELETE). - Status code assertions, JSON schema integrity checks, and negative response verification (
404 Not Found). - Pre-configured Postman Collection & Environment files included with JavaScript test scripts.
- Reusable HTTP client wrapping
- Backend Data & SQL Validation:
- Direct database layer validation using SQL queries.
- Verification of data persistence, state transitions (
PENDING→DELIVERED), and SQL aggregations (COUNT,SUM).
- CI/CD Integration:
- Automated headless execution on every
git pushand pull request using GitHub Actions. - Automatic generation and publishing of HTML test reports and failure screenshots as pipeline artifacts.
- Automated headless execution on every
playwright-python-automation/
├── .github/
│ └── workflows/
│ └── regression-tests.yml # GitHub Actions CI/CD Pipeline
├── config/
│ └── config.py # Centralized configuration (URLs, users, timeouts)
├── pages/ # Page Object Model (POM)
│ ├── base_page.py # Reusable web interactions & screenshot helpers
│ ├── login_page.py # Login locators and actions
│ ├── inventory_page.py # Catalog items, sorting, and cart actions
│ ├── cart_page.py # Shopping cart page actions
│ └── checkout_page.py # Multi-step checkout forms & confirmations
├── tests/
│ ├── conftest.py # Pytest fixtures (DB, API, Page, failure hooks)
│ ├── test_ui_login.py # Positive & negative login scenarios
│ ├── test_ui_navigation.py # Catalog sorting & sidebar navigation
│ ├── test_ui_checkout_flow.py # End-to-end cart & checkout flow
│ ├── test_api_rest.py # REST API CRUD and response validation
│ └── test_database_validation.py # SQL query backend validation
├── postman/
│ ├── Web_Automation_API_Collection.postman_collection.json
│ └── Web_Automation_Environment.postman_environment.json
├── utils/
│ ├── api_client.py # Session-based REST API wrapper
│ └── db_helper.py # SQLite query executor & seed helper
├── pytest.ini # Pytest configuration & markers
├── requirements.txt # Project dependencies
└── README.md # Documentation
- Python 3.10+ installed
- Git installed
# Clone the repository
git clone <your-repo-url>
cd playwright-python-automation
# Create and activate virtual environment
python -m venv venv
# Windows (Command Prompt / PowerShell):
venv\Scripts\activate
# macOS / Linux:
source venv/bin/activatepip install -r requirements.txt
playwright install chromiumpytestpytest --html=reports/report.html --self-contained-html# UI tests only
pytest -m ui
# API tests only
pytest -m api
# Database verification tests only
pytest -m db
# Smoke tests (fast sanity check)
pytest -m smoke
# Full regression suite
pytest -m regressionpytest -m ui --headed --slowmo 500The postman/ directory contains an exportable test suite:
- Open Postman.
- Click Import and select:
postman/Web_Automation_API_Collection.postman_collection.jsonpostman/Web_Automation_Environment.postman_environment.json
- Select the
Web Automation Environmentfrom the environment dropdown. - Click Run collection to execute all requests and view assertion results.
The workflow file .github/workflows/regression-tests.yml automatically executes on push to main or pull requests:
- Provisions an Ubuntu container with Python 3.10.
- Installs dependencies and headless Chromium.
- Executes the full test suite (
pytest -v --html=reports/report.html --self-contained-html). - Uploads the HTML report as an artifact accessible from the GitHub Actions dashboard.
- Captures and uploads failure screenshots if any UI test encounters an issue.
- Built an end-to-end web application test automation framework using Playwright, Python, and Pytest following the Page Object Model (POM).
- Automated functional and regression scenarios covering authentication, navigation, product sorting, cart operations, and checkout workflows.
- Implemented REST API and SQL database validation to verify API responses, data persistence, and backend state transitions.
- Integrated automated regression testing with GitHub Actions, including HTML reports and failure screenshots.
-
Page Object Model (POM)
-
Reusable Pytest fixtures
-
Positive and negative test scenarios
-
API response validation
-
SQL backend validation
-
Test parameterization
-
CI/CD automation
-
Failure screenshot capture
This project is licensed under the MIT License. See the LICENSE file for details.