A test automation project using Playwright (Python) and pytest, covering UI automation with the Page Object Model, data-driven testing, and API testing.
Target application: OrangeHRM Demo (public sandbox) API target: reqres.in (public test API)
| Area | File(s) | What it demonstrates |
|---|---|---|
| Page Object Model | pages/orangehrm_login.py, pages/orangehrm_home.py |
Locators and actions separated from test logic |
| UI test with real assertions | tests/test_orangehrm.py |
Login flow + navigation, verified with expect() assertions (not just clicks) |
| Data-driven testing | tests/test_data_driven.py |
Same test run against multiple credential sets loaded from CSV and JSON |
| API testing | tests/api/test_api.py |
GET request validation, including a negative (404) test case |
| Test config | pytest.ini |
Headed mode, HTML report generation, slow-motion for debugging |
python -m venv venv
venv\Scripts\activate # Windows
pip install -r requirements.txt
playwright installpytestThis runs all tests in tests/, in headed Chromium, and generates an HTML report at reports/report.html
(open it in a browser after the run).
Run a single file:
pytest tests/test_orangehrm.pyRun only the API tests:
pytest tests/api/playwright_demo1/
├── pages/ # Page Object Model classes
├── tests/ # UI tests
│ └── api/ # API tests
├── test_data/ # CSV/JSON data used for data-driven tests
├── pytest.ini # pytest configuration
└── requirements.txt
- UI tests run against a public demo instance, so test data (username/password) is not sensitive.
- The
reports/folder is generated on each run and is git-ignored.