# yogesh2511/specflowwithrestassuredframework architecture

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

- Interactive diagram: https://gitdiagram.com/yogesh2511/specflowwithrestassuredframework
- Repository: https://github.com/yogesh2511/specflowwithrestassuredframework

## Overview

##### Project type and purpose
- This is a BDD‐style API automation framework built on .NET (6/8), SpecFlow, RestSharp, and NUnit/xUnit.
- It drives Trello REST API scenarios (create boards, lists, cards, etc.) using Gherkin feature files, step definitions, a core API client layer, utilities for configuration/logging, and generates HTML reports via ExtentReports.

##### File structure
- Top‐level:
- README.md, solution file (.sln), NuGet packages.config
- “SpecFlowProjectRestAssured” root folder containing most code & config
- Key directories under SpecFlowProjectRestAssured:
- Base: BaseAPIClass.cs – central HTTP wrapper
- Features: .feature files (Gherkin) + auto‐generated .feature.cs
- StepDefinitions: mapping Gherkin steps to C# methods
- Hooks: SpecFlow hooks (before/after scenario) for setup/teardown
- TestData/Resources: JSON endpoints & schemas for validation
- TrelloApi.Core:
– Clients (BaseTrelloClient, TrelloService)
– Models (Requests/Responses)
– Services (BoardService, CardService, etc.)
– Utilities (ConfigManager, RequestFactory, ApiLogger, etc.)
- Utility: alias management, env‐validation, scenario‐context, logging
- appsettings.json / .env for API key/token/base URL
- bin/ obj/ for build artifacts & generated reports

##### README for additional insights
- Tech stack, BDD scenarios, reporting, configuration instructions, sample Gherkin.

##### Elements
- Clear labels: “Feature Files”, “Step Definitions”, “BaseAPIClass”, “RequestFactory”, “BoardService”, “Trello REST API”, etc.

##### Detail is key
- Don’t just show “API call”—break out RequestFactory, ConfigManager, ApiLogger.
- Separate clients (HTTP wrapper) from services (business operations).
- Hooks & ScenarioContextManager to show context initialization.
- Test Runner → SpecFlow Engine → Test execution path.
- TestData folder as a source for endpoint URLs and JSON schemas.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Test Runner Layer
    Runner["Test Runner\n(dotnet test/NUnit/xUnit)"]:::runner

    %% SpecFlow Engine
    SpecFlow["SpecFlow Engine"]:::runner

    %% Feature Layer
    Feature["Feature Files\n(Gherkin .feature)"]:::testArtifacts

    %% Step Definitions Layer
    StepDefs["Step Definitions"]:::testArtifacts

    %% Hooks & Scenario Context
    Hooks["Hooks"]:::util
    ContextManager["ScenarioContextManager"]:::util

    %% Framework Core Layer
    BaseAPI["BaseAPIClass"]:::core
    RequestFactory["RequestFactory"]:::core
    ConfigManager["ConfigManager"]:::core
    ApiLogger["ApiLogger"]:::core

    %% TrelloApi.Core Layer
    subgraph "TrelloApi.Core"
        BaseTrelloClient["BaseTrelloClient"]:::service
        TrelloServiceClient["TrelloService"]:::service
        BoardService["BoardService"]:::service
        CardService["CardService"]:::service
        ListService["ListService"]:::service
        RequestModels["Models: Requests"]:::service
        ResponseModels["Models: Responses"]:::service
        TrelloException["TrelloException"]:::service
    end

    %% Test Data Layer
    EndpointsJSON["Endpoints.json"]:::data
    JSONSchemas["JSON Schemas"]:::data

    %% Utility Module
    AliasUtility["AliasUtility"]:::util
    ConfigurationReader["ConfigurationReader"]:::util
    EndpointManager["EndpointManager"]:::util
    LoggerUtil["Logger"]:::util
    ValidateEnv["ValidateEnvironmentVariables"]:::util

    %% Configuration Files
    AppSettings["appsettings.json"]:::config
    EnvFile[".env"]:::config

    %% Reporting Module
    ReportsDir["Reports Directory"]:::report

    %% External Service
    TrelloAPI["Trello REST API"]:::external

    %% Connections
    Runner -->|triggers| SpecFlow
    SpecFlow -->|reads feature| Feature
    Feature -->|invokes| StepDefs
    StepDefs -->|calls| BaseAPI
    StepDefs -->|calls| BaseTrelloClient
    StepDefs -->|calls| BoardService
    StepDefs -->|calls| CardService
    StepDefs -->|calls| ListService

    BaseAPI -->|uses| RequestFactory
    BaseAPI -->|uses| ConfigManager
    BaseAPI -->|logs via| ApiLogger

    RequestFactory -->|reads| EndpointsJSON
    RequestFactory -->|validates| JSONSchemas
    ConfigManager -->|reads| AppSettings
    ConfigManager -->|reads| EnvFile

    BaseTrelloClient -->|builds client| BaseAPI
    TrelloServiceClient -->|extends| BaseTrelloClient

    BoardService -->|uses| BaseTrelloClient
    CardService -->|uses| BaseTrelloClient
    ListService -->|uses| BaseTrelloClient

    BaseTrelloClient -->|throws| TrelloException

    StepDefs -->|setup/teardown| Hooks
    StepDefs -->|share state| ContextManager

    ContextManager -->|stores| EndpointManager

    EndpointManager -->|reads| EndpointsJSON

    AliasUtility -->|provides| StepDefs
    ConfigurationReader -->|provides| ConfigManager
    LoggerUtil -->|logs| ApiLogger
    ValidateEnv -->|validates| EnvFile

    ApiLogger -->|captures| ReportsDir
    ReportsDir -->|contains| ExtentReports["ExtentReports HTML"]:::report

    BaseTrelloClient -->|HTTP calls| TrelloAPI
    TrelloServiceClient -->|HTTP calls| TrelloAPI
    BoardService -->|HTTP calls| TrelloAPI
    CardService -->|HTTP calls| TrelloAPI
    ListService -->|HTTP calls| TrelloAPI

    %% Click Events
    click Feature "https://github.com/yogesh2511/specflowwithrestassuredframework/tree/master/SpecFlowProjectRestAssured/Features"
    click StepDefs "https://github.com/yogesh2511/specflowwithrestassuredframework/tree/master/SpecFlowProjectRestAssured/StepDefinitions"
    click Hooks "https://github.com/yogesh2511/specflowwithrestassuredframework/blob/master/SpecFlowProjectRestAssured/Hooks/Hooks.cs"
    click ContextManager "https://github.com/yogesh2511/specflowwithrestassuredframework/blob/master/SpecFlowProjectRestAssured/Utility/ScenarioContextManager.cs"
    click BaseAPI "https://github.com/yogesh2511/specflowwithrestassuredframework/blob/master/SpecFlowProjectRestAssured/Base/BaseAPIClass.cs"
    click RequestFactory "https://github.com/yogesh2511/specflowwithrestassuredframework/blob/master/SpecFlowProjectRestAssured/TrelloApi.Core/Utilities/RequestFactory.cs"
    click ConfigManager "https://github.com/yogesh2511/specflowwithrestassuredframework/blob/master/SpecFlowProjectRestAssured/TrelloApi.Core/Utilities/ConfigManager.cs"
    click ApiLogger "https://github.com/yogesh2511/specflowwithrestassuredframework/blob/master/SpecFlowProjectRestAssured/TrelloApi.Core/Utilities/ApiLogger.cs"
    click BaseTrelloClient "https://github.com/yogesh2511/specflowwithrestassuredframework/blob/master/SpecFlowProjectRestAssured/TrelloApi.Core/Clients/BaseTrelloClient.cs"
    click TrelloServiceClient "https://github.com/yogesh2511/specflowwithrestassuredframework/blob/master/SpecFlowProjectRestAssured/TrelloApi.Core/Clients/TrelloService.cs"
    click BoardService "https://github.com/yogesh2511/specflowwithrestassuredframework/blob/master/SpecFlowProjectRestAssured/TrelloApi.Core/Services/BoardService.cs"
    click CardService "https://github.com/yogesh2511/specflowwithrestassuredframework/blob/master/SpecFlowProjectRestAssured/TrelloApi.Core/Services/CardService.cs"
    click ListService "https://github.com/yogesh2511/specflowwithrestassuredframework/blob/master/SpecFlowProjectRestAssured/TrelloApi.Core/Services/ListService.cs"
    click RequestModels "https://github.com/yogesh2511/specflowwithrestassuredframework/tree/master/SpecFlowProjectRestAssured/TrelloApi.Core/Models/Requests"
    click ResponseModels "https://github.com/yogesh2511/specflowwithrestassuredframework/tree/master/SpecFlowProjectRestAssured/TrelloApi.Core/Models/Responses"
    click TrelloException "https://github.com/yogesh2511/specflowwithrestassuredframework/blob/master/SpecFlowProjectRestAssured/TrelloApi.Core/Exceptions/TrelloException.cs"
    click EndpointsJSON "https://github.com/yogesh2511/specflowwithrestassuredframework/blob/master/SpecFlowProjectRestAssured/TestData/Resources/Endpoints.json"
    click JSONSchemas "https://github.com/yogesh2511/specflowwithrestassuredframework/tree/master/SpecFlowProjectRestAssured/TestData/Resources/Schemas"
    click AliasUtility "https://github.com/yogesh2511/specflowwithrestassuredframework/blob/master/SpecFlowProjectRestAssured/Utility/AliasUtility.cs"
    click ConfigurationReader "https://github.com/yogesh2511/specflowwithrestassuredframework/blob/master/SpecFlowProjectRestAssured/Utility/ConfigurationReader.cs"
    click EndpointManager "https://github.com/yogesh2511/specflowwithrestassuredframework/blob/master/SpecFlowProjectRestAssured/Utility/EndpointManager.cs"
    click LoggerUtil "https://github.com/yogesh2511/specflowwithrestassuredframework/blob/master/SpecFlowProjectRestAssured/Utility/Logger.cs"
    click ValidateEnv "https://github.com/yogesh2511/specflowwithrestassuredframework/blob/master/SpecFlowProjectRestAssured/Utility/ValidateEnvironmentVariables.cs"
    click AppSettings "https://github.com/yogesh2511/specflowwithrestassuredframework/blob/master/SpecFlowProjectRestAssured/appsettings.json"
    click EnvFile "https://github.com/yogesh2511/specflowwithrestassuredframework/blob/master/SpecFlowProjectRestAssured/.env"
    click ReportsDir "https://github.com/yogesh2511/specflowwithrestassuredframework/tree/master/SpecFlowProjectRestAssured/bin/Debug/net8.0/Reports"

    %% Styles
    classDef testArtifacts fill:#dae8fc,stroke:#6c8ebf
    classDef core fill:#d5e8d4,stroke:#82b366
    classDef service fill:#ffe6cc,stroke:#d79b00
    classDef external fill:#f2f2f2,stroke:#999999
    classDef data fill:#fff2cc,stroke:#d6b656
    classDef util fill:#e1bee7,stroke:#7b1fa2
    classDef config fill:#fce4ec,stroke:#c2185b
    classDef runner fill:#f8cecc,stroke:#b85450
    classDef report stroke-dasharray:5 5,stroke:#ff0000,fill:none
```
