# vimukthi101/mbmc-selenium architecture

> Architecture diagram of the GitHub repository vimukthi101/mbmc-selenium, 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/vimukthi101/mbmc-selenium
- Repository: https://github.com/vimukthi101/mbmc-selenium

## Overview

##### Main Components
- Automation Framework Core: Represented by the base classes (e.g., BasePage.java in the “com.qa.base” package and BaseTest.java in the tests section). These provide common functionality and setup/teardown logic.
- Page Objects: These are classes that directly interact with elements on the MBMC site. You have multiple page packages (e.g., “com.qa.pages” and “com.qa/pages/insurance”) that include pages like HomePage, LoginPage, and specialized pages such as PdwPage.
- Test Suites/Flows: Under “src/test/java/com/qa/tests” you see directories for “insuranceForm” and “pwdForm”. These contain tests for various scenarios – successful flows, inputs validation (invalid inputs, missing parameters, etc.). They also include test data classes.
- Supporting Resources: These include configuration and resource files (testng.xml and files in the target/resources directory), which support test execution parameters and data files.
- Build/Configuration: The Maven pom.xml file and the project’s directory structure support dependency management and project build processes.

##### Relationships and Component Interactions
- Maven build process (from pom.xml) as the component that orchestrates dependency injection, builds, and test runs.
- External test runner (via testng.xml) as a trigger that coordinates the execution of test classes from the project.

##### Architectural Patterns and Design Principles
- That the Page Object Model (POM) is reflected in the separation between page classes (domain-specific interactions) and test classes (workflow and scenario testing).
- That the project adheres to principles of modularity and reusability, as evidenced by the separation of insurance-related pages from other pages.

##### Relevant Technologies and Frameworks
- Selenium for browser automation.
- TestNG (as indicated by testng.xml) which manages test execution.
- Maven for build management.
- Java as the programming language.

##### Essential Elements
- Clear labels for each component (e.g., “BasePage”, “LoginPage”, etc.).
- A section that indicates external resources (MBMC site being automated) and external frameworks (Selenium, TestNG, Maven).
- Use annotations where necessary to highlight how test data (TestData in tests) supports the flow of test execution.

## Diagram (Mermaid)

```mermaid
flowchart TD

    %% Build & Configuration Layer
    subgraph "Build & Configuration"
        Maven["Maven (pom.xml)"]:::config
        TestNGConfig["TestNG Config (testng.xml)"]:::config
        Resources["Data Files (target/resources)"]:::config
    end

    %% Automation Framework Core
    subgraph "Automation Framework Core"
        BasePage["BasePage"]:::core
        BaseTest["BaseTest"]:::core
    end

    %% Page Object Layer
    subgraph "Page Object Layer"
        subgraph "General Page Objects"
            GP_Home["HomePage"]:::page
            GP_Login["LoginPage"]:::page
            GP_Pdw["PdwPage"]:::page
        end
        subgraph "Insurance Page Objects"
            Ins_Home["HomePage (Insurance)"]:::page
            Ins_Insurance["InsurancePage"]:::page
            Ins_Login["LoginPage (Insurance)"]:::page
        end
    end

    %% Test Layer
    subgraph "Test Layer"
        InsuranceTests["Insurance Form Tests"]:::test
        PwdTests["Pwd Form Tests"]:::test
    end

    %% External Dependencies
    subgraph "External Dependencies"
        Selenium["Selenium"]:::external
        MBMC["MBMC Site"]:::external
        TestNGExternal["TestNG"]:::external
        Java["Java"]:::external
    end

    %% Connections between Build & Configuration and Core
    Maven -->|"builds"| BaseTest
    Maven -->|"builds"| BasePage
    TestNGConfig -->|"triggers"| InsuranceTests
    TestNGConfig -->|"triggers"| PwdTests
    TestNGExternal -->|"runs"| TestNGConfig
    Maven -->|"uses"| Java

    %% Connections between Core and Page Objects
    GP_Home -->|"extends"| BasePage
    GP_Login -->|"extends"| BasePage
    GP_Pdw -->|"extends"| BasePage
    Ins_Home -->|"extends"| BasePage
    Ins_Insurance -->|"extends"| BasePage
    Ins_Login -->|"extends"| BasePage

    %% Connections between Core and Test Layer
    InsuranceTests -->|"inherits"| BaseTest
    PwdTests -->|"inherits"| BaseTest

    %% Connections from Test Layer to Page Objects
    InsuranceTests -->|"calls"| GP_Login
    InsuranceTests -->|"calls"| Ins_Insurance
    PwdTests -->|"calls"| GP_Pdw

    %% Connections from Page Objects to External MBMC Site
    GP_Home -->|"interacts"| MBMC
    GP_Login -->|"interacts"| MBMC
    GP_Pdw -->|"interacts"| MBMC
    Ins_Home -->|"interacts"| MBMC
    Ins_Insurance -->|"interacts"| MBMC
    Ins_Login -->|"interacts"| MBMC

    %% Connection from Core to External Selenium
    BasePage -->|"utilizes"| Selenium

    %% Click Events
    click BasePage "https://github.com/vimukthi101/mbmc-selenium/blob/main/src/main/java/com/qa/base/BasePage.java"
    click BaseTest "https://github.com/vimukthi101/mbmc-selenium/blob/main/src/test/java/com/qa/base/BaseTest.java"
    click GP_Home "https://github.com/vimukthi101/mbmc-selenium/blob/main/src/main/java/com/qa/pages/HomePage.java"
    click GP_Login "https://github.com/vimukthi101/mbmc-selenium/blob/main/src/main/java/com/qa/pages/LoginPage.java"
    click GP_Pdw "https://github.com/vimukthi101/mbmc-selenium/blob/main/src/main/java/com/qa/pages/PdwPage.java"
    click Ins_Home "https://github.com/vimukthi101/mbmc-selenium/blob/main/src/main/java/com/qa/pages/insurance/HomePage.java"
    click Ins_Insurance "https://github.com/vimukthi101/mbmc-selenium/blob/main/src/main/java/com/qa/pages/insurance/InsurancePage.java"
    click Ins_Login "https://github.com/vimukthi101/mbmc-selenium/blob/main/src/main/java/com/qa/pages/insurance/LoginPage.java"
    click InsuranceTests "https://github.com/vimukthi101/mbmc-selenium/tree/main/src/test/java/com/qa/tests/insuranceForm"
    click PwdTests "https://github.com/vimukthi101/mbmc-selenium/tree/main/src/test/java/com/qa/tests/pwdForm"
    click Maven "https://github.com/vimukthi101/mbmc-selenium/blob/main/pom.xml"
    click TestNGConfig "https://github.com/vimukthi101/mbmc-selenium/blob/main/testng.xml"
    click Resources "https://github.com/vimukthi101/mbmc-selenium/tree/main/target/resources"

    %% Styles
    classDef core fill:#AED6F1,stroke:#1B4F72,color:#000,stroke-width:2px;
    classDef page fill:#A9DFBF,stroke:#196F3D,color:#000,stroke-width:2px;
    classDef test fill:#F9E79F,stroke:#B7950B,color:#000,stroke-width:2px;
    classDef config fill:#F5B7B1,stroke:#922B21,color:#000,stroke-width:2px;
    classDef external fill:#FAD7A0,stroke:#D35400,color:#000,stroke-width:2px;
```
