How oktaliem/orangehrmtestngallure works
Project Type and Purpose
• This is an automated test framework (not a user-facing application).
• It uses TestNG for orchestration, a Page Object Model (POM) for browser interactions, Allure for reporting, and integrates with SonarQube & Jenkins for CI/CD.
Main Logical Components
A. Test Runner & CI/CD
– TestNG engine (mvn clean test invoking TestNG.xml)
– Jenkins pipeline (checkout → test → report → quality gate)
– Docker hosts for SonarQube and (optionally) OrangeHRM under test
B. Test Framework Core
– Feature layer (src/test/java/features)
– Page Objects (src/test/java/pages/…)
– Utility classes (Log, Listeners, CreateRandomName)
– WebDriver factory (MyDrivers)
– Test Data Models (TestDataModel*.java)
C. External Services & Tools
– Selenium WebDriver drivers (chromedriver, geckodriver, IEDriver, etc.)
– ImageMagick, AShot, Selenium-Shutterbug (visual regression)
– OrangeHRM SUT (local or Docker container)
– Allure reporting engine (allure-results → allure-report)
– SonarQube (code quality)
Relationships & Data Flows
1. The CI server (Jenkins) checks out code from Git.
2. Jenkins invokes Maven → TestNG.xml → TestNG test suite.
3. TestNG tests call into Feature classes, which use Page Objects.
4. Page Objects call MyDrivers to spin up a browser session against the OrangeHRM SUT.
5. On each test step, Log and TestListener capture screenshots/videos and emit events to Allure results.
6. Visual-regression utilities snapshot pages via ImageMagick/AShot.
7. TestNG + Allure plugin aggregate results → allure-results folder → Allure CLI generates HTML.
8. After tests finish, Jenkins invokes SonarQube analysis on the same codebase.
Architectural Patterns & Principles
• Page Object Model (POM) separates page-specific locators & actions.
• TestNG’s Listener pattern captures test lifecycle events.
• Utility classes isolate crosscutting concerns (logging, URL management, random data).
• Maven standard directory layout for clear separation of production (framework) vs. test code.
• Externalizing WebDriver binaries in src/main/resources/drivers for OS portability.
Final Checklist
[ ] Group related classes/directories under the appropriate layer
[ ] Note external dependencies (Selenium, Allure, SonarQube, Docker)