# shagun-mahajan-lab49/quantum-starter-kit architecture

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

- Interactive diagram: https://gitdiagram.com/shagun-mahajan-lab49/quantum-starter-kit
- Repository: https://github.com/shagun-mahajan-lab49/quantum-starter-kit

## Overview

##### Main Components
- Automation Test Code – This is the heart of the project located under “src/main/java” with two key packages:
- Pages (Page Object Models): Classes like ExpenseTrackerHomePage.java, ExpenseTrackerLoginPage.java, GooglePage.java.
- Steps (Cucumber Step Definitions): Files such as ExpenseTrackerSteps.java, GoogleStepDefs.java, and CommonStepsDefs.java that connect the feature files to the application actions.
- Feature Files – Under “src/main/resources/scenarios”, where Cucumber/Gherkin files (appium.feature, webSearch.feature, etc.) define the test scenarios.
- Configuration & Data Resources – This includes:
- “resources/application.properties” for basic project properties and credentials.
- Environment-specific config files under “resources/android” and “resources/ios” (e.g., env.properties and .loc locator files).
- TestNG config files in “resources/config” (like testng_appium.xml and testng_web.xml) that manage the test suites.
- Test data files (CSV, JSON, XLS) under “resources/data” and locator files (in “resources/common”) for UI identification.
- Log configuration files (log4j.properties, log4j2.properties, etc.)
- Build and CI/CD Integration:
- Maven’s pom.xml defines dependencies and build scripts.
- The .circleci directory for CI configuration confirms automated builds/integration.
- External Services:
- Integration with Perfecto Mobile’s cloud for executing tests on real devices and for reporting.

##### Out the Relationships & Interactions
- The TestNG XML configurations serve as the gateway to execution. They pick up scenarios from the “scenarios” directory and use parameters defined in the “application.properties” and environment config files for mobile/web test runs.
- During execution, the features written in plain English (Gherkin) pull in the corresponding step definitions (located in “steps”) that then interact with the Page Object Model classes (stored in “pages”) to perform tests.
- The resource layer (configuration files, object locators, test data) is loaded by both the test code and the QAF (Quality Automation Framework) library, providing a dynamic and configurable testing environment.
- The build process is handled by Maven and integrated within the CI pipeline (CircleCI), ensuring that every commit triggers a proper build and test run.
- Logging and reporting are managed via log4j configurations and Perfecto’s reporting dashboard, feeding back the execution results.

##### Architectural Patterns & Design Principles
- Separation of Concerns:
- There’s clear segregation between the test definitions (features), step definitions (logic that drives tests), and the page objects (UI mappings).
- Modularity:
- Different modules for web vs. mobile tests are evident in the different TestNG XML files and resource folders (android, ios).
- Configurability:
- The use of multiple property files and object repository (.loc) files reflects a design that favors externalizing configuration and enabling data-driven tests.
- Integration of CI/CD:

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External Entities
    subgraph "External Entities"
        DEV("Developer"):::external
        IDE("IDE (Eclipse/IntelliJ)"):::external
    end

    %% Build & CI/CD Orchestration
    subgraph "Build & CI/CD"
        MVN("Maven Build"):::ci
        CICD("CircleCI Pipeline"):::ci
    end

    %% Test Execution Orchestration
    subgraph "Test Orchestration"
        TNG("TestNG Configurations"):::orchestration
        FF("Cucumber Feature Files"):::orchestration
    end

    %% Test Code & Resources Layer
    subgraph "Test Code & Resources"
        SD("Step Definitions"):::code
        POM("Page Object Models"):::code
        APP("Application Properties"):::resource
        AND("Android Configurations"):::resource
        IOS("iOS Configurations"):::resource
        TD("Test Data"):::resource
        OBJ("Common Object Locators"):::resource
        LOG("Log Configurations"):::resource
    end

    %% External Services
    subgraph "External Services"
        PERF("Perfecto Cloud Integration"):::service
    end

    %% Connections from External Entities to Build & CI/CD
    DEV -->|"triggers build"| MVN
    DEV -->|"initiates tests via"| CICD
    IDE -->|"executes tests"| MVN

    %% Build & CI/CD triggers Test Orchestration
    MVN -->|"builds and runs"| TNG
    CICD -->|"triggers"| TNG

    %% Test Orchestration flows into Feature Files and Resources
    TNG -->|"loads"| FF
    APP -->|"configures"| TNG
    AND -->|"configures"| TNG
    IOS -->|"configures"| TNG
    TD -->|"provides data"| TNG
    OBJ -->|"provides locators"| TNG
    LOG -->|"logging setup"| TNG

    %% Feature Files drive Test Code Execution
    FF -->|"maps to"| SD
    SD -->|"invokes actions on"| POM

    %% External Service integration
    TNG -->|"reports to"| PERF

    %% Click Events
    click POM "https://github.com/shagun-mahajan-lab49/quantum-starter-kit/tree/master/src/main/java/com/quantum/pages"
    click SD "https://github.com/shagun-mahajan-lab49/quantum-starter-kit/tree/master/src/main/java/com/quantum/steps"
    click FF "https://github.com/shagun-mahajan-lab49/quantum-starter-kit/tree/master/src/main/resources/scenarios"
    click APP "https://github.com/shagun-mahajan-lab49/quantum-starter-kit/blob/master/resources/application.properties"
    click AND "https://github.com/shagun-mahajan-lab49/quantum-starter-kit/tree/master/src/main/resources/android"
    click IOS "https://github.com/shagun-mahajan-lab49/quantum-starter-kit/tree/master/src/main/resources/ios"
    click TNG "https://github.com/shagun-mahajan-lab49/quantum-starter-kit/tree/master/src/main/resources/config"
    click TD "https://github.com/shagun-mahajan-lab49/quantum-starter-kit/tree/master/src/main/resources/data"
    click OBJ "https://github.com/shagun-mahajan-lab49/quantum-starter-kit/tree/master/src/main/resources/common"
    click LOG "https://github.com/shagun-mahajan-lab49/quantum-starter-kit/tree/master/src/main/resources"
    click MVN "https://github.com/shagun-mahajan-lab49/quantum-starter-kit/blob/master/pom.xml"
    click CICD "https://github.com/shagun-mahajan-lab49/quantum-starter-kit/blob/master/.circleci"

    %% Styles
    classDef external fill:#ffcc99,stroke:#e68a00,stroke-width:2px;
    classDef orchestration fill:#ccffcc,stroke:#339966,stroke-width:2px;
    classDef code fill:#cce5ff,stroke:#3366cc,stroke-width:2px;
    classDef resource fill:#fff2cc,stroke:#e6b800,stroke-width:2px;
    classDef ci fill:#ffd1dc,stroke:#ff6699,stroke-width:2px;
    classDef service fill:#f2d9e6,stroke:#cc6699,stroke-width:2px;
```
