# kamiljaneczek/c11n-testing architecture

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

- Interactive diagram: https://gitdiagram.com/kamiljaneczek/c11n-testing
- Repository: https://github.com/kamiljaneczek/c11n-testing

## Overview

##### Main Components Identification

The system should be represented with these key components:

a) Test Execution Layer
- Playwright Test Runner
- Cucumber Test Runner
- CLI Interface (test_runner/cli.ts)

b) Test Definition Layer
- Feature Files (features/*.feature)
- Step Definitions (step-definitions/*)
- E2E Tests (e2e/*)

c) Support Infrastructure
- Test Data Management (data/*)
- Library Components (lib/*)
- Configuration Management (config/*)

##### Component Relationships

**Test Execution Layer**
- ↓
**Test Definition Layer**
- ↓
**Support Infrastructure**
- ↓
**System Under Test (External)**

##### Specific Implementation Details

**┌─ Test Execution Layer ─────────────────┐**
- Playwright Runner                    │
- Cucumber Runner                      │
- CLI Interface                        │
- ┘
- ↓
**┌─ Test Definition Layer ────────────────┐**
- ┌─ Features ─┐  ┌─ E2E Tests ─┐       │
- Cucumber   │  │ API Tests   │       │
- Features   │  │ UI Tests    │       │
- ┘  └────────────┘        │
- ┌─ Step Definitions ─┐               │
- Case Worker     │               │
- Dispatcher      │               │
- Incident       │               │
- Portal         │               │
- ┘               │
- ┘
- ↓
**┌─ Support Infrastructure ──────────────┐**
- ┌─ Library ─┐  ┌─ Test Data ─┐       │
- API       │  │ Case Data   │       │
- Fixtures  │  │ User Data   │       │
- Controls  │  │ Portal Data │       │
- ┘  └────────────┘        │
- ┌─ Configuration ─┐                  │
- Environment    │                  │
- Playwright     │                  │
- Cucumber       │                  │
- ┘                  │
- ┘

##### Important Elements

a) Authentication Flow:
- How different user roles (Customer, Case Worker, Manager, Dispatcher) are handled
- API authentication with CLIENT_ID/CLIENT_SECRET

b) Test Data Management:
- Relationship between JSON schemas and test data
- How fixtures are used

c) Test Types:
- Distinguish between API and UI tests
- Parallel test execution capability

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph TestExecution[Test Execution Layer]
        PlaywrightRunner["Playwright Runner"]
        CucumberRunner["Cucumber Runner"]
        CLI["CLI Interface"]
    end

    subgraph TestDefinition[Test Definition Layer]
        subgraph Features[Features]
            CucumberFeatures["Cucumber Feature Files"]
        end
        
        subgraph E2ETests[E2E Tests]
            APITests["API Tests"]
            UITests["UI Tests"]
        end
        
        subgraph StepDefs[Step Definitions]
            CaseWorkerSteps["Case Worker Steps"]
            DispatcherSteps["Dispatcher Steps"]
            IncidentSteps["Incident Steps"]
            PortalSteps["Portal Steps"]
        end
    end

    subgraph Support[Support Infrastructure]
        subgraph Library[Library Components]
            APILib["API Library"]
            Fixtures["Test Fixtures"]
            Controls["UI Controls"]
            CucumberLib["Cucumber Integration"]
            SchemaLib["Schema Definitions"]
        end
        
        subgraph TestData[Test Data]
            CaseData["Case Data"]
            UserData["User Data"]
            PortalData["Portal Data"]
        end
        
        subgraph Config[Configuration]
            EnvConfig["Environment Config"]
            PlaywrightConfig["Playwright Config"]
            CucumberConfig["Cucumber Config"]
        end
    end

    %% Relationships
    TestExecution --> TestDefinition
    TestDefinition --> Support
    
    %% Click events
    click PlaywrightRunner "https://github.com/kamiljaneczek/c11n-testing/blob/main/playwright.config.ts"
    click CucumberRunner "https://github.com/kamiljaneczek/c11n-testing/blob/main/config/cucumber.js"
    click CLI "https://github.com/kamiljaneczek/c11n-testing/blob/main/test_runner/cli.ts"
    click CucumberFeatures "https://github.com/kamiljaneczek/c11n-testing/tree/main/features/"
    click StepDefs "https://github.com/kamiljaneczek/c11n-testing/tree/main/step-definitions/"
    click E2ETests "https://github.com/kamiljaneczek/c11n-testing/tree/main/e2e/"
    click APITests "https://github.com/kamiljaneczek/c11n-testing/tree/main/e2e/api/"
    click UITests "https://github.com/kamiljaneczek/c11n-testing/tree/main/e2e/incident/"
    click TestData "https://github.com/kamiljaneczek/c11n-testing/tree/main/data/"
    click Config "https://github.com/kamiljaneczek/c11n-testing/tree/main/config/"
    click EnvConfig "https://github.com/kamiljaneczek/c11n-testing/blob/main/.env-sample"
    click APILib "https://github.com/kamiljaneczek/c11n-testing/tree/main/lib/playwright/api/"
    click Controls "https://github.com/kamiljaneczek/c11n-testing/blob/main/lib/playwright/controls.ts"
    click Fixtures "https://github.com/kamiljaneczek/c11n-testing/blob/main/lib/playwright/fixtures.ts"
    click CucumberLib "https://github.com/kamiljaneczek/c11n-testing/tree/main/lib/cucumber/"
    click SchemaLib "https://github.com/kamiljaneczek/c11n-testing/tree/main/lib/schemas/"
    click UserData "https://github.com/kamiljaneczek/c11n-testing/blob/main/data/users.ts"
    click CaseData "https://github.com/kamiljaneczek/c11n-testing/tree/main/data/case/"
    click PortalData "https://github.com/kamiljaneczek/c11n-testing/tree/main/data/portal/"

    %% Styling
    classDef execution fill:#2374ab
    classDef definition fill:#2a9d8f
    classDef support fill:#e76f51
    classDef data fill:#f4a261
    classDef config fill:#e9c46a

    class PlaywrightRunner,CucumberRunner,CLI execution
    class CucumberFeatures,APITests,UITests,StepDefs,CaseWorkerSteps,DispatcherSteps,IncidentSteps,PortalSteps definition
    class Library,APILib,Fixtures,Controls,CucumberLib,SchemaLib support
    class TestData,CaseData,UserData,PortalData data
    class Config,EnvConfig,PlaywrightConfig,CucumberConfig config
```
