# hhhameem/selenium-testng-allure-orangehrm architecture

> Architecture diagram of the GitHub repository hhhameem/selenium-testng-allure-orangehrm, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-06-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hhhameem/selenium-testng-allure-orangehrm
- Repository: https://github.com/hhhameem/selenium-testng-allure-orangehrm

## Overview

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: [`src/test/java/testrunners/LoginTestRunner.java`](https://github.com/hhhameem/selenium-testng-allure-orangehrm/blob/main/src/test/java/testrunners/LoginTestRunner.java) (Login Tests), [`src/test/java/testrunners/EmployeeTestRunner.java`](https://github.com/hhhameem/selenium-testng-allure-orangehrm/blob/main/src/test/java/testrunners/EmployeeTestRunner.java) (Employee Tests), [`src/test/java/testrunners/PIMTestRunner.java`](https://github.com/hhhameem/selenium-testng-allure-orangehrm/blob/main/src/test/java/testrunners/PIMTestRunner.java) (PIM Tests), [`allure-results`](https://github.com/hhhameem/selenium-testng-allure-orangehrm/tree/main/allure-results) (Allure Results)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_source["Source"]
  node_main["Main<br/>placeholder<br/>[Main.java]"]
  node_login_page["Login Page<br/>page object<br/>[LoginPage.java]"]
  node_employee_page["Employee Page<br/>page object<br/>[EmployeePage.java]"]
  node_pim_page["PIM Page<br/>page object<br/>[PIMPage.java]"]
  node_users_json["Users JSON<br/>test data<br/>[Users.json]"]
end

subgraph group_orchestration["Orchestration"]
  node_login_runner["Login Tests<br/>test runner"]
  node_employee_runner["Employee Tests<br/>test runner"]
  node_pim_runner["PIM Tests<br/>test runner<br/>[PIMTestRunner.java]"]
  node_suites["Suite XMLs<br/>testng suites"]
end

subgraph group_support["Support"]
  node_setup["Setup<br/>bootstrap<br/>[Setup.java]"]
  node_utils["Utils<br/>shared helpers<br/>[Utils.java]"]
end

subgraph group_reporting["Reporting"]
  node_allure_results[("Allure Results<br/>raw report data")]
  node_allure_report[("Allure Report<br/>rendered report")]
end

subgraph group_build["Build"]
  node_gradle["Gradle<br/>build tool<br/>[build.gradle]"]
  node_build_out[("Build Output<br/>gradle artifacts")]
end

subgraph group_external["External"]
  node_orangehrm(("OrangeHRM<br/>browser target"))
end

node_gradle -->|"runs"| node_suites
node_suites -->|"includes"| node_login_runner
node_suites -->|"includes"| node_employee_runner
node_suites -->|"includes"| node_pim_runner
node_login_runner -->|"bootstraps"| node_setup
node_employee_runner -->|"bootstraps"| node_setup
node_pim_runner -->|"bootstraps"| node_setup
node_login_runner -->|"uses"| node_login_page
node_employee_runner -->|"uses"| node_employee_page
node_pim_runner -->|"uses"| node_pim_page
node_login_runner -->|"shares"| node_utils
node_employee_runner -->|"shares"| node_utils
node_pim_runner -->|"shares"| node_utils
node_login_page -->|"drives"| node_orangehrm
node_employee_page -->|"drives"| node_orangehrm
node_pim_page -->|"drives"| node_orangehrm
node_users_json -->|"feeds"| node_login_runner
node_users_json -->|"feeds"| node_employee_runner
node_users_json -->|"feeds"| node_pim_runner
node_login_runner -->|"emits"| node_allure_results
node_employee_runner -->|"emits"| node_allure_results
node_pim_runner -->|"emits"| node_allure_results
node_allure_results -->|"aggregates"| node_allure_report
node_gradle -->|"produces"| node_build_out
node_allure_results -.->|"mirrors"| node_build_out
node_main -.->|"placeholder"| node_gradle

click node_main "https://github.com/hhhameem/selenium-testng-allure-orangehrm/blob/main/src/main/java/org/example/Main.java"
click node_setup "https://github.com/hhhameem/selenium-testng-allure-orangehrm/blob/main/src/test/java/setup/Setup.java"
click node_utils "https://github.com/hhhameem/selenium-testng-allure-orangehrm/blob/main/src/test/java/utils/Utils.java"
click node_login_page "https://github.com/hhhameem/selenium-testng-allure-orangehrm/blob/main/src/test/java/pages/LoginPage.java"
click node_employee_page "https://github.com/hhhameem/selenium-testng-allure-orangehrm/blob/main/src/test/java/pages/EmployeePage.java"
click node_pim_page "https://github.com/hhhameem/selenium-testng-allure-orangehrm/blob/main/src/test/java/pages/PIMPage.java"
click node_login_runner "https://github.com/hhhameem/selenium-testng-allure-orangehrm/blob/main/src/test/java/testrunners/LoginTestRunner.java"
click node_employee_runner "https://github.com/hhhameem/selenium-testng-allure-orangehrm/blob/main/src/test/java/testrunners/EmployeeTestRunner.java"
click node_pim_runner "https://github.com/hhhameem/selenium-testng-allure-orangehrm/blob/main/src/test/java/testrunners/PIMTestRunner.java"
click node_suites "https://github.com/hhhameem/selenium-testng-allure-orangehrm/tree/main/src/test/resources/suites"
click node_users_json "https://github.com/hhhameem/selenium-testng-allure-orangehrm/blob/main/src/test/resources/Users.json"
click node_gradle "https://github.com/hhhameem/selenium-testng-allure-orangehrm/blob/main/build.gradle"
click node_build_out "https://github.com/hhhameem/selenium-testng-allure-orangehrm/tree/main/build"
click node_allure_results "https://github.com/hhhameem/selenium-testng-allure-orangehrm/tree/main/allure-results"
click node_allure_report "https://github.com/hhhameem/selenium-testng-allure-orangehrm/tree/main/allure-report"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_login_page,node_employee_page,node_pim_page,node_users_json toneBlue
class node_login_runner,node_employee_runner,node_pim_runner,node_suites toneAmber
class node_setup,node_utils toneMint
class node_allure_results,node_allure_report toneRose
class node_gradle,node_build_out toneIndigo
class node_orangehrm toneTeal
```

## Components

### Source

Production and test source code

- [Main](https://github.com/hhhameem/selenium-testng-allure-orangehrm/blob/main/src/main/java/org/example/Main.java): placeholder · Minimal production entry point · `src/main/java/org/example/Main.java`
- [Login Page](https://github.com/hhhameem/selenium-testng-allure-orangehrm/blob/main/src/test/java/pages/LoginPage.java): page object · Login interactions and locators · `src/test/java/pages/LoginPage.java`
- [Employee Page](https://github.com/hhhameem/selenium-testng-allure-orangehrm/blob/main/src/test/java/pages/EmployeePage.java): page object · Employee creation and search flows · `src/test/java/pages/EmployeePage.java`
- [PIM Page](https://github.com/hhhameem/selenium-testng-allure-orangehrm/blob/main/src/test/java/pages/PIMPage.java): page object · Personal information management flows · `src/test/java/pages/PIMPage.java`
- [Users JSON](https://github.com/hhhameem/selenium-testng-allure-orangehrm/blob/main/src/test/resources/Users.json): test data · Externalized credentials and user inputs · `src/test/resources/Users.json`

### Orchestration

Suites and runners that drive execution

- [Login Tests](https://github.com/hhhameem/selenium-testng-allure-orangehrm/blob/main/src/test/java/testrunners/LoginTestRunner.java): test runner · Dashboard and login verification flow · `src/test/java/testrunners/LoginTestRunner.java`
- [Employee Tests](https://github.com/hhhameem/selenium-testng-allure-orangehrm/blob/main/src/test/java/testrunners/EmployeeTestRunner.java): test runner · Employee creation and search flow · `src/test/java/testrunners/EmployeeTestRunner.java`
- [PIM Tests](https://github.com/hhhameem/selenium-testng-allure-orangehrm/blob/main/src/test/java/testrunners/PIMTestRunner.java): test runner · Profile update and logout flow · `src/test/java/testrunners/PIMTestRunner.java`
- [Suite XMLs](https://github.com/hhhameem/selenium-testng-allure-orangehrm/tree/main/src/test/resources/suites): testng suites · TestNG orchestration layer · `src/test/resources/suites`

### Support

Shared test bootstrap and utilities

- [Setup](https://github.com/hhhameem/selenium-testng-allure-orangehrm/blob/main/src/test/java/setup/Setup.java): bootstrap · WebDriver and session lifecycle boundary · `src/test/java/setup/Setup.java`
- [Utils](https://github.com/hhhameem/selenium-testng-allure-orangehrm/blob/main/src/test/java/utils/Utils.java): shared helpers · Cross-cutting test support · `src/test/java/utils/Utils.java`

### Reporting

Execution artifacts and rendered reports

- [Allure Results](https://github.com/hhhameem/selenium-testng-allure-orangehrm/tree/main/allure-results): raw report data · Execution artifacts emitted by test runs · `allure-results`
- [Allure Report](https://github.com/hhhameem/selenium-testng-allure-orangehrm/tree/main/allure-report): rendered report · Browsable aggregated test report · `allure-report`

### Build

Gradle build outputs and configuration

- [Gradle](https://github.com/hhhameem/selenium-testng-allure-orangehrm/blob/main/build.gradle): build tool · Build and test runner configuration · `build.gradle`
- [Build Output](https://github.com/hhhameem/selenium-testng-allure-orangehrm/tree/main/build): gradle artifacts · Compiled classes and native test reports · `build`

### External

System under test

- **OrangeHRM**: browser target · Demo site exercised by Selenium tests

## Connections

- 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
