# lruizajax/seleautomation-07-3 architecture

> Architecture diagram of the GitHub repository lruizajax/seleautomation-07-3, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/lruizajax/seleautomation-07-3
- Repository: https://github.com/lruizajax/seleautomation-07-3

## Overview

1. **Repository purpose**
   - This is a **UI test automation** repository, not an application backend.
   - All executable code lives under `src/test/java`; `src/main` is effectively empty.
   - The system under test is the external ecommerce site **DemoWebShop Tricentis** at `demowebshop.tricentis.com`.

2. **Core architecture pattern**
   - The repo is organized around **TestNG + Selenium WebDriver + Page Object Model**.
   - Tests do not interact with the browser directly; they call page classes, which wrap locators and actions.
   - The design boundary is: **tests orchestrate flows**, **pages encapsulate UI behavior**, and **utilities handle shared concerns**.

3. **Test execution entry points**
   - Maven is the build and execution driver via `pom.xml`.
   - `testng.xml` defines the suite, class-level parallelism, and listener registration.
   - A GitHub Actions workflow exists at `.github/workflows/selenium.yml`, so CI is part of the architecture even though the exact job steps are not shown.

4. **Test layer**
   - Test classes live in `src/test/java/com/store/tests`.
   - Main implemented coverage is:
     - `HomeTest`
     - `LoginTest`
     - `RegisterTest`
   - Additional suites exist but are largely placeholders or under development:
     - `ProductTest`
     - `CartTest`
     - `CheckoutTest`
     - `SecurityTest`
   - Each test extends `BaseTest`, which centralizes browser setup and shared page instances.

5. **Page Object boundary**
   - Page objects live in `src/test/java/com/store/pages`.
   - `BasePage` provides common browser actions such as find, click, type, submit, text retrieval, and visibility checks.
   - Concrete pages currently modeled:
     - `HomePage`
     - `LoginPage`
     - `RegisterPage`
   - This layer contains the locators and UI interactions, keeping test classes thin and readable.

6. **Data flow into tests**
   - Test input comes from two main sources:
     - `src/test/resources/users.csv` for login credential data
     - `JavaFaker`-based random data for registration
   - `CsvData` reads CSV files into `Object[][]`.
   - `DataProviders` exposes TestNG data providers, especially `dpFromCsv`, to feed parameterized login tests.
   - This means the login flow is data-driven, while registration is mix of synthetic and negative test data.

7. **Validation strategies**
   - Most assertions are UI-level: visible elements, page text, success/error messages.
   - `DBValidation` adds an optional second boundary to a **MySQL database** for backend verification.
   - The README indicates this DB check is optional and depends on local MySQL configuration, so it is not the primary test path but an auxiliary validation path.

8. **Cross-cutting test concerns**
   - `TestListener` wires TestNG lifecycle events to reporting and failure diagnostics.
   - `Retry` implements retry logic for flaky tests, with a maximum of two retries.
   - `AllureUtils` attaches screenshots, page source, and text to Allure reports.
   - These concerns are centralized so the test cases themselves remain focused on business flows.

9. **Reporting and observability**
   - Allure is the main reporting layer.
   - Failures can attach:
     - screenshots on each failure
     - page source on final failure
     - attempt metadata from the retry analyzer
   - `src/test/resources/allure.properties` configures the report output behavior.

10. **Runtime and infrastructure dependencies**
   - Selenium runs against **Chrome/ChromeDriver** on the local machine or CI environment.
   - Test execution depends on Maven Surefire with an **AspectJ weaver** javaagent, which supports Allure/TestNG runtime integration.
   - The project also references logging and other test tooling in the POM, but the important architectural runtime is: **JUnit-like TestNG runner + browser driver + report instrumentation**.

11. **Parallelism and suite orchestration**
   - `testng.xml` configures suite execution in **parallel by class** with a thread count of 5.
   - This means the architecture expects tests to be reasonably isolated and the `BaseTest` setup/teardown to safely manage browser state per method.
   - Cookie cleanup and browser shutdown in `tearDown()` are key isolation boundaries.

12. **External system interactions**
   - Primary external dependency: the public ecommerce website under test.
   - Secondary optional dependency: a local MySQL instance for database validation.
   - No internal service mesh or application server exists in this repo; it is purely a client-side automation harness around external systems.

13. **Current maturity**
   - Home, login, and registration are the implemented, working flows.
   - Product, cart, checkout, and security tests are scaffolded but not yet fully implemented.
   - From an architecture-diagram perspective, this repo is best shown as a **test automation client** with a mature page-object/test-runner/reporting stack and a few optional validation and data-loading side paths.

Main entry points: [`testng.xml`](https://github.com/lruizajax/seleautomation-07-3/blob/master/testng.xml) (TestNG Suite), [`src/test/java/com/store/utils/BaseTest.java`](https://github.com/lruizajax/seleautomation-07-3/blob/master/src/test/java/com/store/utils/BaseTest.java) (Base Test), [`src/test/java/com/store/tests/LoginTest.java`](https://github.com/lruizajax/seleautomation-07-3/blob/master/src/test/java/com/store/tests/LoginTest.java) (Login Test), [`src/test/java/com/store/tests/RegisterTest.java`](https://github.com/lruizajax/seleautomation-07-3/blob/master/src/test/java/com/store/tests/RegisterTest.java) (Register Test)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_build["Build & CI"]
  node_pom["Maven POM<br/>build config<br/>[pom.xml]"]
  node_testng["TestNG Suite<br/>suite config<br/>[testng.xml]"]
  node_ci["CI Workflow<br/>github actions<br/>[selenium.yml]"]
end

subgraph group_tests["Test Flows"]
  node_home["Home Test<br/>ui test<br/>[HomeTest.java]"]
  node_login["Login Test<br/>data-driven ui test<br/>[LoginTest.java]"]
  node_register["Register Test<br/>ui test<br/>[RegisterTest.java]"]
  node_scaffold{{"Planned Tests<br/>test scaffold"}}
end

subgraph group_pages["Page Objects"]
  node_basepage["Base Page<br/>page base<br/>[BasePage.java]"]
  node_homepage["Home Page<br/>page object<br/>[HomePage.java]"]
  node_loginpage["Login Page<br/>page object<br/>[LoginPage.java]"]
  node_registerpage["Register Page<br/>page object<br/>[RegisterPage.java]"]
end

subgraph group_utils["Test Utilities"]
  node_basetest["Base Test<br/>test base<br/>[BaseTest.java]"]
  node_listener["Test Listener<br/>testng listener<br/>[TestListener.java]"]
  node_retry["Retry<br/>[Retry.java]"]
  node_allure["Allure Utils<br/>reporting helper<br/>[AllureUtils.java]"]
  node_csvdata["CSV Data<br/>data loader<br/>[CsvData.java]"]
  node_dataproviders["Data Providers<br/>test data<br/>[DataProviders.java]"]
  node_dbval[("DB Validation<br/>optional verifier<br/>[DBValidation.java]")]
end

subgraph group_external["External Systems"]
  node_demo[("DemoWebShop<br/>system under test")]
  node_mysql[("MySQL<br/>optional dependency")]
end

node_pom -->|"runs"| node_testng
node_pom -->|"drives"| node_ci
node_testng -->|"registers"| node_listener
node_testng -->|"uses"| node_retry
node_ci -->|"invokes"| node_pom
node_basetest -->|"shares"| node_homepage
node_basetest -->|"shares"| node_loginpage
node_basetest -->|"shares"| node_registerpage
node_home -->|"extends"| node_basetest
node_login -->|"extends"| node_basetest
node_register -->|"extends"| node_basetest
node_home -->|"uses"| node_homepage
node_login -->|"uses"| node_loginpage
node_register -->|"uses"| node_registerpage
node_login -->|"feeds"| node_dataproviders
node_dataproviders -->|"loads"| node_csvdata
node_register -->|"reports"| node_allure
node_listener -->|"attaches"| node_allure
node_basepage -->|"drives"| node_demo
node_dbval -->|"verifies"| node_mysql
node_scaffold -.->|"targets"| node_demo
node_basetest -->|"opens"| node_demo
node_testng -->|"includes"| node_home
node_testng -->|"includes"| node_login
node_testng -->|"includes"| node_register
node_testng -.->|"includes"| node_scaffold

click node_pom "https://github.com/lruizajax/seleautomation-07-3/blob/master/pom.xml"
click node_testng "https://github.com/lruizajax/seleautomation-07-3/blob/master/testng.xml"
click node_ci "https://github.com/lruizajax/seleautomation-07-3/blob/master/.github/workflows/selenium.yml"
click node_basetest "https://github.com/lruizajax/seleautomation-07-3/blob/master/src/test/java/com/store/utils/BaseTest.java"
click node_listener "https://github.com/lruizajax/seleautomation-07-3/blob/master/src/test/java/com/store/listeners/TestListener.java"
click node_retry "https://github.com/lruizajax/seleautomation-07-3/blob/master/src/test/java/com/store/utils/Retry.java"
click node_allure "https://github.com/lruizajax/seleautomation-07-3/blob/master/src/test/java/com/store/utils/AllureUtils.java"
click node_csvdata "https://github.com/lruizajax/seleautomation-07-3/blob/master/src/test/java/com/store/utils/CsvData.java"
click node_dataproviders "https://github.com/lruizajax/seleautomation-07-3/blob/master/src/test/java/com/store/utils/DataProviders.java"
click node_dbval "https://github.com/lruizajax/seleautomation-07-3/blob/master/src/test/java/com/store/utils/DBValidation.java"
click node_basepage "https://github.com/lruizajax/seleautomation-07-3/blob/master/src/test/java/com/store/pages/BasePage.java"
click node_homepage "https://github.com/lruizajax/seleautomation-07-3/blob/master/src/test/java/com/store/pages/HomePage.java"
click node_loginpage "https://github.com/lruizajax/seleautomation-07-3/blob/master/src/test/java/com/store/pages/LoginPage.java"
click node_registerpage "https://github.com/lruizajax/seleautomation-07-3/blob/master/src/test/java/com/store/pages/RegisterPage.java"
click node_home "https://github.com/lruizajax/seleautomation-07-3/blob/master/src/test/java/com/store/tests/HomeTest.java"
click node_login "https://github.com/lruizajax/seleautomation-07-3/blob/master/src/test/java/com/store/tests/LoginTest.java"
click node_register "https://github.com/lruizajax/seleautomation-07-3/blob/master/src/test/java/com/store/tests/RegisterTest.java"

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_pom,node_testng,node_ci toneBlue
class node_home,node_login,node_register,node_scaffold toneAmber
class node_basepage,node_homepage,node_loginpage,node_registerpage toneMint
class node_basetest,node_listener,node_retry,node_allure,node_csvdata,node_dataproviders,node_dbval toneRose
class node_demo,node_mysql toneIndigo
```

## Components

### Build & CI

Execution entry points and automation plumbing

- [Maven POM](https://github.com/lruizajax/seleautomation-07-3/blob/master/pom.xml): build config · Build and test execution definition · `pom.xml`
- [TestNG Suite](https://github.com/lruizajax/seleautomation-07-3/blob/master/testng.xml): suite config · Suite orchestration, parallelism, and listeners · `testng.xml`
- [CI Workflow](https://github.com/lruizajax/seleautomation-07-3/blob/master/.github/workflows/selenium.yml): github actions · GitHub Actions automation for running Selenium tests · `.github/workflows/selenium.yml`

### Test Flows

Test classes that orchestrate browser journeys

- [Home Test](https://github.com/lruizajax/seleautomation-07-3/blob/master/src/test/java/com/store/tests/HomeTest.java): ui test · Implemented home-flow coverage · `src/test/java/com/store/tests/HomeTest.java`
- [Login Test](https://github.com/lruizajax/seleautomation-07-3/blob/master/src/test/java/com/store/tests/LoginTest.java): data-driven ui test · Credential-based login coverage · `src/test/java/com/store/tests/LoginTest.java`
- [Register Test](https://github.com/lruizajax/seleautomation-07-3/blob/master/src/test/java/com/store/tests/RegisterTest.java): ui test · User registration coverage · `src/test/java/com/store/tests/RegisterTest.java`
- **Planned Tests**: test scaffold · Placeholder coverage for product, cart, checkout, and security flows

### Page Objects

UI abstractions over the DemoWebShop interface

- [Base Page](https://github.com/lruizajax/seleautomation-07-3/blob/master/src/test/java/com/store/pages/BasePage.java): page base · Shared browser actions and assertions for UI pages · `src/test/java/com/store/pages/BasePage.java`
- [Home Page](https://github.com/lruizajax/seleautomation-07-3/blob/master/src/test/java/com/store/pages/HomePage.java): page object · Home screen interactions and locators · `src/test/java/com/store/pages/HomePage.java`
- [Login Page](https://github.com/lruizajax/seleautomation-07-3/blob/master/src/test/java/com/store/pages/LoginPage.java): page object · Login form behavior and validations · `src/test/java/com/store/pages/LoginPage.java`
- [Register Page](https://github.com/lruizajax/seleautomation-07-3/blob/master/src/test/java/com/store/pages/RegisterPage.java): page object · Registration form behavior and validations · `src/test/java/com/store/pages/RegisterPage.java`

### Test Utilities

Shared setup, data, retry, reporting, and validation helpers

- [Base Test](https://github.com/lruizajax/seleautomation-07-3/blob/master/src/test/java/com/store/utils/BaseTest.java): test base · Central browser setup, teardown, and shared page instances · `src/test/java/com/store/utils/BaseTest.java`
- [Test Listener](https://github.com/lruizajax/seleautomation-07-3/blob/master/src/test/java/com/store/listeners/TestListener.java): testng listener · Lifecycle hooks for reporting and failure diagnostics · `src/test/java/com/store/listeners/TestListener.java`
- [Retry](https://github.com/lruizajax/seleautomation-07-3/blob/master/src/test/java/com/store/utils/Retry.java): retry policy · Flaky-test retry analyzer with limited retries · `src/test/java/com/store/utils/Retry.java`
- [Allure Utils](https://github.com/lruizajax/seleautomation-07-3/blob/master/src/test/java/com/store/utils/AllureUtils.java): reporting helper · Attaches screenshots, page source, and text artifacts · `src/test/java/com/store/utils/AllureUtils.java`
- [CSV Data](https://github.com/lruizajax/seleautomation-07-3/blob/master/src/test/java/com/store/utils/CsvData.java): data loader · Reads CSV fixtures into TestNG-friendly matrices · `src/test/java/com/store/utils/CsvData.java`
- [Data Providers](https://github.com/lruizajax/seleautomation-07-3/blob/master/src/test/java/com/store/utils/DataProviders.java): test data · TestNG data-provider bridge for parameterized flows · `src/test/java/com/store/utils/DataProviders.java`
- [DB Validation](https://github.com/lruizajax/seleautomation-07-3/blob/master/src/test/java/com/store/utils/DBValidation.java): optional verifier · Optional MySQL-backed backend validation path · `src/test/java/com/store/utils/DBValidation.java`

### External Systems

Systems outside this repository that tests exercise or optionally verify

- **DemoWebShop**: system under test · External ecommerce site under test
- **MySQL**: optional dependency · Local database used only for optional validation

## Connections

- Maven POM → TestNG Suite: runs · Maven executes the TestNG suite
- Maven POM → CI Workflow: drives · CI uses the Maven test lifecycle
- TestNG Suite → Test Listener: registers · Suite wires reporting and diagnostics hooks
- TestNG Suite → Retry: uses · Suite relies on retry behavior for flaky tests
- CI Workflow → Maven POM: invokes · Workflow runs the build and test command
- Base Test → Home Page: shares · Base setup exposes common page instances
- Base Test → Login Page: shares · Base setup exposes common page instances
- Base Test → Register Page: shares · Base setup exposes common page instances
- Home Test → Base Test: extends · Tests inherit browser lifecycle and shared state
- Login Test → Base Test: extends · Tests inherit browser lifecycle and shared state
- Register Test → Base Test: extends · Tests inherit browser lifecycle and shared state
- Home Test → Home Page: uses · Home test delegates UI behavior to the page object
- Login Test → Login Page: uses · Login test delegates UI behavior to the page object
- Register Test → Register Page: uses · Register test delegates UI behavior to the page object
- Login Test → Data Providers: feeds · Login flow consumes parameterized test data
- Data Providers → CSV Data: loads · Data providers source CSV-backed user data
- Register Test → Allure Utils: reports · Registration flow emits rich failure artifacts
- Test Listener → Allure Utils: attaches · Listener coordinates reporting attachments
- Base Page → DemoWebShop: drives · Page actions operate the browser against the ecommerce site
- DB Validation → MySQL: verifies · Optional backend validation against a local database
- Planned Tests → DemoWebShop: targets · Planned flows are meant to cover remaining site areas
- Base Test → DemoWebShop: opens · Test setup launches the browser against the site
- TestNG Suite → Home Test: includes · Suite executes the implemented home coverage
- TestNG Suite → Login Test: includes · Suite executes the implemented login coverage
- TestNG Suite → Register Test: includes · Suite executes the implemented registration coverage
- TestNG Suite → Planned Tests: includes · Suite also contains scaffolded future coverage
