# beeminetid/selenium-java-automation-framework architecture

> Architecture diagram of the GitHub repository beeminetid/selenium-java-automation-framework, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/beeminetid/selenium-java-automation-framework
- Repository: https://github.com/beeminetid/selenium-java-automation-framework

## Overview

#### Purpose and execution model
This is a Java 17/Maven hybrid automation framework for live e-commerce UI and REST API validation. It targets automationexercise.com, with Selenium-specific capability tests against the-internet.herokuapp.com. Maven profiles and TestNG suite XML select API, UI, BDD, health, hybrid E2E, unit, and capability runs. Primary build/CI entry points: `pom.xml`, `Jenkinsfile`, `.github/workflows/regression.yml`.

#### Test orchestration boundary
Two test styles share framework services:
- Cucumber scenarios enter through `src/test/java/com/qa/framework/runners/CucumberTestNGRunner.java`, bind feature steps in `src/test/java/com/qa/framework/steps`, and own browser lifecycle through `src/test/java/com/qa/framework/hooks/Hooks.java`.
- Plain TestNG tests derive lifecycle/client setup from `src/test/java/com/qa/tests/base/BaseUiTest.java` and `src/test/java/com/qa/tests/base/BaseApiTest.java`.
- Hybrid flows combine the API account lifecycle with UI validation in `src/test/java/com/qa/tests/e2e/ApiUiHybridCheckoutTest.java`.

#### Configuration and browser runtime
`src/main/java/com/qa/framework/config/ConfigManager.java` resolves environment-aware settings, including browser, headless mode, remote Grid URL, primary-site URL, and capability-site URL. `src/main/resources/config/qa.properties` and `src/main/resources/config/staging.properties` provide environment baselines.
`src/main/java/com/qa/framework/driver/DriverFactory.java` creates local or remote Chrome/Firefox/Edge sessions and configures per-thread download directories. `src/main/java/com/qa/framework/driver/DriverManager.java` holds WebDriver instances in `ThreadLocal`, enabling TestNG/Cucumber parallel isolation.

#### UI automation layer
Page objects encapsulate site navigation, locators, and user actions: `src/main/java/com/qa/framework/pages/BasePage.java`, `src/main/java/com/qa/framework/pages/HomePage.java`, and `src/main/java/com/qa/framework/pages/CheckoutPage.java`. `BasePage` supplies shared synchronization and browser-interaction capabilities; page-specific objects model account, product, cart, checkout, payment, and engagement flows.
Specialized pages isolate non-primary-site DOM patterns: `src/main/java/com/qa/framework/pages/capabilities/IframeEditorPage.java`, `src/main/java/com/qa/framework/pages/capabilities/MultiWindowPage.java`, and `src/main/java/com/qa/framework/pages/capabilities/ShadowDomPage.java`. Critical-element maps in pages feed the state-free locator health check.

#### API automation layer
`src/main/java/com/qa/framework/api/ApiClient.java` centralizes the RestAssured request specification. Endpoint clients separate product/brand/search concerns from account lifecycle operations: `src/main/java/com/qa/framework/api/endpoints/ProductsApiClient.java` and `src/main/java/com/qa/framework/api/endpoints/AccountApiClient.java`. Typed payload/domain models—such as `src/main/java/com/qa/framework/api/models/AccountPayload.java` and `src/main/java/com/qa/framework/api/models/Product.java`—form the boundary between tests and API request/response data.

#### Data, reliability, and reporting
Test data is externalized under `src/test/resources/testdata` and supplied centrally by `src/test/java/com/qa/tests/data/DataProviders.java`; framework readers support CSV and Excel through `src/main/java/com/qa/framework/utils/CsvDataReader.java` and `src/main/java/com/qa/framework/utils/ExcelDataReader.java`. Generated account/payment data comes from `src/main/java/com/qa/framework/utils/TestDataFactory.java`.
Failure handling and observability are listener-driven: `src/main/java/com/qa/framework/listeners/RetryTransformer.java`, `src/main/java/com/qa/framework/listeners/ExtentTestListener.java`, and `src/main/java/com/qa/framework/report/ExtentManager.java` apply retries, collect suite results, and produce Extent HTML reports with failure screenshots.

#### Infrastructure and external dependencies
Maven resolves Selenium 4, TestNG, Cucumber, RestAssured/Jackson, Apache POI, Extent, Log4j2, and DataFaker. `docker-compose.yml` provisions Selenium Grid hub plus Chrome/Firefox nodes; remote sessions use the configured Grid endpoint. GitHub Actions executes separated API, health, smoke, and regression jobs, while Jenkins can parameterize suite, browser, headless mode, and Grid usage.

Main entry points: [`src/test/java/com/qa/tests/base/BaseUiTest.java`](https://github.com/beeminetid/selenium-java-automation-framework/blob/main/src/test/java/com/qa/tests/base/BaseUiTest.java) (TestNG base tests), [`src/main/java/com/qa/framework/driver/DriverFactory.java`](https://github.com/beeminetid/selenium-java-automation-framework/blob/main/src/main/java/com/qa/framework/driver/DriverFactory.java) (Driver factory), [`src/main/java/com/qa/framework/api/endpoints/AccountApiClient.java`](https://github.com/beeminetid/selenium-java-automation-framework/blob/main/src/main/java/com/qa/framework/api/endpoints/AccountApiClient.java) (Endpoint clients), [`src/main/java/com/qa/framework/pages/BasePage.java`](https://github.com/beeminetid/selenium-java-automation-framework/blob/main/src/main/java/com/qa/framework/pages/BasePage.java) (Page object layer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Test orchestration"]
  node_cucumber_runner["Cucumber TestNG runner<br/>scenario entry"]
  node_steps_hooks["Steps and hooks<br/>Cucumber binding<br/>[Hooks.java]"]
  node_testng_bases["TestNG base tests<br/>test lifecycle<br/>[BaseUiTest.java]"]
  node_hybrid_checkout["Hybrid checkout test<br/>E2E flow"]
end

subgraph group_framework["Framework services"]
  node_config["Config manager<br/>environment config<br/>[ConfigManager.java]"]
  node_env_properties["Environment baselines<br/>properties<br/>[qa.properties]"]
  node_driver_factory["Driver factory<br/>browser sessions<br/>[DriverFactory.java]"]
  node_driver_manager["Driver manager<br/>thread-local driver<br/>[DriverManager.java]"]
end

subgraph group_automation["Automation layers"]
  node_pages["Page object layer<br/>UI abstraction<br/>[BasePage.java]"]
  node_capability_pages["Capability pages<br/>specialized UI"]
  node_api_client["API client<br/>RestAssured core<br/>[ApiClient.java]"]
  node_endpoint_clients["Endpoint clients<br/>API operations"]
  node_api_models["API models<br/>typed payloads"]
end

subgraph group_quality["Data and reporting"]
  node_test_data["Test data providers<br/>data supply<br/>[DataProviders.java]"]
  node_testdata_files["Test data files<br/>test resources"]
  node_data_factory["Generated test data<br/>data factory"]
  node_reporting["Retries and Extent reports<br/>test observability"]
end

subgraph group_delivery["Build and infrastructure"]
  node_maven["Maven profiles<br/>build entry point<br/>[pom.xml]"]
  node_ci["CI pipelines<br/>automation pipeline<br/>[regression.yml]"]
  node_selenium_grid{{"Selenium Grid<br/>container infrastructure<br/>[docker-compose.yml]"}}
end

node_external_sites(("Target sites<br/>external systems"))

node_cucumber_runner -->|"executes"| node_steps_hooks
node_steps_hooks -->|"starts browser"| node_driver_factory
node_testng_bases -->|"sets up browser/client"| node_driver_factory
node_hybrid_checkout -->|"uses lifecycle"| node_testng_bases
node_hybrid_checkout -->|"creates account"| node_endpoint_clients
node_hybrid_checkout -->|"validates checkout"| node_pages
node_config -->|"loads"| node_env_properties
node_driver_factory -->|"reads settings"| node_config
node_driver_factory -->|"stores session"| node_driver_manager
node_driver_factory -.->|"remote sessions"| node_selenium_grid
node_pages -->|"uses WebDriver"| node_driver_manager
node_pages -->|"drives UI"| node_external_sites
node_capability_pages -->|"specializes"| node_pages
node_capability_pages -->|"tests capabilities"| node_external_sites
node_endpoint_clients -->|"uses"| node_api_client
node_endpoint_clients -->|"maps payloads"| node_api_models
node_endpoint_clients -->|"calls REST API"| node_external_sites
node_test_data -->|"reads"| node_testdata_files
node_testng_bases -.->|"consumes"| node_test_data
node_testng_bases -.->|"generates data"| node_data_factory
node_cucumber_runner -->|"publishes results"| node_reporting
node_testng_bases -->|"publishes results"| node_reporting
node_maven -->|"selects BDD suites"| node_cucumber_runner
node_maven -->|"selects test suites"| node_testng_bases
node_ci -->|"runs profiles"| node_maven
node_ci -.->|"can enable Grid"| node_selenium_grid

click node_cucumber_runner "https://github.com/beeminetid/selenium-java-automation-framework/blob/main/src/test/java/com/qa/framework/runners/CucumberTestNGRunner.java"
click node_steps_hooks "https://github.com/beeminetid/selenium-java-automation-framework/blob/main/src/test/java/com/qa/framework/hooks/Hooks.java"
click node_testng_bases "https://github.com/beeminetid/selenium-java-automation-framework/blob/main/src/test/java/com/qa/tests/base/BaseUiTest.java"
click node_hybrid_checkout "https://github.com/beeminetid/selenium-java-automation-framework/blob/main/src/test/java/com/qa/tests/e2e/ApiUiHybridCheckoutTest.java"
click node_config "https://github.com/beeminetid/selenium-java-automation-framework/blob/main/src/main/java/com/qa/framework/config/ConfigManager.java"
click node_env_properties "https://github.com/beeminetid/selenium-java-automation-framework/blob/main/src/main/resources/config/qa.properties"
click node_driver_factory "https://github.com/beeminetid/selenium-java-automation-framework/blob/main/src/main/java/com/qa/framework/driver/DriverFactory.java"
click node_driver_manager "https://github.com/beeminetid/selenium-java-automation-framework/blob/main/src/main/java/com/qa/framework/driver/DriverManager.java"
click node_pages "https://github.com/beeminetid/selenium-java-automation-framework/blob/main/src/main/java/com/qa/framework/pages/BasePage.java"
click node_capability_pages "https://github.com/beeminetid/selenium-java-automation-framework/blob/main/src/main/java/com/qa/framework/pages/capabilities/IframeEditorPage.java"
click node_api_client "https://github.com/beeminetid/selenium-java-automation-framework/blob/main/src/main/java/com/qa/framework/api/ApiClient.java"
click node_endpoint_clients "https://github.com/beeminetid/selenium-java-automation-framework/blob/main/src/main/java/com/qa/framework/api/endpoints/AccountApiClient.java"
click node_api_models "https://github.com/beeminetid/selenium-java-automation-framework/blob/main/src/main/java/com/qa/framework/api/models/AccountPayload.java"
click node_test_data "https://github.com/beeminetid/selenium-java-automation-framework/blob/main/src/test/java/com/qa/tests/data/DataProviders.java"
click node_testdata_files "https://github.com/beeminetid/selenium-java-automation-framework/tree/main/src/test/resources/testdata"
click node_data_factory "https://github.com/beeminetid/selenium-java-automation-framework/blob/main/src/main/java/com/qa/framework/utils/TestDataFactory.java"
click node_reporting "https://github.com/beeminetid/selenium-java-automation-framework/blob/main/src/main/java/com/qa/framework/listeners/ExtentTestListener.java"
click node_maven "https://github.com/beeminetid/selenium-java-automation-framework/blob/main/pom.xml"
click node_ci "https://github.com/beeminetid/selenium-java-automation-framework/blob/main/.github/workflows/regression.yml"
click node_selenium_grid "https://github.com/beeminetid/selenium-java-automation-framework/blob/main/docker-compose.yml"

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_cucumber_runner,node_steps_hooks,node_testng_bases,node_hybrid_checkout toneBlue
class node_config,node_env_properties,node_driver_factory,node_driver_manager toneAmber
class node_pages,node_capability_pages,node_api_client,node_endpoint_clients,node_api_models toneMint
class node_test_data,node_testdata_files,node_data_factory,node_reporting toneRose
class node_maven,node_ci,node_selenium_grid toneIndigo
class node_external_sites toneNeutral
```

## Components

### Test orchestration

- [Cucumber TestNG runner](https://github.com/beeminetid/selenium-java-automation-framework/blob/main/src/test/java/com/qa/framework/runners/CucumberTestNGRunner.java): scenario entry · `src/test/java/com/qa/framework/runners/CucumberTestNGRunner.java`
- [Steps and hooks](https://github.com/beeminetid/selenium-java-automation-framework/blob/main/src/test/java/com/qa/framework/hooks/Hooks.java): Cucumber binding · Binds features and owns browser lifecycle. · `src/test/java/com/qa/framework/hooks/Hooks.java`
- [TestNG base tests](https://github.com/beeminetid/selenium-java-automation-framework/blob/main/src/test/java/com/qa/tests/base/BaseUiTest.java): test lifecycle · Shared UI and API setup for plain TestNG tests. · `src/test/java/com/qa/tests/base/BaseUiTest.java`
- [Hybrid checkout test](https://github.com/beeminetid/selenium-java-automation-framework/blob/main/src/test/java/com/qa/tests/e2e/ApiUiHybridCheckoutTest.java): E2E flow · Combines API account lifecycle with UI checkout validation. · `src/test/java/com/qa/tests/e2e/ApiUiHybridCheckoutTest.java`

### Framework services

- [Config manager](https://github.com/beeminetid/selenium-java-automation-framework/blob/main/src/main/java/com/qa/framework/config/ConfigManager.java): environment config · Resolves browser, URLs, headless mode, and Grid endpoint. · `src/main/java/com/qa/framework/config/ConfigManager.java`
- [Environment baselines](https://github.com/beeminetid/selenium-java-automation-framework/blob/main/src/main/resources/config/qa.properties): properties · `src/main/resources/config/qa.properties`
- [Driver factory](https://github.com/beeminetid/selenium-java-automation-framework/blob/main/src/main/java/com/qa/framework/driver/DriverFactory.java): browser sessions · Creates local or Grid browser sessions and download directories. · `src/main/java/com/qa/framework/driver/DriverFactory.java`
- [Driver manager](https://github.com/beeminetid/selenium-java-automation-framework/blob/main/src/main/java/com/qa/framework/driver/DriverManager.java): thread-local driver · Isolates WebDriver instances for parallel TestNG and Cucumber runs. · `src/main/java/com/qa/framework/driver/DriverManager.java`

### Automation layers

- [Page object layer](https://github.com/beeminetid/selenium-java-automation-framework/blob/main/src/main/java/com/qa/framework/pages/BasePage.java): UI abstraction · Shared synchronization plus primary-site navigation and checkout flows. · `src/main/java/com/qa/framework/pages/BasePage.java`
- [Capability pages](https://github.com/beeminetid/selenium-java-automation-framework/blob/main/src/main/java/com/qa/framework/pages/capabilities/IframeEditorPage.java): specialized UI · Encapsulates iframe, multi-window, and Shadow DOM patterns. · `src/main/java/com/qa/framework/pages/capabilities/IframeEditorPage.java`
- [API client](https://github.com/beeminetid/selenium-java-automation-framework/blob/main/src/main/java/com/qa/framework/api/ApiClient.java): RestAssured core · Central request specification for API automation. · `src/main/java/com/qa/framework/api/ApiClient.java`
- [Endpoint clients](https://github.com/beeminetid/selenium-java-automation-framework/blob/main/src/main/java/com/qa/framework/api/endpoints/AccountApiClient.java): API operations · Separates catalog/search from account lifecycle operations. · `src/main/java/com/qa/framework/api/endpoints/AccountApiClient.java`
- [API models](https://github.com/beeminetid/selenium-java-automation-framework/blob/main/src/main/java/com/qa/framework/api/models/AccountPayload.java): typed payloads · `src/main/java/com/qa/framework/api/models/AccountPayload.java`

### Data and reporting

- [Test data providers](https://github.com/beeminetid/selenium-java-automation-framework/blob/main/src/test/java/com/qa/tests/data/DataProviders.java): data supply · Supplies externalized CSV and Excel test data. · `src/test/java/com/qa/tests/data/DataProviders.java`
- [Test data files](https://github.com/beeminetid/selenium-java-automation-framework/tree/main/src/test/resources/testdata): test resources · `src/test/resources/testdata`
- [Generated test data](https://github.com/beeminetid/selenium-java-automation-framework/blob/main/src/main/java/com/qa/framework/utils/TestDataFactory.java): data factory · Generates account and payment data. · `src/main/java/com/qa/framework/utils/TestDataFactory.java`
- [Retries and Extent reports](https://github.com/beeminetid/selenium-java-automation-framework/blob/main/src/main/java/com/qa/framework/listeners/ExtentTestListener.java): test observability · Retries failures and emits HTML reports with screenshots. · `src/main/java/com/qa/framework/listeners/ExtentTestListener.java`

### Build and infrastructure

- [Maven profiles](https://github.com/beeminetid/selenium-java-automation-framework/blob/main/pom.xml): build entry point · Selects API, UI, BDD, health, hybrid, unit, and capability suites. · `pom.xml`
- [CI pipelines](https://github.com/beeminetid/selenium-java-automation-framework/blob/main/.github/workflows/regression.yml): automation pipeline · GitHub runs separated jobs; Jenkins parameterizes suite and browser execution. · `.github/workflows/regression.yml`
- [Selenium Grid](https://github.com/beeminetid/selenium-java-automation-framework/blob/main/docker-compose.yml): container infrastructure · Hub with Chrome and Firefox nodes for remote sessions. · `docker-compose.yml`

### Other components

- **Target sites**: external systems · Automation Exercise is primary; the-internet hosts capability tests.

## Connections

- Cucumber TestNG runner → Steps and hooks: executes
- Steps and hooks → Driver factory: starts browser
- TestNG base tests → Driver factory: sets up browser/client
- Hybrid checkout test → TestNG base tests: uses lifecycle
- Hybrid checkout test → Endpoint clients: creates account
- Hybrid checkout test → Page object layer: validates checkout
- Config manager → Environment baselines: loads
- Driver factory → Config manager: reads settings
- Driver factory → Driver manager: stores session
- Driver factory → Selenium Grid: remote sessions
- Page object layer → Driver manager: uses WebDriver
- Page object layer → Target sites: drives UI
- Capability pages → Page object layer: specializes
- Capability pages → Target sites: tests capabilities
- Endpoint clients → API client: uses
- Endpoint clients → API models: maps payloads
- Endpoint clients → Target sites: calls REST API
- Test data providers → Test data files: reads
- TestNG base tests → Test data providers: consumes
- TestNG base tests → Generated test data: generates data
- Cucumber TestNG runner → Retries and Extent reports: publishes results
- TestNG base tests → Retries and Extent reports: publishes results
- Maven profiles → Cucumber TestNG runner: selects BDD suites
- Maven profiles → TestNG base tests: selects test suites
- CI pipelines → Maven profiles: runs profiles
- CI pipelines → Selenium Grid: can enable Grid
