# qaf-tm/qaf architecture

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

- Interactive diagram: https://gitdiagram.com/qaf-tm/qaf
- Repository: https://github.com/qaf-tm/qaf

## Overview

##### Project Type and Purpose
- This is a multi-module Java-based automation framework designed for functional testing of web, mobile web, mobile native applications, as well as REST web services.
- The framework supports various test authoring paradigms (BDD, keyword driven, code-driven) and integrates with popular test management, continuous integration, and mobile device cloud systems.
- It is built around key testing technologies like TestNG, Selenium/Webdriver, Appium, and newer integrations such as Playwright.

##### Analyzing the File Structure
- The project is organized into several top-level modules – for example, “qaf-core”, “qaf-playwright”, “qaf-selenium”, “qaf-support-ws”, “qaf-support”, “qaf-testng”, “qaf-tools”, and “qaf-ws”. This clearly reflects a modular design where each module focuses on a specific aspect of test automation.
- Look out for shared configuration files (pom.xml, ivy.xml, build.xml), CI/CD configurations (.travis.yml, GitHub workflows) and common libraries in the “lib” directory.
- Within the modules, the “src/main/java” hierarchies exhibit further separation of concerns: core utilities, data management, UI drivers, reporting, step definitions, and integrations with external systems (e.g., REST, OAuth support).

##### Main Components
a. Core Engine (QAF-Core):

b. Test Execution and Driver Modules:
- QAF-TestNG: Represent this as the bridge between the framework and the actual test execution, handling TestNG integration, scenario management (BDD, Gherkin, keyword) and report generation.
- QAF-Selenium and QAF-Playwright: Show these modules as providing the UI automation drivers. They abstract Selenium/WebDriver and Playwright-based testing respectively, with components such as the driver factories, element locators, and command processors.
- QAF-Support and QAF-Support-WS: These components provide specialized steps and support libraries for web (and mobile web), mobile native and REST/web service testing. Illustrate their interactions with the core engine and test execution modules.

c. Additional Utilities and Tools:
- QAF-Tools: Indicate tools such as repository importers or property editors which enhance the extensibility and configuration of the framework.
- QAF-WS: Represent REST client utilities and web-service testing support.

d. External Services and Integrations:
- External integrations such as CI/CD (Jenkins, Bamboo, Travis CI as indicated by workflows and config files) and test management systems (QMetry, Rally, HP ALM, etc.).
- Optionally, highlight external device cloud services (Perfecto, Sauce Labs) and mobile device integration as interacting with the UI driver components.

##### Relationships and Interactions
- How configuration and data flow from utility components to the higher-level test steps.
- Integration points where support modules “qaf-support*” are plugged in for domain-specific actions.
- CI/CD interactions (using Maven builds, Travis CI, GitHub workflows) showing that the build process triggers test suite execution which then uses the QAF architecture to run tests and generate reports.

##### Architectural Patterns and Design Principles
- Abstraction layers: the framework abstracts driver implementations (Selenium, Playwright) from test case definitions.
- Use of design patterns such as Factory (e.g., DriverFactory in qaf-core, QAFWebDriverCommandProcessor), Listener/Observer (test event listeners in TestNG integration and logging/reporting), and perhaps a modular plugin design (with support libraries easily integrated).
- That extensibility and reusability are key principles—many modules are built to be interchanged or extended without impacting the core functionalities.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Presentation / Test Authoring Layer
    subgraph "Presentation / Test Authoring"
        A("Test Cases/Scenarios"):::presentation
    end

    %% Test Execution Layer
    subgraph "Test Execution Layer"
        B("QAF-TestNG"):::testExecution
    end

    %% Core Services Layer
    subgraph "Core Services Layer"
        C("QAF-Core"):::core
    end

    %% Driver / Integration Layer
    subgraph "Driver / Integration Layer"
        D("QAF-Selenium"):::drivers
        E("QAF-Playwright"):::drivers
        F("QAF-Support"):::drivers
        G("QAF-Support-WS"):::drivers
        H("QAF-WS"):::drivers
    end

    %% Utility & Tools Layer
    subgraph "Utility & Tools Layer"
        I("QAF-Tools"):::tools
    end

    %% External Services Layer
    subgraph "External Services Layer"
        J("CI/CD&TestManagement"):::external
    end

    %% Data Flow Connections
    A -->|"submitTests"| B
    B -->|"usesCore"| C
    B -->|"triggersUICmds"| D
    B -->|"triggersUICmds"| E
    B -->|"invokesDomainActions"| F
    B -->|"invokesWebServiceActions"| G
    B -->|"callsRESTAPIs"| H
    C -->|"configLogging"| D
    C -->|"configLogging"| E
    C -->|"configLogging"| F
    C -->|"configLogging"| G
    C -->|"configLogging"| H
    I -->|"enhancesCore"| C
    I -->|"extendsSupport"| F
    I -->|"extendsDrivers"| D
    C -->|"integratesExternal"| J
    B -->|"integratesExternal"| J

    %% Click Events for Component Mapping
    click C "https://github.com/qaf-tm/qaf/tree/master/qaf-core"
    click B "https://github.com/qaf-tm/qaf/tree/master/qaf-testng"
    click D "https://github.com/qaf-tm/qaf/tree/master/qaf-selenium"
    click E "https://github.com/qaf-tm/qaf/tree/master/qaf-playwright"
    click G "https://github.com/qaf-tm/qaf/tree/master/qaf-support-ws"
    click F "https://github.com/qaf-tm/qaf/tree/master/qaf-support"
    click I "https://github.com/qaf-tm/qaf/tree/master/qaf-tools"
    click H "https://github.com/qaf-tm/qaf/tree/master/qaf-ws"

    %% Styles
    classDef presentation fill:#f9c,stroke:#333,stroke-width:2px;
    classDef testExecution fill:#bbf,stroke:#333,stroke-width:2px;
    classDef core fill:#afa,stroke:#333,stroke-width:2px;
    classDef drivers fill:#ffa,stroke:#333,stroke-width:2px;
    classDef tools fill:#ddf,stroke:#333,stroke-width:2px;
    classDef external fill:#fdd,stroke:#333,stroke-width:2px;
```
