# swapnilgirishpawar/ios-scheduling-automation-fork architecture

> Architecture diagram of the GitHub repository swapnilgirishpawar/ios-scheduling-automation-fork, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-08-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/swapnilgirishpawar/ios-scheduling-automation-fork
- Repository: https://github.com/swapnilgirishpawar/ios-scheduling-automation-fork

## Overview

##### Project Type and Purpose
- This is a test-automation framework (an open-source tool for iOS app testing)
- Purpose: Provide reusable, configurable, end-to-end mobile UI and API tests using Appium and TestNG

##### Main Architectural Layers and Components
a. Test Orchestration
- TestNG Runner
- XML Suite Definitions (under XMLRunners/)
- Maven (pom.xml)
b. Core Framework
- BaseClass Layer
– Capabilities.java (Appium capabilities)
– Config.java (environment & credentials)
– Hooks.java (TestNG @Before/@After initializations)
- Page Object Layer (src/test/java/Pages/)
– Calendar, Contacts, Login, Services, Settings sub-packages
– Centralizes locators and page actions
- API Manager Layer (src/test/java/API/)
– Encapsulates direct API calls (AccountManager, AppointmentServiceManager, etc.)
- Utilities (src/test/java/Utils/)
– CommonFunctions, APIUtils (TokenFetcher, ApiService), SheetsQuickstart, etc.
c. Test Suites
- Functional Suites (src/test/java/TestSuite/)
- Regression Suites (src/test/java/RegressionSuite/)
- OfflineSyncTests, Regressions, Services, Settings, etc.
d. Resources & Configuration
- JSON Test Data (src/test/resources/JSONs/)
- log4j2.xml (logging configuration)
e. Reporting & Artifacts
- Extent Reports (HTML outputs, screenshots)
- emailable-report.html
f. External Dependencies
- Appium Server
- iOS Simulators / Real Devices (via Xcode)
- CI/CD Server (e.g., Jenkins)
- Version Control (Git)

##### Relationships and Data Flow
1. Developer or CI server invokes Maven’s `mvn test`
2. Maven loads pom.xml, resolves dependencies, runs TestNG
3. TestNG reads XML suite files (XMLRunners/*.xml) → schedules test classes
4. Hooks initialize Appium driver (Capabilities + Config) against Appium Server
5. Test methods invoke Page Objects and/or API Managers and Helpers from Utils
6. Page Objects perform UI interactions on iOS Simulator/Device
7. API Managers make REST calls to backend services as needed
8. Utilities handle auxiliary tasks (data fetching, token management, screenshots)
9. Hooks capture test results, logs, screenshots, generate Extent Reports
10. Reports and logs are archived and surfaced via CI

##### Architectural Patterns and Principles
- Layered (Separation of Concerns: Test Orchestration → Base Classes → Page Objects/API → Utils)
- Page Object Model (POM) for UI encapsulation
- Keyword/Modular reusability across projects
- Configuration-driven environments (Local, RemoteBranch, Master)
- Data-driven testing via JSON resources

##### Essential Elements to Capture
- TestNG Runner & XML suite definitions
- Maven build & dependency graph
- BaseClass initialization (Capabilities, Config, Hooks)
- Page Object & API Manager layers
- Utils layer (TokenFetcher, CommonFunctions, SheetsQuickstart)
- Resource files (JSONs, log4j2.xml)
- External systems (Appium Server, iOS Device, CI/CD)
- Reporting output path and artifacts

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Test Orchestration Layer
    subgraph "Test Orchestration"
        direction TB
        Maven["pom.xml"]:::orchestration
        TestNG["TestNG Runner"]:::orchestration
        XML["XML Suite Definitions"]:::orchestration
    end

    %% Core Framework Layer
    subgraph "Core Framework"
        direction TB
        subgraph "BaseClass Layer"
            direction TB
            Capabilities["Capabilities.java"]:::core
            Config["Config.java"]:::core
            Hooks["Hooks.java"]:::core
        end
        subgraph "Page Object Layer"
            direction TB
            Calendar["Calendar Pages"]:::core
            Contacts["Contacts Pages"]:::core
            Login["Login Pages"]:::core
            Services["Services Pages"]:::core
            Settings["Settings Pages"]:::core
        end
        subgraph "API Manager Layer"
            direction TB
            AccountMgr["AccountManager.java"]:::core
            AppointmentMgr["AppointmentServiceManager.java"]:::core
            CountryMgr["CountryServiceManager.java"]:::core
            CustomerMgr["CustomerServiceManager.java"]:::core
            EventMgr["EventManager.java"]:::core
            MailosaurMgr["MailosaurServiceManager.java"]:::core
            OffHoursMgr["OffHoursDoubleBookingManager.java"]:::core
            ReviewMgr["ReviewServiceManager.java"]:::core
            ServiceClassMgr["ServiceClassManager.java"]:::core
            StaffMgr["StaffServiceManager.java"]:::core
        end
    end

    %% Utilities Layer
    subgraph "Utilities"
        direction TB
        CommonFunctions["CommonFunctions.java"]:::utils
        CommonUtils["CommonUtils.java"]:::utils
        AppointmentFunctions["AppointmentFunctions.java"]:::utils
        AccountLoginHandler["AccountLoginHandler.java"]:::utils
        SheetsQuickstart["SheetsQuickstart.java"]:::utils
        subgraph "APIUtils"
            direction TB
            ApiService["ApiService.java"]:::utils
            TokenFetcher["TokenFetcher.java"]:::utils
        end
    end

    %% Test Suites
    subgraph "Test Suites"
        direction TB
        Functional["Functional Suites"]:::core
        Regression["Regression Suites"]:::core
        Offline["Offline Sync Tests"]:::core
    end

    %% Resources & Configuration
    subgraph "Resources & Configuration"
        direction TB
        JSONs["JSON Test Data"]:::core
        Logging["log4j2.xml"]:::core
    end

    %% Reporting & Artifacts
    Reports["Extent & TestNG Reports"]:::core

    %% External Systems
    subgraph "External Dependencies"
        direction TB
        AppiumServer["Appium Server"]:::external
        IOSDevice["iOS Simulator/Device"]:::external
        CI["CI/CD Server"]:::external
        Git["Version Control (Git)"]:::external
    end

    %% Data Flow
    CI -->|"invoke mvn test"| Maven
    Maven -->|"runs TestNG"| TestNG
    TestNG -->|"reads XML suites"| XML
    XML -->|"schedule tests"| Hooks
    Hooks -->|"init driver"| Capabilities
    Hooks -->|"load config"| Config
    Hooks -->|"connect to"| AppiumServer
    AppiumServer -->|"start session"| IOSDevice
    Hooks -->|"execute tests"| Calendar
    Hooks -->|"execute tests"| Contacts
    Hooks -->|"execute tests"| Login
    Hooks -->|"execute tests"| Services
    Hooks -->|"execute tests"| Settings
    Hooks -->|"invoke API calls"| AccountMgr
    Hooks -->|"invoke API calls"| AppointmentMgr
    AccountMgr -->|"REST call"| JSONs
    AppointmentMgr -->|"REST call"| JSONs
    Calendar -->|"UI actions"| IOSDevice
    Services -->|"UI actions"| IOSDevice
    ApiService -->|"token/API helper"| AccountMgr
    TokenFetcher -->|"fetch token"| ApiService
    CommonFunctions --> Hooks
    CommonUtils --> Hooks
    AppointmentFunctions --> Hooks
    AccountLoginHandler --> Hooks
    SheetsQuickstart --> Hooks
    Hooks -->|"capture results"| Reports
    Reports -->|"archive/logs"| CI

    %% Click Events
    click Maven "https://github.com/swapnilgirishpawar/ios-scheduling-automation-fork/blob/master/pom.xml"
    click XML "https://github.com/swapnilgirishpawar/ios-scheduling-automation-fork/tree/master/XMLRunners/"
    click Capabilities "https://github.com/swapnilgirishpawar/ios-scheduling-automation-fork/blob/master/src/test/java/BaseClass/Capabilities.java"
    click Config "https://github.com/swapnilgirishpawar/ios-scheduling-automation-fork/blob/master/src/test/java/BaseClass/Config.java"
    click Hooks "https://github.com/swapnilgirishpawar/ios-scheduling-automation-fork/blob/master/src/test/java/BaseClass/Hooks.java"
    click Calendar "https://github.com/swapnilgirishpawar/ios-scheduling-automation-fork/tree/master/src/test/java/Pages/Calendar/"
    click Contacts "https://github.com/swapnilgirishpawar/ios-scheduling-automation-fork/tree/master/src/test/java/Pages/Contacts/"
    click Login "https://github.com/swapnilgirishpawar/ios-scheduling-automation-fork/tree/master/src/test/java/Pages/Login/"
    click Services "https://github.com/swapnilgirishpawar/ios-scheduling-automation-fork/tree/master/src/test/java/Pages/Services/"
    click Settings "https://github.com/swapnilgirishpawar/ios-scheduling-automation-fork/tree/master/src/test/java/Pages/Settings/"
    click AccountMgr "https://github.com/swapnilgirishpawar/ios-scheduling-automation-fork/blob/master/src/test/java/API/AccountManager.java"
    click AppointmentMgr "https://github.com/swapnilgirishpawar/ios-scheduling-automation-fork/blob/master/src/test/java/API/AppointmentServiceManager.java"
    click CountryMgr "https://github.com/swapnilgirishpawar/ios-scheduling-automation-fork/blob/master/src/test/java/API/CountryServiceManager.java"
    click CustomerMgr "https://github.com/swapnilgirishpawar/ios-scheduling-automation-fork/blob/master/src/test/java/API/CustomerServiceManager.java"
    click EventMgr "https://github.com/swapnilgirishpawar/ios-scheduling-automation-fork/blob/master/src/test/java/API/EventManager.java"
    click MailosaurMgr "https://github.com/swapnilgirishpawar/ios-scheduling-automation-fork/blob/master/src/test/java/API/MailosaurServiceManager.java"
    click OffHoursMgr "https://github.com/swapnilgirishpawar/ios-scheduling-automation-fork/blob/master/src/test/java/API/OffHoursDoubleBookingManager.java"
    click ReviewMgr "https://github.com/swapnilgirishpawar/ios-scheduling-automation-fork/blob/master/src/test/java/API/ReviewServiceManager.java"
    click ServiceClassMgr "https://github.com/swapnilgirishpawar/ios-scheduling-automation-fork/blob/master/src/test/java/API/ServiceClassManager.java"
    click StaffMgr "https://github.com/swapnilgirishpawar/ios-scheduling-automation-fork/blob/master/src/test/java/API/StaffServiceManager.java"
    click ApiService "https://github.com/swapnilgirishpawar/ios-scheduling-automation-fork/blob/master/src/test/java/Utils/APIUtils/ApiService.java"
    click TokenFetcher "https://github.com/swapnilgirishpawar/ios-scheduling-automation-fork/blob/master/src/test/java/Utils/APIUtils/TokenFetcher.java"
    click CommonFunctions "https://github.com/swapnilgirishpawar/ios-scheduling-automation-fork/blob/master/src/test/java/Utils/CommonFunctions.java"
    click CommonUtils "https://github.com/swapnilgirishpawar/ios-scheduling-automation-fork/blob/master/src/test/java/Utils/CommonUtils.java"
    click AppointmentFunctions "https://github.com/swapnilgirishpawar/ios-scheduling-automation-fork/blob/master/src/test/java/Utils/AppointmentFunctions.java"
    click AccountLoginHandler "https://github.com/swapnilgirishpawar/ios-scheduling-automation-fork/blob/master/src/test/java/Utils/AccountLoginHandler.java"
    click SheetsQuickstart "https://github.com/swapnilgirishpawar/ios-scheduling-automation-fork/blob/master/src/test/java/Utils/SheetsQuickstart.java"
    click Functional "https://github.com/swapnilgirishpawar/ios-scheduling-automation-fork/tree/master/src/test/java/TestSuite/"
    click Regression "https://github.com/swapnilgirishpawar/ios-scheduling-automation-fork/tree/master/src/test/java/TestSuite/Regressions/"
    click Regression "https://github.com/swapnilgirishpawar/ios-scheduling-automation-fork/tree/master/src/test/java/RegressionSuite/"
    click Offline "https://github.com/swapnilgirishpawar/ios-scheduling-automation-fork/tree/master/src/test/java/TestSuite/OfflineSyncTests/"
    click JSONs "https://github.com/swapnilgirishpawar/ios-scheduling-automation-fork/tree/master/src/test/resources/JSONs/"
    click Logging "https://github.com/swapnilgirishpawar/ios-scheduling-automation-fork/blob/master/src/test/resources/log4j2.xml"

    %% Styles
    classDef orchestration fill:#e0f7e9,stroke:#2e7d32,color:#2e7d32;
    classDef core fill:#e3f2fd,stroke:#1565c0,color:#1565c0;
    classDef utils fill:#fff3e0,stroke:#ef6c00,color:#ef6c00;
    classDef external fill:#eceff1,stroke:#607d8b,color:#607d8b;
```
