Playwright + JavaScript automation framework for OrangeHRM Community Edition, built with the Page Object Model. Covers Authentication, Dashboard, PIM (employee records), and Admin (user management) with 40+ automated tests running across Chromium, Firefox, and WebKit, integrated into a GitHub Actions CI pipeline.
Highlights:
- Reusable Page Object layer with zero duplicated selectors across 4 modules
- Dynamic test data generation to avoid record collisions on a live, shared public server
- Externalized JSON test data, separated from test logic
- CI/CD via GitHub Actions — full suite runs automatically on every push/PR, with HTML reports uploaded as artifacts
| Category | Tool |
|---|---|
| Automation Framework | Playwright |
| Language | JavaScript |
| Runtime | Node.js |
| Architecture | Page Object Model (POM) |
| Reporting | Playwright HTML Report |
| CI/CD | GitHub Actions |
| Configuration | dotenv |
OrangeHRM Community Edition — public demo instance:
https://opensource-demo.orangehrmlive.com
| Module | Status |
|---|---|
| Authentication (Login, Logout, Invalid Login, Empty Fields, Forgot Password) | ✅ Complete |
| Dashboard (Widgets, Quick Launch, Navigation Menu) | ✅ Complete |
| PIM (Add / Search / Delete Employee) | ✅ Complete |
| Admin (Add / Search / Delete User) | ✅ Complete |
project-root/
│
├── pages/ # Page Object classes (locators + actions)
├── tests/ # Test suites, organized by module
│ ├── authentication/
│ ├── dashboard/
│ ├── pim/
│ └── admin/
├── helpers/ # Reusable workflows (e.g. loginAsAdmin)
├── utils/ # Generic utilities (dynamic data generation)
├── test-data/ # External JSON test data
├── config/ # Environment configuration (.env loader)
├── reports/ # Generated Playwright HTML reports
├── .github/workflows/ # GitHub Actions CI pipeline
├── playwright.config.js
└── package.json
git clone https://github.com/QuantumRay-code/Playwright-OrangeHRM-Framework.git
cd <project-folder>npm install
npx playwright installCreate a .env file in the project root:
BASE_URL=https://opensource-demo.orangehrmlive.com/web/index.php/auth/login
ADMIN_USERNAME=Admin
ADMIN_PASSWORD=admin123npx playwright testRun a specific module:
npx playwright test tests/authenticationRun only smoke tests:
npx playwright test --grep @smokenpx playwright show-report reports/html-report- Static/reusable data (e.g. invalid login credentials, default user role/status) lives in
test-data/*.json, separate from test logic. - Dynamic/unique data (e.g. employee names, usernames) is generated at runtime via
utils/dataGenerator.js, using timestamps to guarantee uniqueness. This is necessary because the framework runs against a shared public demo environment where hardcoded names could collide with other users' data.
GitHub Actions automatically runs the full test suite on every push and pull request to main. The workflow:
- Installs dependencies and Playwright browsers
- Builds a
.envfile from GitHub Secrets (BASE_URL,ADMIN_USERNAME,ADMIN_PASSWORD) - Runs the full test suite across Chromium, Firefox, and WebKit
- Uploads the HTML report as a workflow artifact
See .github/workflows/playwright.yml.
Shared public demo environment. This framework tests against OrangeHRM's publicly shared demo instance, which is used simultaneously by many other people. This introduces two realistic constraints, both of which the framework is deliberately engineered to tolerate:
- Variable response times. Write-heavy operations (creating employees, creating users) occasionally take significantly longer than normal due to server load from concurrent public usage. The framework accommodates this with generous, operation-specific timeouts and a single automatic retry (
retries: 1locally,2in CI) rather than treating every slow response as a failure. - Data volatility. Records created by this framework (or by other users) can be modified or removed by others at any time. Employee/user names are generated dynamically with timestamps to minimize collisions.
Leave module — excluded. The Leave module (Apply/View/Cancel/Approve) was descoped after testing revealed that sample leave records were inconsistently modified or removed by other concurrent users of the shared demo, making reliable, repeatable assertions impractical in this environment. This is a known limitation of automating against a live, publicly shared instance rather than a dedicated test environment, and would not apply against a private/staging deployment of OrangeHRM.
Test data evolution. Early development used hardcoded test values; these were later refactored into external JSON files (see project commit history) to align with the test data strategy described above.
- OrangeHRM Leave module automation (if run against a dedicated, non-shared environment)
- API-assisted test setup
- Accessibility testing
- Visual regression testing
- Allure reporting