# gandhivivek96/selenium-automation-poc architecture

> Architecture diagram of the GitHub repository gandhivivek96/selenium-automation-poc, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gandhivivek96/selenium-automation-poc
- Repository: https://github.com/gandhivivek96/selenium-automation-poc

## Overview

##### Main Components
- Test Runner & Build System: Represented by Maven (pom.xml) which drives the build process, dependency management, and test execution.
- Configuration Management: The configuration files in the “config” directory (DEV.properties, QA.properties, UAT.properties, config.json) that feed into the test execution environment.
- Test Scripts & Page Objects: The “src/test/java/io/github/gandhivivek96/” directory contains well-organized subcomponents:
- Pages (Page Object Model implementations such as LoginPage, HomePage, ProductDetailPage, etc.)
- POJOs for structured data (AddressPOJO, Config, Environment, etc.)
- Tests (various test cases which extend a common TestBase)
- Data Providers & Test Data: Data providers (reading CSV, JSON, Excel files) and the “testData” directory housing loginData in several formats.
- Utility & Helper Components: Utility classes for browser handling, Excel/CSV/JSON reading, logging, and report generation (e.g., BrowserUtility, ExtentReporterUtility).
- Reporting and Logging: Integration with Log4j2 (via log4j2.xml) and ExtentReports for comprehensive test reporting.
- Parallel Execution & Thread Safety: Use of ThreadLocal to hold WebDriver and ExtentReport instances, ensuring safe concurrent execution.
- CI/CD Integration: GitHub Actions (as shown by .github/workflows/maven.yml) automates the test runs on push, pull request, and on schedule.
- Cloud Testing Integration: Optional LambdaTest integration is controlled by parameters (e.g., -DisLambdaTest) to run tests on a cloud grid when needed.

##### Component Relationships & Interactions
- The Maven build system triggers test executions and integrates with the testing framework.
- Test Runner (TestNG) interacts with:
- The Configuration component to pick environment-specific settings.
- The Data Providers to feed test data into test cases.
- The Page Object components that encapsulate the UI interaction logic.
- The Utilities for cross-browser management, logging, and reporting.
- On failure or success, test cases send logs and reports to the Reporting component.
- CI/CD flows (hosted on GitHub Actions) invoke the build & test process, eventually deploying the generated reports (e.g., to GitHub Pages).
- When cloud testing is enabled, the test set-up logic interacts with LambdaTest.
- There’s a defined workflow between data, test cases, page objects, and utilities ensuring maintainability (the essence of the POM pattern).

##### Architectural Patterns & Design Principles
- Page Object Model (POM): Separates pages (UI elements/operations) from test logic.
- Data-Driven Testing: Uses external data sources in CSV, JSON, and Excel formats to drive tests.
- Separation of Concerns: Clear division between test scripts, utilities, and configuration.
- Thread Safety in parallel test execution using ThreadLocal storage.
- Continuous Integration: Automated test execution through GitHub Actions, ensuring rapid feedback.

##### Relevant Technologies & Frameworks
- Java (JDK 11+), Selenium WebDriver, TestNG, Maven.
- Data access libraries: OpenCSV, Gson, Apache POI.
- Logging: Log4j2 and Reporting: ExtentReports.
- External integrations: LambdaTest (cloud testing) and GitHub Actions (CI/CD).

##### Final Advice
- Be as detailed as possible – include every critical architectural element without oversimplifying.

Happy diagramming!

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Build & Configuration Layer
    subgraph "Build & Configuration Layer"
        B1["Maven Build (pom.xml)"]:::build
        B2["TestNG Config (testng.xml)"]:::build
        CFG["Configuration Files"]:::config
    end

    %% Test Execution Layer
    subgraph "Test Execution Layer"
        TS["Test Scripts (Test Cases, TestBase)"]:::test
        PO["Page Objects (LoginPage, HomePage, etc.)"]:::page
        DP["Data Providers"]:::data
        TD["Test Data Files"]:::data
        UTIL["Utility & Helper Components"]:::util
    end

    %% Reporting & Logging
    subgraph "Reporting & Logging"
        LR["Log4j2 Config"]:::report
        ER["Extent Reporter Utility"]:::report
    end

    %% CI/CD and Cloud Integration
    subgraph "CI/CD & Cloud Integration"
        CI["CI/CD Pipeline (GitHub Actions)"]:::external
        CT["Cloud Testing (LambdaTest)"]:::external
    end

    %% Connections
    CI -->|"triggers"| B1
    CI -->|"triggers"| B2

    B1 -->|"builds"| TS
    B2 -->|"configures"| TS
    CFG -->|"feeds-settings"| TS

    TD -->|"supplies data"| DP
    DP -->|"provides data"| TS

    TS -->|"utilizes"| PO
    TS -->|"calls"| UTIL

    TS -->|"logs to"| LR
    TS -->|"reports via"| ER

    UTIL -->|"integrates with"| CT
    CT -- "cloud commands" --> UTIL

    %% Styling Classes
    classDef build fill:#d1c4e9,stroke:#4a148c,stroke-width:2px;
    classDef config fill:#bbdefb,stroke:#0d47a1,stroke-width:2px;
    classDef test fill:#c8e6c9,stroke:#1b5e20,stroke-width:2px;
    classDef page fill:#a5d6a7,stroke:#1b5e20,stroke-width:2px;
    classDef data fill:#ffe082,stroke:#ff6f00,stroke-width:2px;
    classDef util fill:#fff9c4,stroke:#f57f17,stroke-width:2px;
    classDef report fill:#ffcdd2,stroke:#b71c1c,stroke-width:2px;
    classDef external fill:#eeeeee,stroke:#616161,stroke-width:2px;

    %% Click Events
    click B1 "https://github.com/gandhivivek96/selenium-automation-poc/blob/main/pom.xml"
    click B2 "https://github.com/gandhivivek96/selenium-automation-poc/blob/main/testng.xml"
    click CFG "https://github.com/gandhivivek96/selenium-automation-poc/tree/main/config/"
    click PO "https://github.com/gandhivivek96/selenium-automation-poc/tree/main/src/test/java/io/github/gandhivivek96/pages"
    click TS "https://github.com/gandhivivek96/selenium-automation-poc/tree/main/src/test/java/io/github/gandhivivek96/tests"
    click DP "https://github.com/gandhivivek96/selenium-automation-poc/tree/main/src/test/java/io/github/gandhivivek96/dataproviders"
    click TD "https://github.com/gandhivivek96/selenium-automation-poc/tree/main/testData/"
    click UTIL "https://github.com/gandhivivek96/selenium-automation-poc/tree/main/src/test/java/io/github/gandhivivek96/utils"
    click LR "https://github.com/gandhivivek96/selenium-automation-poc/blob/main/src/test/resources/log4j2.xml"
    click ER "https://github.com/gandhivivek96/selenium-automation-poc/tree/main/src/test/java/io/github/gandhivivek96/utils"
    click CI "https://github.com/gandhivivek96/selenium-automation-poc/blob/main/.github/workflows/maven.yml"
    click CT "https://github.com/gandhivivek96/selenium-automation-poc/tree/main/src/test/java/io/github/gandhivivek96/utils/LambdaTestUtility"
```
