This repository contains a scalable and maintainable test automation framework built using Playwright, Pytest, and Pydantic, designed to test both UI and API layers of AutomationExercise.com.
✅ End-to-end UI test automation using Playwright
✅ REST API test automation using httpx
✅ Modular Page Object Model (POM) structure
✅ Reusable and abstracted UI components (input, dropdown, button, etc.)
✅ Dynamic test data generation using Faker
✅ Data validation using Pydantic models
✅ Pre-commit hooks for linting, formatting, and type checks
✅ Scalable test fixtures via conftest.py
Playwright_Python_Pytest_Framework/
│
├── tests/
│ ├── ui_tests/ # All UI test cases
│ ├── api_tests/ # All API test cases
│ └── helpers/ # Auth and common test helpers
│
├── web_abstractions/
│ ├── components/
│ │ ├── basic_components/ # Reusable UI components
│ │ └── composite_components/# Composite components (e.g., SignupForm)
│ └── views/ # Page Object Model for views
│
├── models/ # Pydantic models for API requests/responses
│
├── data/ # Static or test data (e.g., test files)
│
├── conftest.py # Global fixtures (browser, test data, API client)
├── requirements.txt # Project dependencies
├── pytest.ini # Pytest config
├── .pre-commit-config.yaml # Pre-commit hooks
└── README.md # This file
git clone https://github.com/your-org/Playwright_Python_Pytest_Framework.git
cd Playwright_Python_Pytest_Framework
python -m venv venv
source venv/bin/activate # or .\venv\Scripts\activate on Windows
pip install -r requirements.txt
playwright installpytest tests/ui_tests/ --headedpytest tests/api_tests/pytest tests/ui_tests/test_signup_login.py::test_register_userpre-commit run --all-files- Integrate Allure Reporting
- Add support for mobile device emulation
- CI Integration (GitHub Actions/GitLab CI)
This project is licensed under the MIT License. See the LICENSE file for details.