# mandh-jayessh/jrmpw02 architecture

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

- Interactive diagram: https://gitdiagram.com/mandh-jayessh/jrmpw02
- Repository: https://github.com/mandh-jayessh/jrmpw02

## Overview

##### Project Type and Purpose
- This is a test-automation framework built on Playwright with TypeScript, using the Page Object Model (POM). Its purpose is to run browser-based UI tests against target web pages, drive them via Page classes, feed in test data, and generate reports.

##### Main Components
a. Playwright Test Runner & Configuration
- playwright.config.ts
- package.json scripts (npm run test)
b. Page Object Model Layer
- pages/*.ts (e.g. alerts_IH.ts, rediff_login.ts, rediff_signup.ts)
c. Test Scripts
- tests/*.spec.ts
d. Test Data
- data/*.json (alert_data.json, rediff_signup_data.json)
e. Browser Engines
- Chromium/Firefox/WebKit (installed by npx playwright install)
f. Reporting
- playwright-report/ index.html + screenshots
g. CI/CD Integration
- .github/workflows/playwright.yml

##### Relationships and Data Flow
- Test Runner (A) reads playwright.config.ts and invokes tests (B).
- Each test (B) instantiates Page Objects (C), which wrap Playwright’s API.
- Page Objects (C) read from Test Data files (D) to drive form inputs or validations.
- Page Objects issue browser commands to Browser Engines (E).
- Browser Engines execute UI steps and return states/responses back to tests.
- Test Runner captures results and writes reports (F).
- On merge/commit, GitHub Actions (G) pulls the repo, installs deps, runs tests, and publishes reports.

##### Architectural Patterns
- Layered POM: separation of Test Layer, Page Layer, Data Layer, and Infrastructure Layer.
- CI Pipeline as an external orchestration service.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Infrastructure / Config Layer
    subgraph "Infrastructure / Configuration"
        config["playwright.config.ts"]:::config
        pkg["package.json"]:::config
    end

    %% Test Runner
    runner["Playwright Test Runner"]:::runner

    %% Test Layer
    subgraph "Test Layer"
        t1["alertsIH.spec.ts"]:::test
        t2["basic_page_interactions.spec.ts"]:::test
    end

    %% Page Object Layer
    subgraph "Page Object Layer"
        p1["alerts_IH.ts"]:::page
        p2["rediff_login.ts"]:::page
        p3["rediff_signup.ts"]:::page
    end

    %% Data Layer
    subgraph "Test Data Layer"
        d1[(alert_data.json)]:::data
        d2[(rediff_signup_data.json)]:::data
    end

    %% Browser Engines
    subgraph "Browser Engines"
        bch["Chromium"]:::browser
        ffx["Firefox"]:::browser
        wbk["WebKit"]:::browser
    end

    %% Reporting
    report[(playwright-report/)]:::report

    %% CI/CD Integration
    ci["GitHub Actions"]:::ci

    %% Connections
    config -->|uses| runner
    pkg -->|invokes| runner
    runner -->|runs| t1
    runner -->|runs| t2
    t1 -->|uses| p1
    t2 -->|uses| p2
    p1 -->|reads JSON| d1
    p3 -->|reads JSON| d2
    p1 -->|executes UI steps| bch
    p2 -->|executes UI steps| bch
    p3 -->|executes UI steps| bch
    bch -->|returns states| runner
    runner -->|outputs report| report
    ci -->|triggers| runner
    ci -->|archives| report

    %% Click Events
    click config "https://github.com/mandh-jayessh/jrmpw02/blob/main/playwright.config.ts"
    click pkg "https://github.com/mandh-jayessh/jrmpw02/blob/main/package.json"
    click ci "https://github.com/mandh-jayessh/jrmpw02/blob/main/.github/workflows/playwright.yml"
    click p1 "https://github.com/mandh-jayessh/jrmpw02/blob/main/pages/alerts_IH.ts"
    click p2 "https://github.com/mandh-jayessh/jrmpw02/blob/main/pages/rediff_login.ts"
    click p3 "https://github.com/mandh-jayessh/jrmpw02/blob/main/pages/rediff_signup.ts"
    click t1 "https://github.com/mandh-jayessh/jrmpw02/blob/main/tests/alertsIH.spec.ts"
    click t2 "https://github.com/mandh-jayessh/jrmpw02/blob/main/tests/basic_page_interactions.spec.ts"
    click d1 "https://github.com/mandh-jayessh/jrmpw02/blob/main/data/alert_data.json"
    click d2 "https://github.com/mandh-jayessh/jrmpw02/blob/main/data/rediff_signup_data.json"

    %% Styles
    classDef config fill:#e0ffe0,stroke:#0f0;
    classDef data fill:#e0ffe0,stroke:#0f0;
    classDef report fill:#e0ffe0,stroke:#0f0;
    classDef test fill:#e0e0ff,stroke:#00f;
    classDef page fill:#e0e0ff,stroke:#00f;
    classDef runner fill:#d0e0ff,stroke:#00f;
    classDef browser fill:#ffe0b3,stroke:#f90;
    classDef ci fill:#ffd699,stroke:#f60;
```
