# senakorkmaz/test-automation-architecture architecture

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

- Interactive diagram: https://gitdiagram.com/senakorkmaz/test-automation-architecture
- Repository: https://github.com/senakorkmaz/test-automation-architecture

## Overview

##### Main Components
- Test Runner & Configuration: Include the Playwright configuration (playwright.config.js) and package.json, which manages dependencies.
- Testing Modalities: Separate the tests directory into three sub-components:
- BDD Tests (using Cucumber): Represent components such as features (login.feature), step definitions (loginSteps.js), and the World class (world.js).
- DDT Tests: Represent the DDT test file (loginDDT.spec.js) and the associated data.
- POM Tests: Represent the POM test (loginPOMTest.spec.js).
- Page Objects: Represent the logic encapsulated in the pages directory (e.g., loginPage.js) that serves as the interface for interacting with application screens.
- Test Data: Represent external test data stored in the testData directory (users.json) which drives the DDT tests.

##### Out Relationships and Data Flows
- Configuration Component (playwright.config.js) initializes the testing framework and defines how tests run.
- The Test Runner (invoked by Playwright and Cucumber CLI commands) orchestrates the execution of tests.

##### Architectural Patterns and Design Principles
- Separation of Concerns: Each testing modality (BDD, DDT, POM) is isolated in its own directory, representing a clean separation that allows independent evolution and testing of different methodologies.
- Reusability & Maintainability: The Page Object Model is designed as a reusable component for managing UI interactions.
- Modularity: Using external data via the DDT approach (users.json) emphasizes modular configurations that can easily be updated without modifying test logic.

##### Including Technologies, Frameworks, and Dependencies
- You might also denote the role of Playwright commands (e.g., “npx playwright test” for POM & DDT and “npx cucumber-js” for BDD tests) to reinforce the separation of testing strategies.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Test Runner & Configuration Subgraph
    subgraph "Test Runner & Configuration"
        configPkg["package.json"]:::config
        configPW["playwright.config.js"]:::config
    end

    %% BDD Tests Subgraph
    subgraph "BDD Tests"
        bddConfig["cucumber.js"]:::bdd
        bddFeature["login.feature"]:::bdd
        bddSteps["loginSteps.js"]:::bdd
        bddWorld["world.js"]:::bdd
    end

    %% DDT Tests Section
    ddtTest["loginDDT.spec.js"]:::ddt
    testData["users.json"]:::support

    %% POM Tests Section
    pomTest["loginPOMTest.spec.js"]:::pom
    pageObj["loginPage.js"]:::support

    %% Connections from Configuration to Testing Modalities
    configPkg -->|"triggers"| bddConfig
    configPkg -->|"triggers"| ddtTest
    configPkg -->|"triggers"| pomTest

    %% BDD Flow
    bddConfig -->|"initializes"| bddFeature
    bddFeature -->|"mapsTo"| bddSteps
    bddSteps -->|"uses"| bddWorld

    %% DDT Flow
    ddtTest -->|"reads"| testData

    %% POM Flow
    pomTest -->|"calls"| pageObj

    %% Click Events for Test Runner & Configuration
    click configPkg "https://github.com/senakorkmaz/test-automation-architecture/blob/main/package.json"
    click configPW "https://github.com/senakorkmaz/test-automation-architecture/blob/main/playwright.config.js"

    %% Click Events for BDD Tests
    click bddFeature "https://github.com/senakorkmaz/test-automation-architecture/blob/main/tests/bddTests/features/login.feature"
    click bddSteps "https://github.com/senakorkmaz/test-automation-architecture/blob/main/tests/bddTests/steps/loginSteps.js"
    click bddWorld "https://github.com/senakorkmaz/test-automation-architecture/blob/main/tests/bddTests/world.js"
    click bddConfig "https://github.com/senakorkmaz/test-automation-architecture/blob/main/tests/bddTests/cucumber.js"

    %% Click Events for DDT Tests
    click ddtTest "https://github.com/senakorkmaz/test-automation-architecture/blob/main/tests/ddtTests/loginDDT.spec.js"
    click testData "https://github.com/senakorkmaz/test-automation-architecture/blob/main/testData/users.json"

    %% Click Events for POM Tests and Page Objects
    click pomTest "https://github.com/senakorkmaz/test-automation-architecture/blob/main/tests/pomTests/loginPOMTest.spec.js"
    click pageObj "https://github.com/senakorkmaz/test-automation-architecture/blob/main/pages/loginPage.js"

    %% Styles
    classDef config fill:#f9e79f,stroke:#d4ac0d,stroke-width:2px
    classDef bdd fill:#aed6f1,stroke:#2980b9,stroke-width:2px
    classDef ddt fill:#d5f5e3,stroke:#27ae60,stroke-width:2px
    classDef pom fill:#fadbd8,stroke:#c0392b,stroke-width:2px
    classDef support fill:#e8daef,stroke:#8e44ad,stroke-width:2px
```
