# rohitkr7/bdd_specflow_automation_framework architecture

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

- Interactive diagram: https://gitdiagram.com/rohitkr7/bdd_specflow_automation_framework
- Repository: https://github.com/rohitkr7/bdd_specflow_automation_framework

## Overview

##### Project Type and Purpose
- This is a “BDD Automation Framework using Specflow” written in C# (.NET Framework class library).
- It drives web-based test cases written in Gherkin and executed via Specflow’s test runner (e.g., MSTest/NUnit).

##### File Structure
- Top-level project file: BDD_Tutorial_classLib_netFramework.csproj (class library containing your step definitions and glue code).
- Directories:
- FeatureFiles – all “.feature” files (Gherkin scenarios) and their auto-generated code-behind.
- StepDefinitions – C# classes binding Gherkin steps to code.
- Objects – domain/helper classes (e.g., EmployeeDetails).
- Properties – standard .NET metadata.
- Configuration:
- packages.config – NuGet dependencies (Specflow, Selenium WebDriver, etc.).
- App.config – Specflow runner settings, test-run configuration.

##### Interactions and Data Flow
1. Test Runner triggers Specflow Engine.
2. Engine loads FeatureFiles → parses scenarios.
3. For each step, Engine invokes matching StepDefinitions.
4. StepDefinitions leverage:
– Domain/Helper Objects for business logic or data.
– WebDriver clients to drive browser actions.
5. Hooks (before/after scenarios) configure test environment.
6. Results flow back to Test Runner → Reports.

##### Architectural Patterns
- BDD Pattern: clearly delineates feature layer (Gherkin) from code.
- Separation of Concerns:
- Feature definitions vs. step implementations vs. domain objects.
- Data-Driven Testing: scenario outlines and external data mapping.
- Hook Mechanism: global setup/teardown.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Gherkin Layer"
        GF["Gherkin Feature Files"]:::domain
        GFB["Auto-generated Feature Code-Behind"]:::domain
    end

    subgraph "SpecFlow Engine"
        Parser["Specflow Parser & Binding Engine"]:::framework
        Runner["Test Runner Adapter"]:::framework
    end

    subgraph "Glue Code Layer"
        Steps["Step Definitions"]:::frontend
        Hooks["Global Hooks"]:::frontend
    end

    subgraph "Framework Utilities"
        Domain["Domain Objects / Helpers"]:::domain
    end

    subgraph "External Services"
        Driver["Browser Driver"]:::service
        AUT["Application Under Test"]:::service
    end

    subgraph "Configuration & Metadata"
        Proj["Project (.csproj)"]:::config
        AppConf["App.config"]:::config
        NuGet["packages.config"]:::config
        Assembly["AssemblyInfo"]:::config
        Readme["README.md"]:::config
    end

    Runner -->|"loads"| Parser
    Parser -->|"parses .feature"| GF
    GF -->|"generates codebehind"| GFB
    Parser -->|"matches steps"| Steps
    Steps -->|"uses domain/helpers"| Domain
    Steps -->|"drives browser"| Driver
    Driver -->|"controls"| AUT
    Hooks -->|"before/after scenarios"| Runner
    Proj -->|"defines project"| Parser
    AppConf -->|"configures runner"| Runner
    NuGet -->|"provides packages"| Parser

    click GF "https://github.com/rohitkr7/bdd_specflow_automation_framework/tree/master/FeatureFiles/"
    click GFB "https://github.com/rohitkr7/bdd_specflow_automation_framework/tree/master/FeatureFiles/"
    click Proj "https://github.com/rohitkr7/bdd_specflow_automation_framework/blob/master/BDD_Tutorial_classLib_netFramework.csproj"
    click AppConf "https://github.com/rohitkr7/bdd_specflow_automation_framework/blob/master/App.config"
    click NuGet "https://github.com/rohitkr7/bdd_specflow_automation_framework/blob/master/packages.config"
    click Steps "https://github.com/rohitkr7/bdd_specflow_automation_framework/tree/master/StepDefinitions/"
    click Hooks "https://github.com/rohitkr7/bdd_specflow_automation_framework/blob/master/StepDefinitions/Global_Hook.cs"
    click Domain "https://github.com/rohitkr7/bdd_specflow_automation_framework/blob/master/Objects/EmployeeDetails.cs"
    click Assembly "https://github.com/rohitkr7/bdd_specflow_automation_framework/blob/master/Properties/AssemblyInfo.cs"
    click Readme "https://github.com/rohitkr7/bdd_specflow_automation_framework/blob/master/README.md"

    classDef domain fill:#ccffcc,stroke:#333,stroke-width:1px
    classDef framework fill:#cce5ff,stroke:#333,stroke-width:1px
    classDef frontend fill:#ccffcc,stroke:#333,stroke-width:1px
    classDef service fill:#ffffcc,stroke:#333,stroke-width:1px
    classDef config fill:#ffebcc,stroke:#333,stroke-width:1px
```
