# redskull5143/frameworkwebautomation architecture

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

- Interactive diagram: https://gitdiagram.com/redskull5143/frameworkwebautomation
- Repository: https://github.com/redskull5143/frameworkwebautomation

## Overview

##### Project Type and Purpose
- This is a test-automation framework (not a customer-facing full-stack app).
- Purpose: automate end-to-end tests for an e-commerce site using Java + Selenium WebDriver, organized via the Page Object Model (POM), executed with TestNG and Gradle, reporting via Allure, and integrated into CI via GitHub Actions.

##### File Structure
- Top-level directories:
- src/main/java/com/omshinde/capstone
– actions (WebActions, ButtonAction, TextBox, SearchContent)
– components (reusable UI fragments like HeaderComponent)
– models (data holders e.g. User)
– modals (pop-up abstractions: CartModal, FilterByPriceModal, SearchModal)
– pages (POM classes for each page: BasePage, HomePage, CartPage, RegistrationPage, etc.)
– Categories.java (test data enum)
- src/test/java/com/omshinde/capstone
– test suites organized by feature (testAuthentications, testCart, testOrders, testProducts)
– util (BaseTest, DriverFactory)
- Resources:
- webdriver-config.properties (driver settings)
- Log4j2.xml + logs directory
- CI/CD:
- .github/workflows/gradle.yml
- Build system:
- Gradle wrapper, build.gradle, settings.gradle

##### README for Additional Insights
- Confirms tech stack: Java / Selenium / TestNG / Gradle / Git / Allure
- Lists test coverage areas (Search, Profile, Contact, Registration, Login, Cart)
- Explains how to build (gradle clean build) and run (gradle test)

##### Main Components
a. Test Runner & Orchestration
- Gradle → invokes TestNG
- GitHub Actions workflow
b. Core Framework Modules
- DriverFactory (instantiates WebDriver per webdriver-config.properties)
- BaseTest (setup/teardown, reading config, logging)
c. Page Object Layer (POM)
- Pages (HomePage, CartPage, LoginPage, etc.)
- Components & Modals (HeaderComponent, CartModal, etc.)
d. Low-Level Action Utilities
- WebActions, ButtonAction, TextBox, SearchContent
e. Test Suites
- Authentication tests, Cart tests, Order tests, Product tests
f. External Systems & Tools
- Web Browser (Chrome/Firefox)
- AUT (SUT) Web Server at web-playground.ultralesson.com
- Allure Reporting Service
- GitHub Actions / CI

##### Relationships & Data Flows
- Gradle → TestNG Runner → BaseTest
- BaseTest uses DriverFactory → WebDriver → Browser → HTTP requests/responses to AUT
- Test methods call Page Objects → which delegate to Action Utilities → manipulate Browser DOM
- Page Objects may embed Components/Modals
- Tests verify outcomes (assertions) → results piped to Allure
- CI pipeline triggers Gradle, collects Allure results

##### Architectural Patterns & Design Principles
- Page Object Model for UI abstraction
- Single Responsibility: actions vs. page vs. modal vs. component vs. test
- Factory Pattern for WebDriver instantiation
- Layered architecture:
Test Suite → BaseTest/DriverFactory → POM Layer → Action Utilities → WebDriver

##### Relevant Technologies & Frameworks
- Java (core language)
- Selenium WebDriver (browser automation)
- TestNG (test orchestration)
- Gradle (build + dependency management)
- Allure (test reporting)
- Log4j2 (logging)
- GitHub Actions (CI/CD)

##### Detailed Steps for the Engineer
1. Sketch top-level: CI/CD → Build & Test Orchestration → Reporting
3. Config retrieval path (webdriver-config.properties → DriverFactory)
4. Runtime flow: Test → BaseTest → POM → WebActions → WebDriver → Browser → AUT
5. Log generation path (Log4j2 → logs/app.log)

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "CI/CD & Orchestration"
        GH["GitHub Actions Workflow"]:::ci
        GRADLE["Gradle Build & Wrapper"]:::ci
        GH -->|triggers| GRADLE
    end

    subgraph "Framework Layer"
        TF["TestNG Runner"]:::framework
        BT["BaseTest"]:::framework
        DF["DriverFactory"]:::framework
        CONFIG["webdriver-config.properties"]:::config
        LOGCONF["Log4j2.xml"]:::config
        LOGDIR["logs/app/app.log"]:::external
        GRADLE -->|invokes| TF
        TF --> BT
        BT --> DF
        CONFIG --> DF
        LOGCONF --> BT
        BT --> LOGDIR
    end

    subgraph "POM Layer"
        BP["BasePage"]:::pom
        HP["HomePage"]:::pom
        CP["CartPage"]:::pom
        BILP["BillingPage"]:::pom
        PDP["ProductDetailsPage"]:::pom
        SRP["SearchResultPage"]:::pom
        subgraph "Account Pages"
            LP["LoginPage"]:::pom
            REGP["RegistrationPage"]:::pom
            FPP["ForgotPasswordPage"]:::pom
            PROF["ProfilePage"]:::pom
            ODP["OrderDetailsPage"]:::pom
        end
        BM["HeaderComponent"]:::pom
        subgraph "Modals"
            CM["CartModal"]:::pom
            FP["FilterByPriceModal"]:::pom
            SM["SearchModal"]:::pom
        end
        DF --> BP
        BP -->|extends| HP
        BP --> CP
        BP --> BILP
        BP --> PDP
        BP --> SRP
        HP --> BM
        CP --> CM
        HP --> SM
        HP --> FP
        LP --> BP
        REGP --> BP
        FPP --> BP
        PROF --> BP
        ODP --> BP
    end

    subgraph "Utilities Layer"
        WA["WebActions"]:::util
        BA["ButtonAction"]:::util
        TB["TextBox"]:::util
        SC["SearchContent"]:::util
        BP --> WA
        BP --> BA
        BP --> TB
        BP --> SC
    end

    subgraph "Test Suites"
        subgraph "Authentication Tests"
            RT["RegistrationTest"]:::tests
            FOT["ForgotPasswordTest"]:::tests
        end
        subgraph "Cart Tests"
            APC["AddAvailableProductToCartTest"]:::tests
            RPT["RemoveProductTest"]:::tests
            VCT["ValidateCartContentsTest"]:::tests
        end
        subgraph "Order Tests"
            COPT["CheckOutPageTest"]:::tests
            OHT["OrderHistoryTest"]:::tests
        end
        subgraph "Product Tests"
            AOP["AvailabilityOfProduct"]:::tests
            SFT["SearchAndFilterTest"]:::tests
            SPT["SearchProductTest"]:::tests
            SCT["SpecialCharactersSearchTest"]:::tests
        end
        RT --> BT
        FOT --> BT
        APC --> BT
        RPT --> BT
        VCT --> BT
        COPT --> BT
        OHT --> BT
        AOP --> BT
        SFT --> BT
        SPT --> BT
        SCT --> BT
    end

    subgraph "Reporting & External"
        ALLURE["Allure Reporting Service"]:::external
        BROWSER["Web Browser"]:::external
        AUT["AUT Web Server"]:::external
        TF --> ALLURE
        DF --> BROWSER
        BROWSER -->|HTTP| AUT
    end

    %% Click Events
    click GH "https://github.com/redskull5143/frameworkwebautomation/blob/main/.github/workflows/gradle.yml"
    click GRADLE "https://github.com/redskull5143/frameworkwebautomation/blob/main/build.gradle"
    click GRADLE "https://github.com/redskull5143/frameworkwebautomation/blob/main/settings.gradle"
    click GRADLE "https://github.com/redskull5143/frameworkwebautomation/tree/main/gradlew"
    click GRADLE "https://github.com/redskull5143/frameworkwebautomation/blob/main/gradlew.bat"
    click GRADLE "https://github.com/redskull5143/frameworkwebautomation/blob/main/gradle/wrapper/gradle-wrapper.properties"
    click DF "https://github.com/redskull5143/frameworkwebautomation/blob/main/src/test/java/com/omshinde/capstone/util/DriverFactory.java"
    click BT "https://github.com/redskull5143/frameworkwebautomation/blob/main/src/test/java/com/omshinde/capstone/util/BaseTest.java"
    click WA "https://github.com/redskull5143/frameworkwebautomation/blob/main/src/main/java/com/omshinde/capstone/actions/WebActions.java"
    click BA "https://github.com/redskull5143/frameworkwebautomation/blob/main/src/main/java/com/omshinde/capstone/actions/ButtonAction.java"
    click TB "https://github.com/redskull5143/frameworkwebautomation/blob/main/src/main/java/com/omshinde/capstone/actions/TextBox.java"
    click SC "https://github.com/redskull5143/frameworkwebautomation/blob/main/src/main/java/com/omshinde/capstone/actions/SearchContent.java"
    click BP "https://github.com/redskull5143/frameworkwebautomation/blob/main/src/main/java/com/omshinde/capstone/pages/BasePage.java"
    click HP "https://github.com/redskull5143/frameworkwebautomation/blob/main/src/main/java/com/omshinde/capstone/pages/HomePage.java"
    click CP "https://github.com/redskull5143/frameworkwebautomation/blob/main/src/main/java/com/omshinde/capstone/pages/CartPage.java"
    click BILP "https://github.com/redskull5143/frameworkwebautomation/blob/main/src/main/java/com/omshinde/capstone/pages/BillingPage.java"
    click PDP "https://github.com/redskull5143/frameworkwebautomation/blob/main/src/main/java/com/omshinde/capstone/pages/ProductDetailsPage.java"
    click SRP "https://github.com/redskull5143/frameworkwebautomation/blob/main/src/main/java/com/omshinde/capstone/pages/SearchResultPage.java"
    click LP "https://github.com/redskull5143/frameworkwebautomation/blob/main/src/main/java/com/omshinde/capstone/pages/accounts/LoginPage.java"
    click REGP "https://github.com/redskull5143/frameworkwebautomation/blob/main/src/main/java/com/omshinde/capstone/pages/accounts/RegistrationPage.java"
    click FPP "https://github.com/redskull5143/frameworkwebautomation/blob/main/src/main/java/com/omshinde/capstone/pages/accounts/ForgotPasswordPage.java"
    click PROF "https://github.com/redskull5143/frameworkwebautomation/blob/main/src/main/java/com/omshinde/capstone/pages/accounts/ProfilePage.java"
    click ODP "https://github.com/redskull5143/frameworkwebautomation/blob/main/src/main/java/com/omshinde/capstone/pages/accounts/OrderDetailsPage.java"
    click BM "https://github.com/redskull5143/frameworkwebautomation/blob/main/src/main/java/com/omshinde/capstone/components/HeaderComponent.java"
    click CM "https://github.com/redskull5143/frameworkwebautomation/blob/main/src/main/java/com/omshinde/capstone/modals/CartModal.java"
    click FP "https://github.com/redskull5143/frameworkwebautomation/blob/main/src/main/java/com/omshinde/capstone/modals/FilterByPriceModal.java"
    click SM "https://github.com/redskull5143/frameworkwebautomation/blob/main/src/main/java/com/omshinde/capstone/modals/SearchModal.java"
    click CONFIG "https://github.com/redskull5143/frameworkwebautomation/blob/main/src/main/resources/webdriver-config.properties"
    click LOGCONF "https://github.com/redskull5143/frameworkwebautomation/blob/main/src/main/resources/Log4j2.xml"

    %% Styles
    classDef ci fill:#FFE4B5,stroke:#DAA520
    classDef framework fill:#E0FFFF,stroke:#20B2AA
    classDef pom fill:#FFFACD,stroke:#FFD700
    classDef util fill:#E6E6FA,stroke:#9370DB
    classDef tests fill:#F0FFF0,stroke:#32CD32
    classDef external fill:#D3D3D3,stroke:#A9A9A9
    classDef config fill:#F5F5F5,stroke:#C0C0C0,stroke-dasharray: 5 5
```
