# shivakumarhn/masterappiumframework architecture

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

- Interactive diagram: https://gitdiagram.com/shivakumarhn/masterappiumframework
- Repository: https://github.com/shivakumarhn/masterappiumframework

## Overview

##### Main project type and purpose
- This project is a mobile automation testing framework built using Appium. It implements a full-featured test automation architecture including parallel execution, reporting via ExtentReports, email notification via Java Mail API, programmatically managing the Appium server, and integration with Jenkins.
- Key functionalities include running tests on multiple devices/emulators (Android and iOS), capturing and archiving videos of tests, logging activities, reporting test execution results, and sending email notifications with attachments.

##### File structure to pinpoint architectural components
- Directories such as “src/main/java/com/appium” contain core framework classes (base pages, test classes, utilities, page objects, annotations, enums, manager classes, and report-related classes).
- The “src/test/java/com/appium/tests” directory holds the actual test cases written for specific app functionalities (LoginTests, ProductTests, etc.). This clearly indicates a page object model pattern.
- Configuration and resource files are in “src/main/resources” and “src/test/resources” (e.g., config.properties, log4j2.properties, app binaries, test data JSON, and XML files for expected data).
- Supporting directories like “ExtentReports”, “Videos”, and “ServerLogs” indicate storage for generated test execution output such as reports, screen recordings, and log files.
- The presence of “testng.xml” and variant XML files for specific devices (e.g. testng_pixel_3.xml, testng_pixel_4.xml) reflects the use of TestNG for test orchestration and parallel execution.

a. Test Execution Layer:
- TestNG Runner: Illustrated by the testng.xml configurations that trigger parallel testing.
- Test Classes: Specifically those in the “src/test” package.
- Page Object Model: Components such as LoginPage, ProductsPage, ProductDetailsPage, SettingsPage handling the UI interactions.

b. Framework Core:
- Base Classes: BaseTest and BasePage for common test functionalities.
- Manager Classes: DriverManager, DeviceNameManager, PlatformManager, DateTimeManager, and StringsManager manage underlying configurations, device specifics, and utility functions.
- Utility Classes: A collection including ScreenshotUtils, VideoRecordUtils, AppiumServerUtils (for programmatically starting/stopping Appium Server), and others which handle reporting, email sending (EmailSendUtils, java_Mail_API modules), and configuration management.
- Custom Annotations and Enums: For filtering and categorizing tests, such as custom annotations in the “annotations” package and enums (CategoryType, AuthorType, WaitStrategy).

c. Reporting and Logging:
- Reporting Infrastructure: Classes like ExtentReport, ExtentManager, and ExtentLogger in the “reports” package.
- Logs and Server Logs: Managed repositories such as “ServerLogs” and “logs” directories, and logging configurations in resources (log4j2.properties).
- Video Capture: Directory “Videos” stores media for failed test case recordings.

d. Integration & Deployment:
- Email Notification Service: Using Java Mail API (EmailConfig, EmailAttachmentsSender) to automatically send emails with attachments (ExtentReports zip).
- Jenkins Integration: The README details a Jenkins job setup for running the tests and sending email reports.
- External Dependencies: Integration with the Saucelabs sample app (provided in “src/test/resources/app”) and use of external libraries such as ExtentReports v5.0.9.

- Main components: Test Runner, Appium Server Manager, Base Test/Page Objects, Manager & Utility modules, and Reporting/Email integration.
- External dependency on the Saucelabs sample app and Jenkins integration for continuous integration and email dispatch workflow.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Test Execution Layer"
        A["TestNG Runner"]:::testExecution
        B["Test Classes"]:::testExecution
        C["Page Object Model"]:::testExecution
    end

    subgraph "Framework Core"
        D["Base Classes"]:::frameworkCore
        E["Manager Classes"]:::frameworkCore
        F["Utilities"]:::frameworkCore
        G["Custom Annotations"]:::frameworkCore
        H["Enums"]:::frameworkCore
    end

    subgraph "Reporting & Logging"
        I["Reporting Infrastructure"]:::reporting
        J["Logging"]:::reporting
        K["Video Capture"]:::reporting
    end

    subgraph "Integration & Deployment"
        L["Email Notification Service"]:::integration
        M["Jenkins Integration"]:::integration
        N["Saucelabs Sample App"]:::integration
        O["Configuration Files"]:::integration
    end

    M -->|"triggers"| A
    O -->|"configures"| A
    A -->|"triggers"| B
    B -->|"uses"| C
    C -->|"extends"| D
    B -->|"calls"| E
    B -->|"calls"| F
    B -->|"annotatedBy"| G
    B -->|"categorizedBy"| H
    D -->|"supports"| F
    F -->|"reportsTo"| I
    F -->|"logsTo"| J
    F -->|"captures"| K
    I -->|"sendsReport"| L
    O -->|"configures"| F
    N -->|"usedBy"| B

    classDef testExecution fill:#f9e79f,stroke:#f39c12,stroke-width:2px;
    classDef frameworkCore fill:#d2b4de,stroke:#8e44ad,stroke-width:2px;
    classDef reporting fill:#aed6f1,stroke:#2471a3,stroke-width:2px;
    classDef integration fill:#f5b7b1,stroke:#c0392b,stroke-width:2px;

    click A "https://github.com/shivakumarhn/masterappiumframework/blob/master/testng.xml"
    click A "https://github.com/shivakumarhn/masterappiumframework/blob/master/testng_pixel_3.xml"
    click A "https://github.com/shivakumarhn/masterappiumframework/blob/master/testng_pixel_4.xml"
    click B "https://github.com/shivakumarhn/masterappiumframework/tree/master/src/test/java/com/appium/tests"
    click C "https://github.com/shivakumarhn/masterappiumframework/tree/master/src/main/java/com/appium/pages"
    click D "https://github.com/shivakumarhn/masterappiumframework/tree/master/src/main/java/com/appium/base"
    click E "https://github.com/shivakumarhn/masterappiumframework/tree/master/src/main/java/com/appium/manager"
    click F "https://github.com/shivakumarhn/masterappiumframework/tree/master/src/main/java/com/appium/utils"
    click G "https://github.com/shivakumarhn/masterappiumframework/tree/master/src/main/java/com/appium/annotations"
    click H "https://github.com/shivakumarhn/masterappiumframework/tree/master/src/main/java/com/appium/enums"
    click I "https://github.com/shivakumarhn/masterappiumframework/tree/master/src/main/java/com/appium/reports"
    click I "https://github.com/shivakumarhn/masterappiumframework/tree/master/ExtentReports"
    click J "https://github.com/shivakumarhn/masterappiumframework/blob/master/src/main/resources/log4j2.properties"
    click K "https://github.com/shivakumarhn/masterappiumframework/tree/master/Videos"
    click L "https://github.com/shivakumarhn/masterappiumframework/tree/master/src/main/java/com/appium/java_Mail_API"
    click M "https://github.com/shivakumarhn/masterappiumframework/blob/master/README.md"
    click N "https://github.com/shivakumarhn/masterappiumframework/tree/master/src/test/resources/app"
    click O "https://github.com/shivakumarhn/masterappiumframework/blob/master/src/main/resources/config.properties"
```
