# mrjohn5on/refactored-portfolio-playwright-tests architecture

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

- Interactive diagram: https://gitdiagram.com/mrjohn5on/refactored-portfolio-playwright-tests
- Repository: https://github.com/mrjohn5on/refactored-portfolio-playwright-tests

## Overview

##### Main components
- Page Objects – Found in the “pages” directory. These files (e.g., homepage.js, mobileAppPage.js) encapsulate the UI elements and interactions for different pages of the portfolio.
- Test Specs – Located in the “tests” directory, these files (e.g., homepage.spec.js, mobileApp.spec.js) define the test scenarios that use the page objects to drive the UI interactions.
- Test Runner & Configuration – The “playwright.config.js” along with the “package.json” file set up the testing environment using Playwright.
- CI/CD Integration – The “.github/workflows” directory (with playwrigth.yml) indicates the tests are run as part of automated workflows on GitHub.
- Project Metadata – Files like “readme.md” and “.gitignore” serve supporting roles, while the “package-lock.json” tracks dependency versions.

##### Relationships and interactions
- The Test Runner (configured via playwright.config.js and invoked through the CLI or GitHub Actions) acts as the orchestrator that triggers each test.
- The GitHub Actions workflow represents an external system that automatically triggers the test runner when code is pushed or during scheduled events.

##### Important architectural patterns and design principles
- Page Object Model (POM): Separates the page structure and behaviors into dedicated “pages” scripted modules. This abstraction simplifies test case scripts.
- Separation of Concerns: Tests (in “tests”) are decoupled from UI manipulation logic (in “pages”), allowing more modular testing.
- CI Integration: The use of GitHub Actions for streamlined, automated test execution across commit pipelines.

##### Relevant technologies and frameworks
- Playwright – For browser automation and UI testing.
- Node.js Ecosystem – Implied by the “package.json” file, indicating it’s a JavaScript/Node project.
- GitHub Actions – For automating test executions.
- Test execution components (e.g. Playwright runner)
- Test code components (dividing into “pages” and “tests”)

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Page Objects"
        PO1["Homepage Page Object"]:::pageObjects
        PO2["Mobile App Page Object"]:::pageObjects
        PO3["Steps Of The SDLC Page Object"]:::pageObjects
        PO4["Global Page Object"]:::pageObjects
        PO5["Postman Page Object"]:::pageObjects
        PO6["Social QA Project Page Object"]:::pageObjects
    end

    subgraph "Test Specs"
        TS1["Homepage Test Spec"]:::testSpecs
        TS2["Mobile App Test Spec"]:::testSpecs
        TS3["Postman Test Spec"]:::testSpecs
        TS4["Social QA Project Test Spec"]:::testSpecs
        TS5["Steps Of SDLC Test Spec"]:::testSpecs
    end

    subgraph "Test Runner & Configuration"
        TR["Playwright Test Runner & Configuration"]:::runner
        config1["playwright.config.js"]:::runner
        config2["package.json"]:::runner
    end

    subgraph "CI/CD Pipeline"
        CI["GitHub Actions Workflow"]:::ci
    end

    subgraph "Project Metadata"
        MD1["readme.md"]:::metadata
        MD2[".gitignore"]:::metadata
        MD3["package-lock.json"]:::metadata
    end

    CI -->|"trigger"| TR
    TR -->|"executes"| TS1
    TR -->|"executes"| TS2
    TR -->|"executes"| TS3
    TR -->|"executes"| TS4
    TR -->|"executes"| TS5

    TS1 -->|"calls"| PO1
    TS2 -->|"calls"| PO2
    TS3 -->|"calls"| PO5
    TS4 -->|"calls"| PO6
    TS5 -->|"calls"| PO3

    TR --- config1
    TR --- config2

    click PO1 "https://github.com/mrjohn5on/refactored-portfolio-playwright-tests/blob/main/pages/homepage.js"
    click PO2 "https://github.com/mrjohn5on/refactored-portfolio-playwright-tests/blob/main/pages/mobileAppPage.js"
    click PO3 "https://github.com/mrjohn5on/refactored-portfolio-playwright-tests/blob/main/pages/Steps_Of_The_SDLC.js"
    click PO4 "https://github.com/mrjohn5on/refactored-portfolio-playwright-tests/blob/main/pages/global.js"
    click PO5 "https://github.com/mrjohn5on/refactored-portfolio-playwright-tests/blob/main/pages/postman.js"
    click PO6 "https://github.com/mrjohn5on/refactored-portfolio-playwright-tests/blob/main/pages/socialQaProjectPage.js"
    click TS1 "https://github.com/mrjohn5on/refactored-portfolio-playwright-tests/blob/main/tests/homepage.spec.js"
    click TS2 "https://github.com/mrjohn5on/refactored-portfolio-playwright-tests/blob/main/tests/mobileApp.spec.js"
    click TS3 "https://github.com/mrjohn5on/refactored-portfolio-playwright-tests/blob/main/tests/postmanPage.spec.js"
    click TS4 "https://github.com/mrjohn5on/refactored-portfolio-playwright-tests/blob/main/tests/socialQaProjectPage.spec.js"
    click TS5 "https://github.com/mrjohn5on/refactored-portfolio-playwright-tests/blob/main/tests/stepsOfSDLC.spec.js"
    click config1 "https://github.com/mrjohn5on/refactored-portfolio-playwright-tests/blob/main/playwright.config.js"
    click config2 "https://github.com/mrjohn5on/refactored-portfolio-playwright-tests/blob/main/package.json"
    click CI "https://github.com/mrjohn5on/refactored-portfolio-playwright-tests/blob/main/.github/workflows/playwright.yml"
    click MD1 "https://github.com/mrjohn5on/refactored-portfolio-playwright-tests/blob/main/readme.md"
    click MD2 "https://github.com/mrjohn5on/refactored-portfolio-playwright-tests/blob/main/.gitignore"
    click MD3 "https://github.com/mrjohn5on/refactored-portfolio-playwright-tests/blob/main/package-lock.json"

    classDef pageObjects fill:#cce5ff,stroke:#004085,stroke-width:2px;
    classDef testSpecs fill:#d4edda,stroke:#155724,stroke-width:2px;
    classDef runner fill:#fff3cd,stroke:#856404,stroke-width:2px;
    classDef ci fill:#f8d7da,stroke:#721c24,stroke-width:2px;
    classDef metadata fill:#e2e3e5,stroke:#d6d8db,stroke-width:2px;
```
