This repository contains a Selenium + pytest suite for the OrangeHRM demo application.
orangehrm/- project-specific helpers and page objectspages/- page object classes for UI flowscomponents/- reusable UI components
tests/- pytest test modules and fixturesconftest.py- shared browser and page fixtures
pytest.ini- pytest configurationrequirements.txt- Python dependencies
A src/ layout is most useful when you are packaging a reusable Python library. For a Selenium test project, keeping the test code and page objects at the repository root is simpler and more idiomatic, especially because pytest can run directly from the repo.
This suite expects the OrangeHRM demo application to be running locally before tests are executed.
The repository includes a Docker Compose setup for the required services:
- MySQL 8.4
- OrangeHRM latest image
The compose file now creates the database and wires the OrangeHRM container to it automatically using the same environment values stored in the project .env file.
Start them with:
docker compose up -dIf you only want the database container, you can still use the MySQL service from the same file.
The CI workflow should start the same compose stack and then run pytest. No manual MySQL setup is required in the runner because the mysql service creates the database, user, and password for the orangehrm service automatically.
Activate the virtual environment and run:
.venv\Scripts\activate
pytest- The suite expects ChromeDriver to be available either on the PATH or in the repository root.
- Fixtures are defined in
tests/conftest.pyfor browser setup and reusable page objects. - Page objects are designed for reuse and easier maintenance.