# ebrahimhossaincse/playwright-data-driven-testing-with-java-testng-and-extent-reports architecture

> Architecture diagram of the GitHub repository ebrahimhossaincse/playwright-data-driven-testing-with-java-testng-and-extent-reports, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ebrahimhossaincse/playwright-data-driven-testing-with-java-testng-and-extent-reports
- Repository: https://github.com/ebrahimhossaincse/playwright-data-driven-testing-with-java-testng-and-extent-reports

## Overview

a. Primary Flow:
- TestNG Suite → Test Classes → Page Objects → BaseDriver → Browser

b. Secondary Flows:
- Test Classes ←→ Utilities (ExcelUtils, CommonMethods)
- Test Execution → ExtentFactory → Reports

##### Important Elements

a. Framework Components:
- Playwright Browser Instance (managed by BaseDriver)
- TestNG Test Suite Configuration
- Page Object Model Implementation
- Data-Driven Testing Framework
- Reporting Mechanism

b. Design Patterns Used:
- Page Object Model (POM)
- Factory Pattern (ExtentFactory)
- Singleton Pattern (for driver management)

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Styles and Classes
    classDef testExecution fill:#b3d1ff,stroke:#333,stroke-width:2px
    classDef pageObject fill:#90EE90,stroke:#333,stroke-width:2px
    classDef utility fill:#FFB366,stroke:#333,stroke-width:2px
    classDef resource fill:#E0E0E0,stroke:#333,stroke-width:2px
    classDef config fill:#FFD700,stroke:#333,stroke-width:2px

    %% Test Execution Layer
    subgraph TestLayer["Test Execution Layer"]
        TestNG["TestNG Suite"]:::testExecution
        LoginTest["Login Test"]:::testExecution
        RegTest["Registration Test"]:::testExecution
    end

    %% Page Object Layer
    subgraph POLayer["Page Object Layer"]
        BaseDriver["Base Driver"]:::pageObject
        LoginPage["Login Page"]:::pageObject
        RegPage["Register Page"]:::pageObject
    end

    %% Utility Layer
    subgraph UtilLayer["Utility Layer"]
        CommonMethods["Common Methods"]:::utility
        ExcelUtils["Excel Utils"]:::utility
        ExtentFactory["Extent Factory"]:::utility
    end

    %% External Resources
    subgraph Resources["External Resources"]
        TestData[(Test Data)]:::resource
        Reports[(Reports)]:::resource
        Screenshots[(Screenshots)]:::resource
        TestOutput[(Test Output)]:::resource
    end

    %% Configuration
    Config[("pom.xml")]:::config

    %% Relationships
    TestNG --> LoginTest & RegTest
    LoginTest & RegTest --> LoginPage & RegPage
    LoginPage & RegPage --> BaseDriver
    BaseDriver --> Browser((Browser))
    LoginTest & RegTest --> ExcelUtils
    ExcelUtils --> TestData
    LoginTest & RegTest --> CommonMethods
    LoginTest & RegTest --> ExtentFactory
    ExtentFactory --> Reports
    CommonMethods --> Screenshots

    %% Click Events
    click TestNG "https://github.com/ebrahimhossaincse/Playwright-Data-Driven-Testing-With-Java-TestNG-And-Extent-Reports/blob/main/testng.xml"
    click LoginTest "https://github.com/ebrahimhossaincse/Playwright-Data-Driven-Testing-With-Java-TestNG-And-Extent-Reports/blob/main/src/test/java/ebrahim/hossain/sqa/tests/LoginTest.java"
    click RegTest "https://github.com/ebrahimhossaincse/Playwright-Data-Driven-Testing-With-Java-TestNG-And-Extent-Reports/blob/main/src/test/java/ebrahim/hossain/sqa/tests/RegistrationTest.java"
    click BaseDriver "https://github.com/ebrahimhossaincse/Playwright-Data-Driven-Testing-With-Java-TestNG-And-Extent-Reports/blob/main/src/test/java/ebrahim/hossain/sqa/basedriver/BaseDriver.java"
    click LoginPage "https://github.com/ebrahimhossaincse/Playwright-Data-Driven-Testing-With-Java-TestNG-And-Extent-Reports/blob/main/src/test/java/ebrahim/hossain/sqa/pages/LoginPage.java"
    click RegPage "https://github.com/ebrahimhossaincse/Playwright-Data-Driven-Testing-With-Java-TestNG-And-Extent-Reports/blob/main/src/test/java/ebrahim/hossain/sqa/pages/RegisterPage.java"
    click CommonMethods "https://github.com/ebrahimhossaincse/Playwright-Data-Driven-Testing-With-Java-TestNG-And-Extent-Reports/blob/main/src/test/java/ebrahim/hossain/sqa/utilities/CommonMethods.java"
    click ExcelUtils "https://github.com/ebrahimhossaincse/Playwright-Data-Driven-Testing-With-Java-TestNG-And-Extent-Reports/blob/main/src/test/java/ebrahim/hossain/sqa/utilities/ExcelUtils.java"
    click ExtentFactory "https://github.com/ebrahimhossaincse/Playwright-Data-Driven-Testing-With-Java-TestNG-And-Extent-Reports/blob/main/src/test/java/ebrahim/hossain/sqa/utilities/ExtentFactory.java"
    click TestData "https://github.com/ebrahimhossaincse/Playwright-Data-Driven-Testing-With-Java-TestNG-And-Extent-Reports/blob/main/testData/data.xlsx"
    click Reports "https://github.com/ebrahimhossaincse/Playwright-Data-Driven-Testing-With-Java-TestNG-And-Extent-Reports/blob/main/reports/Report.html"
    click Screenshots "https://github.com/ebrahimhossaincse/Playwright-Data-Driven-Testing-With-Java-TestNG-And-Extent-Reports/tree/main/screenshots"
    click TestOutput "https://github.com/ebrahimhossaincse/Playwright-Data-Driven-Testing-With-Java-TestNG-And-Extent-Reports/tree/main/test-output"
    click Config "https://github.com/ebrahimhossaincse/Playwright-Data-Driven-Testing-With-Java-TestNG-And-Extent-Reports/blob/main/pom.xml"

    %% Legend
    subgraph Legend["Legend"]
        L1["Test Execution"]:::testExecution
        L2["Page Objects"]:::pageObject
        L3["Utilities"]:::utility
        L4["Resources"]:::resource
        L5["Configuration"]:::config
    end
```
