Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tests

Playwright + Pytest Test Automation Demo

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)

What's covered

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

Setup

python -m venv venv
venv\Scripts\activate        # Windows
pip install -r requirements.txt
playwright install

Running the tests

pytest

This 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.py

Run only the API tests:

pytest tests/api/

Project structure

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

Notes

  • 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.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages