# tamizh138/automation-playground-selenium-appium architecture

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

- Interactive diagram: https://gitdiagram.com/tamizh138/automation-playground-selenium-appium
- Repository: https://github.com/tamizh138/automation-playground-selenium-appium

## Overview

##### Project type and purpose
- This is a multi-module automation framework template combining:
– A web-automation module (Selenium4 + BrowserStack)
– A mobile-automation module (Appium)
– A sample/demo application module (app)
- README confirms goals: provide a template for Selenium4, Appium, cloud execution, and beginner-friendly patterns (Page Object Model, driver abstraction).

##### File structure
- Top-level:
– settings.gradle.kts, gradle wrappers – multi-module Gradle build
– docs/ – Markdown design docs
– gradle.properties, libs.versions.toml – version management
- Sub-modules:
– WEBAutomation/ – src/main/java/com/refactorauto/pageobjects + src/test/java/com/refactorauto/tests → Selenium4 Page Objects, tests, driver/CloudProvider abstractions
– MobileAutomation/ – simple Java entry point under org.example.Main (Appium hooks go here)
– app/ – demo Java app under org.example.App (stand-in for SUT)

##### README for insights
- Mentions Selenium4, Appium, BrowserStack, CloudProvider strategy
- Links to detailed design docs under docs/ (Selenium4Framework.md, AppiumFramework.md)

##### Main components
a. Gradle Multi-module Build (root)
b. WEBAutomation module
- Page Objects layer (HomePage, LoginPage)
- Test layer (AbstractBaseTest, TestLoginActions, login.feature)
- Driver abstraction (DriverFactory, BrowserHandler, ChromeHandler, FireFoxHandler)
- CloudProvider strategy (CloudProviderInterface, BrowserStackProvider, LamdaTestProvider)
- Logging (log4j2.properties, TestStatusLogger)
c. MobileAutomation module
- Appium test harness (Main.java → orchestrates mobile sessions)
- Gradle scripts
d. Demo Application (app module)
- Application Under Test (App.java)
e. External Services
- Amazon.com (demo site)
- BrowserStack, LambdaTest (cloud execution platforms)
- Appium Server (for mobile device automation)

##### Relationships and interactions
- Tests (WEBAutomation, MobileAutomation) ←→ Gradle build orchestrates compile/test
- WEBAutomation tests → DriverFactory → BrowserHandler/CloudProvider → Browser instances on local or cloud
- MobileAutomation tests → Appium client libraries → Appium Server → Mobile device/emulator
- Tests read page objects, feature files; log results via TestStatusLogger
- Sample app/module is packaged/deployed if mobile tests target it; separate from web tests targeting Amazon.com

##### Architectural patterns and design principles
- Page Object Model for web tests (separate page locators & actions)
- Strategy Pattern for CloudProvider abstraction (interface + multiple implementations)
- Factory Pattern for driver selection (DriverFactory)
- Modularization via Gradle multi-module build

##### Relevant technologies/frameworks
- Selenium 4 (WebAutomation)
- Appium (MobileAutomation)
- JUnit/TestNG (test framework)
- Gradle Kotlin DSL (build scripts)
- BrowserStack, LambdaTest (cloud)
- log4j2 (logging)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Root Build
    Gradle["Gradle Multi-module Build"]:::module
    Gradle --> WEBA
    Gradle --> Mobile
    Gradle --> App
    Gradle --> Docs

    %% Modules
    subgraph "WEBAutomation Module" 
        WEBA["WEBAutomation"]:::module
        subgraph "Page Objects" 
            HomePage["HomePage.java"]:::artifact
            LoginPage["LoginPage.java"]:::artifact
        end
        subgraph "Test Layer"
            ABT["AbstractBaseTest.java"]:::artifact
            TLA["TestLoginActions.java"]:::artifact
            Feature["login.feature"]:::artifact
        end
        subgraph "Driver Abstraction"
            DriverFactory["DriverFactory.java"]:::artifact
            BrowserHandler["BrowserHandler.java"]:::artifact
            ChromeHandler["ChromeHandler.java"]:::artifact
            FireFoxHandler["FireFoxHandler.java"]:::artifact
            DriverIntf["Driver.java"]:::artifact
        end
        subgraph "CloudProvider Strategy"
            CPI["CloudProviderInterface.java"]:::artifact
            BSP["BrowserStackProvider.java"]:::artifact
            LTP["LamdaTestProvider.java"]:::artifact
        end
        subgraph "Logging"
            LogProps["log4j2.properties"]:::artifact
            Logger["TestStatusLogger.java"]:::artifact
        end
    end

    subgraph "MobileAutomation Module"
        Mobile["MobileAutomation"]:::module
        Main["Main.java"]:::artifact
        BuildMA["build.gradle.kts"]:::artifact
    end

    subgraph "Demo Application Module"
        AppMod["app"]:::module
        AppClass["App.java"]:::artifact
    end

    subgraph "Documentation" 
        Docs["docs/"]:::doc
    end

    %% External Services
    BrowserStack["BrowserStack"]:::external
    LambdaTest["LambdaTest"]:::external
    AppiumServer["Appium Server"]:::external
    Amazon["Amazon.com"]:::external

    %% Relationships
    WEBA --> HomePage
    WEBA --> LoginPage
    WEBA --> ABT
    WEBA --> TLA
    WEBA --> Feature
    TLA --> DriverFactory
    DriverFactory --> BrowserHandler
    DriverFactory --> ChromeHandler
    DriverFactory --> FireFoxHandler
    DriverFactory --> DriverIntf
    DriverFactory --> CPI
    CPI --> BSP
    CPI --> LTP
    TLA -->|"navigates to"| HomePage
    TLA -->|"performs login on"| LoginPage
    TLA --> Logger
    Logger --> LogProps
    TLA --> Amazon

    Mobile --> Main
    Main -->|"uses Appium"| AppiumServer
    Main --> AppClass

    AppMod --> AppClass

    Gradle -->|"build/test"| WEBA
    Gradle -->|"build/test"| Mobile
    Gradle -->|"build"| AppMod

    %% Cloud execution
    BSP --> BrowserStack
    LTP --> LambdaTest

    %% Click Events
    click Gradle "https://github.com/tamizh138/automation-playground-selenium-appium/blob/main/settings.gradle.kts"
    click Gradle "https://github.com/tamizh138/automation-playground-selenium-appium/blob/main/gradle.properties"
    click Gradle "https://github.com/tamizh138/automation-playground-selenium-appium/blob/main/gradle/libs.versions.toml"
    click Gradle "https://github.com/tamizh138/automation-playground-selenium-appium/blob/main/gradle/wrapper/gradle-wrapper.jar"
    click WEBA "https://github.com/tamizh138/automation-playground-selenium-appium/tree/main/WEBAutomation/"
    click HomePage "https://github.com/tamizh138/automation-playground-selenium-appium/blob/main/WEBAutomation/src/main/java/com/refactorauto/pageobjects/HomePage.java"
    click LoginPage "https://github.com/tamizh138/automation-playground-selenium-appium/blob/main/WEBAutomation/src/main/java/com/refactorauto/pageobjects/LoginPage.java"
    click ABT "https://github.com/tamizh138/automation-playground-selenium-appium/blob/main/WEBAutomation/src/test/java/com/refactorauto/tests/AbstractBaseTest.java"
    click TLA "https://github.com/tamizh138/automation-playground-selenium-appium/blob/main/WEBAutomation/src/test/java/com/refactorauto/tests/TestLoginActions.java"
    click Feature "https://github.com/tamizh138/automation-playground-selenium-appium/blob/main/WEBAutomation/src/test/resources/com/refactorauto/tests/login.feature"
    click DriverFactory "https://github.com/tamizh138/automation-playground-selenium-appium/blob/main/WEBAutomation/src/test/java/com/refactorauto/tests/driver/DriverFactory.java"
    click BrowserHandler "https://github.com/tamizh138/automation-playground-selenium-appium/blob/main/WEBAutomation/src/test/java/com/refactorauto/tests/driver/BrowserHandler.java"
    click ChromeHandler "https://github.com/tamizh138/automation-playground-selenium-appium/blob/main/WEBAutomation/src/test/java/com/refactorauto/tests/driver/ChromeHandler.java"
    click FireFoxHandler "https://github.com/tamizh138/automation-playground-selenium-appium/blob/main/WEBAutomation/src/test/java/com/refactorauto/tests/driver/FireFoxHandler.java"
    click DriverIntf "https://github.com/tamizh138/automation-playground-selenium-appium/blob/main/WEBAutomation/src/test/java/com/refactorauto/tests/driver/Driver.java"
    click CPI "https://github.com/tamizh138/automation-playground-selenium-appium/blob/main/WEBAutomation/src/test/java/com/refactorauto/tests/cloudpros/CloudProviderInterFace.java"
    click BSP "https://github.com/tamizh138/automation-playground-selenium-appium/blob/main/WEBAutomation/src/test/java/com/refactorauto/tests/cloudpros/BrowserStackProvider.java"
    click LTP "https://github.com/tamizh138/automation-playground-selenium-appium/blob/main/WEBAutomation/src/test/java/com/refactorauto/tests/cloudpros/LamdaTestProvider.java"
    click LogProps "https://github.com/tamizh138/automation-playground-selenium-appium/blob/main/WEBAutomation/src/main/resources/log4j2.properties"
    click Logger "https://github.com/tamizh138/automation-playground-selenium-appium/blob/main/WEBAutomation/src/test/java/com/refactorauto/tests/utils/TestStatusLogger.java"
    click Mobile "https://github.com/tamizh138/automation-playground-selenium-appium/tree/main/MobileAutomation/"
    click Main "https://github.com/tamizh138/automation-playground-selenium-appium/blob/main/MobileAutomation/src/main/java/org/example/Main.java"
    click BuildMA "https://github.com/tamizh138/automation-playground-selenium-appium/blob/main/MobileAutomation/build.gradle.kts"
    click AppMod "https://github.com/tamizh138/automation-playground-selenium-appium/tree/main/app/"
    click AppClass "https://github.com/tamizh138/automation-playground-selenium-appium/blob/main/app/src/main/java/org/example/App.java"
    click Docs "https://github.com/tamizh138/automation-playground-selenium-appium/blob/main/docs/README.md"
    click Docs "https://github.com/tamizh138/automation-playground-selenium-appium/blob/main/docs/Selenium4Framework.md"
    click Docs "https://github.com/tamizh138/automation-playground-selenium-appium/blob/main/docs/AppiumFramework.md"

    %% Styles
    classDef module fill:#ADD8E6,stroke:#000;
    classDef external fill:#98FB98,stroke:#000;
    classDef artifact fill:#FFA500,stroke:#000;
    classDef doc fill:#F0F0F0,stroke-dasharray: 5 5;
```
