# giulong/spectrum architecture

> Architecture diagram of the GitHub repository giulong/spectrum, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/giulong/spectrum
- Repository: https://github.com/giulong/spectrum

## Overview

a. Primary Flow:
- Test Classes -> Spectrum Core -> Driver Management -> Browser/Mobile Automation
- ↓
- Reporting System
- ↓
- Notification System

b. Configuration Flow:
- YAML Configuration -> Configuration Management -> All Components

##### Detailed Component Breakdown

a. Driver Management Layer:
- Browser Drivers (Chrome, Firefox, Edge, Safari)
- Mobile Drivers (Android, iOS, Espresso, XCUITest)
- Grid Support

b. Test Execution Layer:
- Test Context Management
- Page Object Support
- Web Element Handling
- JavaScript Execution

c. Reporting Layer:
- Event Dispatching
- Report Generation
- Video Recording
- Coverage Analysis

##### Integration Points

- How test classes integrate with the framework
- How the framework interfaces with Selenium/Appium
- How reporting components collect and process data
- How notifications are triggered and delivered

##### Key Technical Elements to Highlight

- YAML Configuration System
- Event-Driven Architecture
- Plugin System
- File Providers
- Test Book Parsers

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles and Classes
    classDef core fill:#b3d1ff,stroke:#4d88ff
    classDef integration fill:#c2f0c2,stroke:#5cd65c
    classDef reporting fill:#ffd9b3,stroke:#ffaa80
    classDef notification fill:#d9b3ff,stroke:#b366ff
    classDef config fill:#f2f2f2,stroke:#808080
    classDef storage fill:#f2f2f2,stroke:#808080,shape:cylinder
    
    %% Core Framework Components
    subgraph CoreFramework
        Core["Spectrum Core"]:::core
        Config["Configuration Management"]:::config
        DriverMgmt["Driver Management"]:::core
        TestExec["Test Execution Engine"]:::core
    end
    
    %% Test Integration Components
    subgraph TestIntegration
        JUnit["JUnit 5 Integration"]:::integration
        Selenium["Selenium 4 Integration"]:::integration
        Appium["Appium Integration"]:::integration
        Grid["Selenium Grid"]:::integration
    end
    
    %% Reporting System Components
    subgraph ReportingSystem
        ExtentReports["HTML Reports\n(ExtentReports)"]:::reporting
        VideoRec["Video Recording"]:::reporting
        Coverage["Coverage Reports"]:::reporting
        TestBook["TestBook Integration"]:::reporting
    end
    
    %% Notification System Components
    subgraph NotificationSystem
        Mail["Mail Notifications"]:::notification
        Slack["Slack Integration"]:::notification
    end
    
    %% Storage Components
    YAMLConfig[("YAML Configuration")]:::storage
    
    %% Relationships
    YAMLConfig --> Config
    Config --> Core
    Core --> DriverMgmt
    DriverMgmt --> |Browser/Mobile Control| TestExec
    
    TestExec --> JUnit
    TestExec --> Selenium
    TestExec --> Appium
    TestExec --> Grid
    
    Core --> ReportingSystem
    ReportingSystem --> NotificationSystem
    
    %% Click Events
    click Core "https://github.com/giulong/spectrum/tree/develop/spectrum/src/main/java/io/github/giulong/spectrum/"
    click Config "https://github.com/giulong/spectrum/blob/develop/spectrum/src/main/java/io/github/giulong/spectrum/utils/Configuration.java"
    click DriverMgmt "https://github.com/giulong/spectrum/tree/develop/spectrum/src/main/java/io/github/giulong/spectrum/drivers/"
    click TestExec "https://github.com/giulong/spectrum/blob/develop/spectrum/src/main/java/io/github/giulong/spectrum/SpectrumTest.java"
    click Appium "https://github.com/giulong/spectrum/tree/develop/it-appium/"
    click Grid "https://github.com/giulong/spectrum/tree/develop/it-grid/"
    click JUnit "https://github.com/giulong/spectrum/tree/develop/spectrum/src/main/java/io/github/giulong/spectrum/extensions/"
    click ExtentReports "https://github.com/giulong/spectrum/blob/develop/spectrum/src/main/java/io/github/giulong/spectrum/utils/ExtentReporter.java"
    click VideoRec "https://github.com/giulong/spectrum/tree/develop/spectrum/src/main/java/io/github/giulong/spectrum/utils/video/"
    click TestBook "https://github.com/giulong/spectrum/tree/develop/spectrum/src/main/java/io/github/giulong/spectrum/utils/testbook/"
    click Mail "https://github.com/giulong/spectrum/blob/develop/spectrum/src/main/java/io/github/giulong/spectrum/utils/events/MailConsumer.java"
    click Slack "https://github.com/giulong/spectrum/blob/develop/spectrum/src/main/java/io/github/giulong/spectrum/utils/events/SlackConsumer.java"
    
    %% Legend
    subgraph Legend
        L1["Core Components"]:::core
        L2["Integration Components"]:::integration
        L3["Reporting Components"]:::reporting
        L4["Notification Components"]:::notification
        L5["Configuration"]:::config
    end
```
