# mcdcorp/opentest architecture

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

- Interactive diagram: https://gitdiagram.com/mcdcorp/opentest
- Repository: https://github.com/mcdcorp/opentest

## Overview

##### Main Components
- Sync Server – This is a Node.js application (located under the “server” directory) that orchestrates test execution, exposes both an HTTP API and a web user interface, and coordinates communication with test actors.
- Test Actor – This is a Java application (found under the “actor” directory) and is further divided into submodules (e.g., “actor/actor”, “actor/appium”, “actor/base”, “actor/selenium”). These subcomponents handle different test actions (covering API, Appium for mobile, Selenium for web testing, and common base functionality). Multiple test actors can be deployed on various machines, even across different networks.
- Test Repository – Although not directly represented as a single “repository” folder in the file tree, the README describes a test repository with a defined directory structure (including macros, scripts, templates, and tests) that holds the test assets under source control.

##### Relationships & Interactions
- The Sync Server acts as the central controller by issuing test execution commands via its HTTP API.
- Test Actors register with and listen to the Sync Server; they then execute test steps (depending on whether it is web testing using Selenium, mobile testing using Appium, or other actions) and report results back.
- The Test Repository is used to store test definitions, scripts, and other assets and is used by the Sync Server to create test sessions.
- In addition, illustrate the connection between the Sync Server and the Test Repository to indicate how test assets flow into test sessions.

##### Architectural Patterns & Design Principles
- There is a clear separation of concerns between the orchestration layer (Node.js sync server) and the test execution layer (Java test actors). This separation supports distributed and parallel testing (test actors potentially on different networks).
- The architecture leverages an API-driven design (HTTP endpoints for starting, monitoring, and managing test sessions) and emphasizes extensibility (through custom test actions in various languages and modules).
- Design principle where test actors do not require direct connectivity initiated by the server; instead, the actors “pull” instructions, which is critical for handling firewalled or isolated environments.

##### Relevant Technologies, Frameworks, and Libraries
- Node.js and related modules for the Sync Server.
- Java and Maven for compiling and packaging the Test Actor components.
- Selenium (for web testing) and Appium (for mobile testing) are reflected in the “actor/selenium” and “actor/appium” directories respectively.
- Libraries for HTTP handling, logging, and serialization (with segments in “actor/base”), as well as testing frameworks indicated by the testing sources.
- Build and configuration management files (under “build”, “package.json”, “pom.xml”, etc.) that help in deploying the system.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Asset Source"
        TestRepo["Test Repository"]:::repo
    end

    subgraph "Orchestration Layer"
        SyncServer["Sync Server"]:::backend
    end

    subgraph "Test Execution Layer"
        ActorCore["Test Actor - Core"]:::actor
        ActorAppium["Test Actor - Appium Module"]:::actor
        ActorBase["Test Actor - Base Functionality"]:::actor
        ActorSelenium["Test Actor - Selenium Module"]:::actor
    end

    TestRepo -->|"asset retrieval"| SyncServer

    SyncServer -->|"HTTP_API:test commands"| ActorCore
    SyncServer -->|"HTTP_API:test commands"| ActorAppium
    SyncServer -->|"HTTP_API:test commands"| ActorBase
    SyncServer -->|"HTTP_API:test commands"| ActorSelenium

    ActorCore -->|"execution results"| SyncServer
    ActorAppium -->|"execution results"| SyncServer
    ActorBase -->|"execution results"| SyncServer
    ActorSelenium -->|"execution results"| SyncServer

    click SyncServer "https://github.com/mcdcorp/opentest/tree/master/server/"
    click ActorCore "https://github.com/mcdcorp/opentest/tree/master/actor/actor"
    click ActorAppium "https://github.com/mcdcorp/opentest/tree/master/actor/appium"
    click ActorBase "https://github.com/mcdcorp/opentest/tree/master/actor/base"
    click ActorSelenium "https://github.com/mcdcorp/opentest/tree/master/actor/selenium"
    click TestRepo "https://github.com/mcdcorp/opentest/tree/master/build/module-opentest/test-repo"

    classDef backend fill:#ADD8E6,stroke:#000,stroke-width:2px;
    classDef actor fill:#90EE90,stroke:#000,stroke-width:2px;
    classDef repo fill:#FFCC99,stroke:#000,stroke-width:2px;
```
