# savianok/pw-ploom-tests architecture

> Architecture diagram of the GitHub repository savianok/pw-ploom-tests, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/savianok/pw-ploom-tests
- Repository: https://github.com/savianok/pw-ploom-tests

## Overview

##### Project type and purpose
- This is an end-to-end (E2E) testing suite written in TypeScript using the Playwright framework. Its sole responsibility is to automate browser interactions against a web application (the System Under Test), organize test logic into reusable page objects and fixtures, and produce test reports.

##### File structure
- Top-level files
- package.json / package-lock.json – project dependencies and scripts
- playwright.config.ts – Playwright runner configuration (browsers, timeouts, reporters)
- Directories
- fixtures/ – custom Playwright fixtures and global setup (e.g. baseTest.ts defines test hooks)
- locales/ – test data or translations to parameterize tests (e.g. en.ts)
- pages/ – Page Object Model classes (basePage.ts, homePage.ts, productPage.ts, shopPage.ts) encapsulating selectors & actions
- tests/ – test suites/specs that import fixtures and page classes to drive scenarios (e.g. product-cart.spec.ts)

##### Elements
- Clear text labels for each component block
- Tests → Fixtures → Playwright Engine
- Tests → Page Objects → Browser
- Page Objects → Locales (data flow)
- Playwright Engine → Reporter

## Diagram (Mermaid)

```mermaid
graph TD
    %% Configuration
    Config["playwright.config.ts"]:::config
    pkg["package.json"]:::codeModule
    pkgLock["package-lock.json"]:::codeModule

    %% Core Components
    TestRunner["Test Runner"]:::codeModule
    Tests["Test Specs"]:::codeModule
    Fixtures["Fixtures Module"]:::codeModule
    Locales["Locales (en.ts)"]:::data

    subgraph "Page Objects Layer"
        BasePage["BasePage"]:::codeModule
        HomePage["HomePage"]:::codeModule
        ProductPage["ProductPage"]:::codeModule
        ShopPage["ShopPage"]:::codeModule
    end

    Engine["Playwright Engine"]:::codeModule
    BrowserApp["Browser + Web App"]:::external
    Reporter["HTML Reporter"]:::external

    %% Connections
    Config --> TestRunner
    pkg --> TestRunner
    pkgLock --> TestRunner

    TestRunner --> Tests
    Tests -->|"test.beforeEach()"| Fixtures
    Tests -->|"instantiates"| BasePage
    Tests -->|"instantiates"| HomePage
    Tests -->|"instantiates"| ProductPage
    Tests -->|"instantiates"| ShopPage

    Fixtures -->|"provides page object"| BasePage

    BasePage -->|"page.click() / page.fill()"| BrowserApp
    HomePage -->|"page.click() / page.goto()"| BrowserApp
    ProductPage -->|"page.click() / page.evaluate()"| BrowserApp
    ShopPage -->|"page.selectOption()"| BrowserApp

    BasePage -->|"reads data"| Locales
    HomePage -->|"reads data"| Locales
    ProductPage -->|"reads data"| Locales
    ShopPage -->|"reads data"| Locales

    TestRunner --> Engine
    Engine --> Reporter
    Engine --> BrowserApp

    %% Click Events
    click Config "https://github.com/savianok/pw-ploom-tests/blob/main/playwright.config.ts"
    click Fixtures "https://github.com/savianok/pw-ploom-tests/blob/main/fixtures/baseTest.ts"
    click BasePage "https://github.com/savianok/pw-ploom-tests/blob/main/pages/basePage.ts"
    click HomePage "https://github.com/savianok/pw-ploom-tests/blob/main/pages/homePage.ts"
    click ProductPage "https://github.com/savianok/pw-ploom-tests/blob/main/pages/productPage.ts"
    click ShopPage "https://github.com/savianok/pw-ploom-tests/blob/main/pages/shopPage.ts"
    click Tests "https://github.com/savianok/pw-ploom-tests/blob/main/tests/product-cart.spec.ts"
    click Locales "https://github.com/savianok/pw-ploom-tests/blob/main/locales/en.ts"
    click pkg "https://github.com/savianok/pw-ploom-tests/blob/main/package.json"
    click pkgLock "https://github.com/savianok/pw-ploom-tests/blob/main/package-lock.json"

    %% Styles
    classDef codeModule fill:#D6E8FF,stroke:#000,stroke-width:1px
    classDef data fill:#D7F9D7,stroke:#000,stroke-width:1px
    classDef external fill:#FFE5B4,stroke:#000,stroke-width:1px
    classDef config fill:#F9F2C9,stroke:#000,stroke-width:1px,stroke-dasharray:5 5
```
