How hhhameem/selenium-testng-allure-orangehrm works
1. This repository is a Java-based UI test automation project for the OrangeHRM demo site. Its primary purpose is not to ship an application, but to execute browser-based acceptance tests and publish test evidence through Allure.
2. The execution stack is centered on Selenium 4.6 + TestNG, with Allure used for reporting and Faker used to generate realistic employee data. Gradle is the build and test runner, and the checked-in build/ and allure-* folders show previously generated outputs rather than core source.
3. The source layout is split into a minimal production tree and a richer test tree. src/main/java/org/example/Main.java is effectively a placeholder, while the actual automation architecture lives under src/test/java.
4. The test code follows a Page Object Model boundary. pages/LoginPage.java, pages/PIMPage.java, and pages/EmployeePage.java encapsulate browser interactions for login, employee creation/search, and personal information management, respectively. This keeps UI locators and action logic out of the runner classes.
5. setup/Setup.java is the central test bootstrap layer. It likely owns WebDriver lifecycle, browser/session initialization, and any preconditions shared by the tests. This is the main boundary between the TestNG runners and the browser automation layer.
6. testrunners/LoginTestRunner.java, EmployeeTestRunner.java, and PIMTestRunner.java are the executable test entry points. They map to the domain flows described in the README: dashboard verification, employee creation/search, login with created credentials, profile updates, and logout.
7. Test data is externalized in src/test/resources/Users.json. That makes credentials and user-related input separate from the test logic. The use of Faker suggests that at least part of the employee data is generated dynamically during execution rather than hardcoded.
8. Test orchestration is driven by TestNG suite files in src/test/resources/suites/ (LoginSuite.xml, EmployeeSuite.xml, PIMSuite.xml, and MasterSuite.xml). These define which runners or groups execute together, so the suite XMLs are the orchestration layer above the individual test classes.
9. utils/Utils.java is a shared support layer for cross-cutting concerns such as waits, assertions, data helpers, or file operations. In architecture terms, it sits below the runners and pages but above raw Selenium calls, reducing duplication across flows.
10. The repository is report-oriented. allure-results/ contains raw execution artifacts emitted by the test runs, while allure-report/ is the rendered Allure site with summaries, trends, categories, suites, and per-test case JSON. This shows a clear pipeline: TestNG execution produces results, Allure aggregates them into a browsable report.
11. The build/ directory confirms the standard Gradle lifecycle: compiled classes, test reports, and XML results are all generated there. The presence of build/test-results and build/reports/tests indicates the project also uses Gradle’s native test reporting alongside Allure.
12. From an architecture-diagram perspective, the main external dependency boundary is the OrangeHRM demo application at https://opensource-demo.orangehrmlive.com/. Everything else is internal scaffolding around that browser session: test suites trigger runners, runners call page objects, page objects interact with the site, and results flow into Allure and Gradle reports.
Main entry points: LoginTestRunner.java Login Tests · EmployeeTestRunner.java Employee Tests · PIMTestRunner.java PIM Tests · allure-results Allure Results
Components 16
Source
Production and test source code
- Main · Minimal production entry point
src/main/java/org/example/Main.java - Login Page · Login interactions and locators
src/test/java/pages/LoginPage.java - Employee Page · Employee creation and search flows
src/test/java/pages/EmployeePage.java - PIM Page · Personal information management flows
src/test/java/pages/PIMPage.java - Users JSON · Externalized credentials and user inputs
src/test/resources/Users.json
Orchestration
Suites and runners that drive execution
- Login Tests · Dashboard and login verification flow
src/test/java/testrunners/LoginTestRunner.java - Employee Tests · Employee creation and search flow
src/test/java/testrunners/EmployeeTestRunner.java - PIM Tests · Profile update and logout flow
src/test/java/testrunners/PIMTestRunner.java - Suite XMLs · TestNG orchestration layer
src/test/resources/suites
Support
Shared test bootstrap and utilities
Reporting
Execution artifacts and rendered reports
- Allure Results · Execution artifacts emitted by test runs
allure-results - Allure Report · Browsable aggregated test report
allure-report
Build
Gradle build outputs and configuration
- Gradle · Build and test runner configuration
build.gradle - Build Output · Compiled classes and native test reports
build
External
System under test
- OrangeHRM · Demo site exercised by Selenium tests
Connections 26
- Gradle → Suite XMLs: runs · Gradle invokes the TestNG suites
- Suite XMLs → Login Tests: includes · Login suite selects login runner
- Suite XMLs → Employee Tests: includes · Employee suite selects employee runner
- Suite XMLs → PIM Tests: includes · PIM suite selects PIM runner
- Login Tests → Setup: bootstraps · Runner depends on shared browser/session setup
- Employee Tests → Setup: bootstraps · Runner depends on shared browser/session setup
- PIM Tests → Setup: bootstraps · Runner depends on shared browser/session setup
- Login Tests → Login Page: uses · Login flow drives page object actions
- Employee Tests → Employee Page: uses · Employee flow drives page object actions
- PIM Tests → PIM Page: uses · PIM flow drives page object actions
- Login Tests → Utils: shares · Common test helpers are reused by runners
- Employee Tests → Utils: shares · Common test helpers are reused by runners
- PIM Tests → Utils: shares · Common test helpers are reused by runners
- Login Page → OrangeHRM: drives · Selenium interacts with the live demo site
- Employee Page → OrangeHRM: drives · Selenium interacts with the live demo site
- PIM Page → OrangeHRM: drives · Selenium interacts with the live demo site
- Users JSON → Login Tests: feeds · Externalized test credentials and inputs
- Users JSON → Employee Tests: feeds · Externalized test credentials and inputs
- Users JSON → PIM Tests: feeds · Externalized test credentials and inputs
- Login Tests → Allure Results: emits · Test execution writes Allure result artifacts
- Employee Tests → Allure Results: emits · Test execution writes Allure result artifacts
- PIM Tests → Allure Results: emits · Test execution writes Allure result artifacts
- Allure Results → Allure Report: aggregates · Allure renders browsable report from raw results
- Gradle → Build Output: produces · Gradle compiles classes and native test reports
- Allure Results → Build Output: mirrors · Build also captures test result output
- Main → Gradle: placeholder · Production tree is a minimal stub