# gadilapraveenkumar/userbasedautomation architecture

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

- Interactive diagram: https://gitdiagram.com/gadilapraveenkumar/userbasedautomation
- Repository: https://github.com/gadilapraveenkumar/userbasedautomation

## Overview

##### Main Components
- Test Runner & Execution: The entry point of testing is driven by TestNG (as indicated by testng.xml and the presence of a dedicated TestRunner package). This component orchestrates the test execution.
- Driver Management: The DriverFactory (located under src/test/java/DriverFactory) is responsible for creating and managing web driver instances. Notably, the presence of msedgedriver.exe in the lib directory confirms that browser automation (likely using Selenium) is a core part of the framework.
- Hooks and Test Lifecycle: MasterHook under the Hooks directory manages pre- and post-test actions such as test setup and teardown.
- Step Definitions: Found in src/test/java/stepdefinitions, these bridge the test scenarios (possibly defined in Cucumber feature files under src/test/resources/features) to the underlying automation code.
- Page Objects: The project applies the Page Object Model pattern (evidenced by the pageObjects directory) to encapsulate UI interactions. Examples include LoginPage, LHNMenuPage, and EachPageValidation.
- Utilities and Constants: Utility classes (e.g., Util, ImageBase64Encoder, SummaryReport) and constants are used to support common operations and reporting.
- Configuration: The src/test/resources/properties directory contains configuration files (env, capabilities, prod, qa) that control environment-specific settings.
- Reporting: The Reports directory shows that HTML reports are generated to provide execution feedback.

##### Out the Relationships and Data Flow
- Configuration files are referenced by multiple components (DriverFactory, Hooks, etc.) to set up the environment and capabilities.

##### Architectural Patterns and Design Principles
- Modular Structure: The clear separation between test execution, UI interaction (Page Objects), and utility functions ensures maintainability.
- Page Object Model: The division into cohesive page-specific classes encapsulates UI logic.
- Reusability and Extensibility: The inclusion of step definitions and hook mechanisms makes it easy to extend the framework for different user scenarios.
- Configuration-Driven Testing: Externalizing environment parameters in property files supports flexibility across various test environments.

##### Incorporate Relevant Technologies/Frameworks
- TestNG: For driving test execution (and managing lifecycle through testng.xml).
- Selenium WebDriver: Implicitly used for browser automation with msedgedriver.
- Maven: Indicated by the presence of pom.xml for build and dependency management.
- Cucumber (or similar behavior-driven tools): Suggested by the use of .feature files in the resources directory.
- HTML Reporting: Custom reporting utilities generating user summary reports.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Test Execution Layer
    subgraph "Test Execution Layer"
        A["Test Runner (TestNG)"] 
        B["Test Suite Config"]
        C["Master Hook"]
    end

    %% Step Definitions Layer
    subgraph "Step Definitions"
        D["Step Definitions Directory"]
        E["LoginSteps.java"]
        F["LHNMenuSteps.java"]
        G["EachPageValidationSteps.java"]
        H["CommonSteps.java"]
    end

    %% Page Objects Layer
    subgraph "Page Objects"
        I["Page Objects Directory"]
        J["LoginPage.java"]
        K["LHNMenuPage.java"]
        L["EachPageValidation.java"]
    end

    %% Driver Management Layer
    subgraph "Driver Management"
        M["Driver Factory"]
        N["Browser Driver"]
    end

    %% Utilities and Constants
    subgraph "Utilities & Constants"
        O["Utilities Directory"]
        P["Constants"]
        Q["ImageBase64Encoder.java"]
        R["SummaryReport.java"]
        S["Util.java"]
        T["FileType.java"]
    end

    %% Configuration Layer
    subgraph "Configuration"
        U["Properties Directory"]
    end

    %% Reporting Layer
    subgraph "Reporting"
        V["Reports Dir"]
        W["UserBased_Summary_Report.html"]
    end

    %% Connections
    A -->|"triggers"| C
    A -->|"executes"| D
    D -->|"invokes"| I
    I -->|"obtainsDriverFrom"| M
    M -->|"manages"| N
    M -->|"reads"| U
    C -->|"reads"| U
    A -->|"logsUsing"| O
    O -->|"generatesReports"| V
    V -->|"contains"| W

    %% Class Definitions for coloring
    class A,B,C testExec
    class D,E,F,G,H stepDef
    class I,J,K,L pageObj
    class M,N driverMgmt
    class O,P,Q,R,S,T util
    class U config
    class V,W report

    %% Styles
    classDef testExec fill:#cce5ff,stroke:#000,stroke-width:1px;
    classDef stepDef fill:#d5f5e3,stroke:#000,stroke-width:1px;
    classDef pageObj fill:#fee5d9,stroke:#000,stroke-width:1px;
    classDef driverMgmt fill:#f9e79f,stroke:#000,stroke-width:1px;
    classDef util fill:#f5cba7,stroke:#000,stroke-width:1px;
    classDef config fill:#d6eaf8,stroke:#000,stroke-width:1px;
    classDef report fill:#fadbd8,stroke:#000,stroke-width:1px;

    %% Click Events for Test Execution Layer
    click A "https://github.com/gadilapraveenkumar/userbasedautomation/blob/main/src/test/java/TestRunner/TestRunner.java"
    click B "https://github.com/gadilapraveenkumar/userbasedautomation/blob/main/testng.xml"
    click C "https://github.com/gadilapraveenkumar/userbasedautomation/blob/main/src/test/java/Hooks/MasterHook.java"

    %% Click Events for Step Definitions
    click D "https://github.com/gadilapraveenkumar/userbasedautomation/tree/main/src/test/java/stepdefinitions"
    click E "https://github.com/gadilapraveenkumar/userbasedautomation/blob/main/src/test/java/stepdefinitions/LoginSteps.java"
    click F "https://github.com/gadilapraveenkumar/userbasedautomation/blob/main/src/test/java/stepdefinitions/LHNMenuSteps.java"
    click G "https://github.com/gadilapraveenkumar/userbasedautomation/blob/main/src/test/java/stepdefinitions/EachPageValidationSteps.java"
    click H "https://github.com/gadilapraveenkumar/userbasedautomation/blob/main/src/test/java/stepdefinitions/CommonSteps.java"

    %% Click Events for Page Objects
    click I "https://github.com/gadilapraveenkumar/userbasedautomation/tree/main/src/test/java/automation/pageObjects"
    click J "https://github.com/gadilapraveenkumar/userbasedautomation/blob/main/src/test/java/automation/pageObjects/LoginPage.java"
    click K "https://github.com/gadilapraveenkumar/userbasedautomation/blob/main/src/test/java/automation/pageObjects/LHNMenuPage.java"
    click L "https://github.com/gadilapraveenkumar/userbasedautomation/blob/main/src/test/java/automation/pageObjects/EachPageValidation.java"

    %% Click Events for Driver Management
    click M "https://github.com/gadilapraveenkumar/userbasedautomation/blob/main/src/test/java/DriverFactory/DriverFactory.java"
    click N "https://github.com/gadilapraveenkumar/userbasedautomation/blob/main/lib/msedgedriver.exe"

    %% Click Events for Utilities and Constants
    click O "https://github.com/gadilapraveenkumar/userbasedautomation/tree/main/src/test/java/automation/util"
    click P "https://github.com/gadilapraveenkumar/userbasedautomation/blob/main/src/test/java/automation/Constants/Constants.java"
    click Q "https://github.com/gadilapraveenkumar/userbasedautomation/blob/main/src/test/java/automation/util/ImageBase64Encoder.java"
    click R "https://github.com/gadilapraveenkumar/userbasedautomation/blob/main/src/test/java/automation/util/SummaryReport.java"
    click S "https://github.com/gadilapraveenkumar/userbasedautomation/blob/main/src/test/java/automation/util/Util.java"
    click T "https://github.com/gadilapraveenkumar/userbasedautomation/blob/main/src/test/java/automation/util/FileType.java"

    %% Click Events for Configuration
    click U "https://github.com/gadilapraveenkumar/userbasedautomation/tree/main/src/test/resources/properties"

    %% Click Events for Reporting
    click V "https://github.com/gadilapraveenkumar/userbasedautomation/tree/main/Reports"
    click W "https://github.com/gadilapraveenkumar/userbasedautomation/blob/main/Reports/UserBased_Summary_Report_20250329_230959.html"
```
