# rajyenekal/appiumautomationframework architecture

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

- Interactive diagram: https://gitdiagram.com/rajyenekal/appiumautomationframework
- Repository: https://github.com/rajyenekal/appiumautomationframework

## Overview

##### Project type and purpose
- This is a Java-based Appium Automation Framework (an open-source test automation tool) organized as a Maven project. It is designed to run mobile UI tests (Android/iOS) against a Demo APK, with built-in reporting, logging, retry logic, screenshot capture, and scrolling utilities.

##### File structure
- Top-level files:
- pom.xml – Maven config/dependency management
- testng.xml – TestNG suite definition
- README.md – Project overview
- logs/, reports/, test-output/ – Execution logs and HTML reports
- src/main/java:
- pomPages/ – Page Object classes (ApiDemoPage, ViewsPage, BaseScreen)
- utilities/ – Helper classes (GestureUtils, WaitUtility)
- src/test/java:
- test/base/ – Test base classes (BaseTest, ExtentReportManager, RetryAnalyzer)
- tests/ – Test cases (TC001, TC002, TC003)
- Resources:
- log4j2.xml – Logging config
- target/ – Compiled artifacts and generated Maven reports

##### Key architecture insights from README
- Uses TestNG for test orchestration with retry analyzer
- ExtentReports for HTML test reports (with embedded screenshots)
- Log4j2 for logging
- Page Object Model design pattern
- Utilities for dynamic scrolling & waiting

##### Details
- Retry logic path for failed tests back into TestNG
- File-system outputs (reports/, logs/) as storage sinks

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External CI/Developer
    Developer["Developer/CI"]:::external

    %% Build & Dependency Manager
    subgraph "Build & Dependency Manager"
        Maven["Maven (pom.xml)"]:::build
    end

    %% Test Runner
    subgraph "Test Runner"
        TestNG["TestNG Engine (testng.xml)"]:::orchestration
    end

    %% Test Base Layer
    subgraph "Test Base Layer"
        BaseTest["BaseTest"]:::orchestration
        ExtentMgr["ExtentReportManager"]:::report
        RetryAnalyzer["RetryAnalyzer"]:::orchestration
    end

    %% Test Cases
    subgraph "Test Cases"
        TC001["TC001"]:::orchestration
        TC002["TC002"]:::orchestration
        TC003["TC003"]:::orchestration
    end

    %% Page Object Layer
    subgraph "Page Object Layer"
        ApiDemoPage["pomPages.ApiDemoPage"]:::page
        ViewsPage["pomPages.ViewsPage"]:::page
        BaseScreen["pomPages.BaseScreen"]:::page
    end

    %% Utility Layer
    subgraph "Utility Layer"
        GestureUtils["GestureUtils"]:::util
        WaitUtility["WaitUtility"]:::util
    end

    %% External Services
    subgraph "External Services"
        AppiumServer["Appium Server"]:::external
        MobileDevice["Mobile Device"]:::external
    end

    %% Reporting & Logging
    subgraph "Reporting & Logging"
        ExtentReportsNode["ExtentReports"]:::report
        Log4j2Node["Log4j2"]:::report
    end

    %% Output Directories
    subgraph "Outputs"
        Reports["reports/"]:::output
        TestOutput["test-output/"]:::output
        Logs["logs/"]:::output
    end

    %% Flows
    Developer -->|"mvn test"| Maven
    Maven -->|"invokes TestNG"| TestNG
    TestNG -->|"reads testng.xml"| BaseTest
    TestNG -->|spawns| TC001
    TestNG -->|spawns| TC002
    TestNG -->|spawns| TC003

    BaseTest -->|configures| ExtentMgr
    BaseTest -->|configures| Log4j2Node

    TC001 -->|executes| ApiDemoPage
    TC002 -->|executes| ViewsPage
    TC003 -->|executes| ViewsPage

    ApiDemoPage -->|uses| BaseScreen
    ViewsPage -->|uses| BaseScreen

    ApiDemoPage -->|delegates to| AppiumServer
    ViewsPage -->|delegates to| AppiumServer

    AppiumServer -->|controls| MobileDevice

    ApiDemoPage -->|invokes| GestureUtils
    ViewsPage -->|invokes| GestureUtils
    BaseTest -->|uses| WaitUtility

    TC001 -->|onFailure| RetryAnalyzer
    RetryAnalyzer -->|retries via| TestNG

    ExtentMgr -->|collects results| ExtentReportsNode
    Log4j2Node -->|writes logs| Logs
    GestureUtils -->|captures screenshot| ExtentReportsNode

    ExtentReportsNode -->|outputs to| Reports
    TestNG -->|outputs to| TestOutput

    %% Click Events
    click Maven "https://github.com/rajyenekal/appiumautomationframework/blob/main/pom.xml"
    click TestNG "https://github.com/rajyenekal/appiumautomationframework/blob/main/testng.xml"
    click BaseTest "https://github.com/rajyenekal/appiumautomationframework/blob/main/src/test/java/test/base/BaseTest.java"
    click ExtentMgr "https://github.com/rajyenekal/appiumautomationframework/blob/main/src/test/java/test/base/ExtentReportManager.java"
    click RetryAnalyzer "https://github.com/rajyenekal/appiumautomationframework/blob/main/src/test/java/test/base/RetryAnalyzer.java"
    click ApiDemoPage "https://github.com/rajyenekal/appiumautomationframework/blob/main/src/main/java/pomPages/ApiDemoPage.java"
    click ViewsPage "https://github.com/rajyenekal/appiumautomationframework/blob/main/src/main/java/pomPages/ViewsPage.java"
    click BaseScreen "https://github.com/rajyenekal/appiumautomationframework/blob/main/src/main/java/pomPages/BaseScreen.java"
    click GestureUtils "https://github.com/rajyenekal/appiumautomationframework/blob/main/src/main/java/utilities/GestureUtils.java"
    click WaitUtility "https://github.com/rajyenekal/appiumautomationframework/blob/main/src/main/java/utilities/WaitUtility.java"
    click TC001 "https://github.com/rajyenekal/appiumautomationframework/blob/main/src/test/java/tests/TC001.java"
    click TC002 "https://github.com/rajyenekal/appiumautomationframework/blob/main/src/test/java/tests/TC002.java"
    click TC003 "https://github.com/rajyenekal/appiumautomationframework/blob/main/src/test/java/tests/TC003.java"

    %% Styles
    classDef build fill:#add8e6,stroke:#000
    classDef orchestration fill:#90ee90,stroke:#000
    classDef page fill:#ffa500,stroke:#000
    classDef util fill:#ffdead,stroke:#000
    classDef external fill:#ff6347,stroke:#000
    classDef report fill:#dda0dd,stroke:#000
    classDef output fill:#f0e68c,stroke:#000
```
