# alekhsingh1206/typescript_playwright_appium architecture

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

- Interactive diagram: https://gitdiagram.com/alekhsingh1206/typescript_playwright_appium
- Repository: https://github.com/alekhsingh1206/typescript_playwright_appium

## Overview

##### Main Components
- Test Runner & Configuration: Represent the core test runner that uses WebDriverIO. Illustrate the presence of multiple configuration files (for example, in the “config” directory, apiTest.config.ts, uiTest.config.ts, and wdio.*.conf.ts) and npm scripts defined in package.json.
- Test Specification Layer: Include separate nodes for different test types:
– API tests (located under tests/apiTest and tests/uiApiTest)
– UI tests (in tests/uiTest and tests/specs for Android and iOS)
- Page Object / Service Layer: Show the “services” directory, which is divided into:
– Pages: Subdirectories for API pages, mobile pages (with separate flows for Android and iOS), and UI pages (e.g., login page objects).
– Fixtures: Files that store the test data and API/UI fixtures.
- Data & Utility Layer: Include the “data” directory (which holds API data, mobile test data, and UI test data) and the “utils” folder (with shared parameters and helper functions).
- Application Under Test: Represent the mobile demo apps kept in the “apps” directory which include the Android and iOS binaries.

##### Relationships and Interactions
- Detail that test scripts invoke methods from the Page Object classes provided in “services/pages” to interact with the mobile apps and APIs.
- That Allure Reporter integration (with results output in “results/allure-report” and “results/test-results”) collects logs and artifacts after each test run.
- Optionally, note that utility files from “utils” support common functions across pages and tests.

##### Architectural Patterns & Design Principles
- Page Object Model used in the “services/pages” directory. This pattern encapsulates UI and API interactions into dedicated page classes.
- That the project employs configuration-driven test execution, separating platform-specific settings (Android vs. iOS) via different “wdio.*.conf.ts” files.
- Modularity in the project – tests, data, page objects, and utilities are organized into distinct directories.
- Recognize that test reports are generated using Allure, ensuring traceability and debugging support.

##### Relevant Technologies, Frameworks & Libraries
- WebDriverIO – The underlying test automation framework.
- TypeScript – The language used for writing tests and page objects.
- Allure Reporter – Used for generating detailed test reports.
- Appium (implied) – Likely used for mobile automation testing given the presence of mobile app binaries.
- Standard NodeJS tooling (npm, NodeJS itself).

##### Elements
- Clear labels for each major component (Test Runner/Configuration, Test Specs, Page Objects/Services, Data & Fixtures, Application Under Test, and Reporting).
– From the WebDriverIO Test Runner to the Test Scripts.
– From Test Scripts to Page Object methods.
– From Page Objects interconnecting with Fixtures/Data.
– From tests to reporting systems (Allure report generation).
– Execution components (configurations and test specs),
– Support layers (pages, fixtures, utilities),
– Artifacts (Apps and generated reports).

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Test Runner & Configuration
    subgraph "Test Runner & Configuration"
        TRC1["package.json"]:::config
        TRC2["Config Files"]:::config
    end

    %% Test Specifications
    subgraph "Test Specifications"
        TS_API1["tests/apiTest/apiTest.ts"]:::testspec
        TS_API2["tests/uiApiTest/uiApiTest.ts"]:::testspec
        TS_UI1["tests/uiTest/loginTest.ts"]:::testspec
        TS_And["tests/specs/android"]:::testspec
        TS_iOS["tests/specs/ios"]:::testspec
    end

    %% Page Objects & Services
    subgraph "Page Objects & Services"
        subgraph "Pages"
            API_P1["services/pages/apiPages/bookApi/addNewBookRecordPage.ts"]:::page
            API_P2["services/pages/apiPages/bookApi/getBookByIdPage.ts"]:::page
            Mobile_Android["services/pages/mobilePages/android/home.page.ts"]:::page
            Mobile_iOS["services/pages/mobilePages/ios/homePage.ts"]:::page
            UI_Page["services/pages/uiPages/loginLogoutUI/loginPage.ts"]:::page
        end
        subgraph "Fixtures"
            Fixture_API["services/fixtures/apiFixture/bookApi.fixtures.ts"]:::fixture
            Fixture_UI["services/fixtures/uiFixture/loginUi.fixtures.ts"]:::fixture
        end
    end

    %% Data & Utility Layer
    subgraph "Data & Utility"
        Data_Node["Test Data (data/)"]:::data
        Utils_Params["utils/params.ts"]:::utility
        Utils_UI["utils/uiUtils.ts"]:::utility
    end

    %% Application Under Test
    subgraph "Application Under Test"
        Android_App["Android Demo App"]:::app
        iOS_App["iOS Demo App"]:::app
    end

    %% Reporting
    subgraph "Reporting"
        Allure_Report["Allure Report (results/allure-report)"]:::report
        Test_Results["Test Results (results/test-results)"]:::report
    end

    %% Relationships & Interactions
    %% Test Runner invokes Test Specifications
    TRC1 -->|"runs"| TS_API1
    TRC1 -->|"runs"| TS_API2
    TRC1 -->|"runs"| TS_UI1
    TRC2 -->|"configures"| TS_And
    TRC2 -->|"configures"| TS_iOS

    %% Test Specifications call Page Object methods
    TS_API1 -->|"calls"| API_P1
    TS_API1 -->|"calls"| API_P2
    TS_API2 -->|"calls"| API_P1
    TS_API2 -->|"calls"| API_P2
    TS_UI1 -->|"calls"| UI_Page
    TS_And -->|"calls"| Mobile_Android
    TS_iOS -->|"calls"| Mobile_iOS

    %% Test Specifications use Fixtures and Test Data
    TS_API1 -->|"uses"| Fixture_API
    TS_UI1 -->|"uses"| Fixture_UI
    TS_API1 -->|"uses"| Data_Node
    TS_API2 -->|"uses"| Data_Node
    TS_UI1 -->|"uses"| Data_Node
    TS_And -->|"uses"| Data_Node
    TS_iOS -->|"uses"| Data_Node

    %% Mobile Page Objects interact with Mobile Apps
    Mobile_Android -->|"interacts"| Android_App
    Mobile_iOS -->|"interacts"| iOS_App

    %% Test Specifications produce Reporting outputs
    TS_API1 -->|"reports"| Allure_Report
    TS_API2 -->|"reports"| Allure_Report
    TS_UI1 -->|"reports"| Allure_Report
    TS_And -->|"reports"| Allure_Report
    TS_iOS -->|"reports"| Allure_Report
    Allure_Report -->|"logs"| Test_Results

    %% Utilities support Page Objects
    Utils_Params ---|"supports"| UI_Page
    Utils_UI ---|"supports"| UI_Page

    %% Click Events for Test Runner & Configuration
    click TRC1 "https://github.com/alekhsingh1206/typescript_playwright_appium/blob/master/package.json"
    click TRC2 "https://github.com/alekhsingh1206/typescript_playwright_appium/tree/master/config/"

    %% Click Events for Test Specifications
    click TS_API1 "https://github.com/alekhsingh1206/typescript_playwright_appium/blob/master/tests/apiTest/apiTest.ts"
    click TS_API2 "https://github.com/alekhsingh1206/typescript_playwright_appium/blob/master/tests/uiApiTest/uiApiTest.ts"
    click TS_UI1 "https://github.com/alekhsingh1206/typescript_playwright_appium/blob/master/tests/uiTest/loginTest.ts"
    click TS_And "https://github.com/alekhsingh1206/typescript_playwright_appium/tree/master/tests/specs/android"
    click TS_iOS "https://github.com/alekhsingh1206/typescript_playwright_appium/tree/master/tests/specs/ios"

    %% Click Events for Page Objects - Pages
    click API_P1 "https://github.com/alekhsingh1206/typescript_playwright_appium/blob/master/services/pages/apiPages/bookApi/addNewBookRecordPage.ts"
    click API_P2 "https://github.com/alekhsingh1206/typescript_playwright_appium/blob/master/services/pages/apiPages/bookApi/getBookByIdPage.ts"
    click Mobile_Android "https://github.com/alekhsingh1206/typescript_playwright_appium/blob/master/services/pages/mobilePages/android/home.page.ts"
    click Mobile_iOS "https://github.com/alekhsingh1206/typescript_playwright_appium/blob/master/services/pages/mobilePages/ios/homePage.ts"
    click UI_Page "https://github.com/alekhsingh1206/typescript_playwright_appium/blob/master/services/pages/uiPages/loginLogoutUI/loginPage.ts"

    %% Click Events for Fixtures
    click Fixture_API "https://github.com/alekhsingh1206/typescript_playwright_appium/blob/master/services/fixtures/apiFixture/bookApi.fixtures.ts"
    click Fixture_UI "https://github.com/alekhsingh1206/typescript_playwright_appium/blob/master/services/fixtures/uiFixture/loginUi.fixtures.ts"

    %% Click Events for Data & Utility Layer
    click Data_Node "https://github.com/alekhsingh1206/typescript_playwright_appium/tree/master/data/"
    click Utils_Params "https://github.com/alekhsingh1206/typescript_playwright_appium/blob/master/utils/params.ts"
    click Utils_UI "https://github.com/alekhsingh1206/typescript_playwright_appium/blob/master/utils/uiUtils.ts"

    %% Click Events for Application Under Test
    click Android_App "https://github.com/alekhsingh1206/typescript_playwright_appium/blob/master/apps/android.demo_app.apk"
    click iOS_App "https://github.com/alekhsingh1206/typescript_playwright_appium/blob/master/apps/wdiodemoapp.app"

    %% Click Events for Reporting
    click Allure_Report "https://github.com/alekhsingh1206/typescript_playwright_appium/tree/master/results/allure-report"
    click Test_Results "https://github.com/alekhsingh1206/typescript_playwright_appium/tree/master/results/test-results"

    %% Class Definitions for Colours
    classDef config fill:#a2d9ce,stroke:#1abc9c,stroke-width:2px;
    classDef testspec fill:#aed6f1,stroke:#3498db,stroke-width:2px;
    classDef page fill:#f9e79f,stroke:#f1c40f,stroke-width:2px;
    classDef fixture fill:#fef9e7,stroke:#f39c12,stroke-width:2px;
    classDef data fill:#fad7a0,stroke:#e67e22,stroke-width:2px;
    classDef utility fill:#d7bde2,stroke:#9b59b6,stroke-width:2px;
    classDef app fill:#d5f5e3,stroke:#27ae60,stroke-width:2px;
    classDef report fill:#f5b7b1,stroke:#e74c3c,stroke-width:2px;
```
