# stb-tester/stb-tester-test-pack architecture

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

- Interactive diagram: https://gitdiagram.com/stb-tester/stb-tester-test-pack
- Repository: https://github.com/stb-tester/stb-tester-test-pack

## Overview

##### Project type and purpose
- This is not a web app or microservice; it’s a test-automation “test-pack” built on top of the Stb-tester platform.

##### File structure
- Top‐level files/config:
- config/stbt.conf (Stb-tester version & settings)
- config/remote-control/roku.lircd.conf (IR codes for remote)
- stbt_rig.py (custom rig layer that encapsulates device communication)
- Tests directory:
- tests/roku/pages/... (page-object models for each screen)
- tests/roku/tests.py (actual test functions)
- Selftest folder: sample screenshots & self-validation assets
- CI/pytest.ini/.pylintrc: standard test runner & lint configs

##### README for additional insights
- Confirms:
- Tests are plain Python functions under tests/
- Version pinning in config/stbt.conf

##### Final checklist for the engineer
- Confirm you have:
- Notes on key patterns (Page Object, Config-Driven)
- An extensibility boundary showing where to add new tests or pages
- Keep it detailed but focused on the core architectural flow: Test Runner → Rig → Device → Artifacts.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Code Layer
    subgraph "Code Layer"
        Runner["Test Runner<br/>(PyTest + stbt core API)"]:::code
        subgraph "Test Pack" 
            TestLogic["Test Logic<br/>(tests/roku/tests.py)"]:::code
            PageObjects["Page-Object Models"]:::code
            RigAPI["Rig Interface<br/>(stbt_rig.py)"]:::code
        end
    end

    %% Config Layer
    subgraph "Configuration Layer"
        ConfigStbt["config/stbt.conf"]:::config
        ConfigIR["config/remote-control/roku.lircd.conf"]:::config
        DotStbt[".stbt.conf"]:::config
        subgraph "CI/Quality Config"
            CI_Pytest["pytest.ini"]:::config
            CI_Pylint[".pylintrc"]:::config
            CI_Readme["README.md"]:::config
        end
    end

    %% Hardware & Platform Layer
    subgraph "Hardware Layer"
        Roku["Roku STB Device"]:::hardware
    end
    subgraph "Platform"
        StbPlatform["Stb-tester Platform"]:::platform
    end

    %% Artifact Layer
    subgraph "Artifact Store"
        ScreenshotsAll["selftest/screenshots/"]:::artifact
        ScreenshotsRoku["selftest/screenshots/roku/"]:::artifact
    end

    %% Data Flows
    Runner -->|"loads"| TestLogic
    Runner -->|"loads"| ConfigStbt
    Runner -->|"loads"| ConfigIR
    TestLogic -->|"uses"| PageObjects
    TestLogic -->|"calls"| RigAPI
    RigAPI -->|"IR command"| Roku
    Roku -->|"screenshot capture"| Runner
    Runner -->|"stores artifacts"| ScreenshotsAll
    ScreenshotsAll --> ScreenshotsRoku
    Runner -->|"uploads reports"| StbPlatform

    %% Click Events
    click Runner "https://github.com/stb-tester/stb-tester-test-pack/blob/main/tests/roku/tests.py"
    click TestLogic "https://github.com/stb-tester/stb-tester-test-pack/blob/main/tests/roku/tests.py"
    click PageObjects "https://github.com/stb-tester/stb-tester-test-pack/tree/main/tests/roku/pages/"
    click RigAPI "https://github.com/stb-tester/stb-tester-test-pack/blob/main/stbt_rig.py"
    click ConfigStbt "https://github.com/stb-tester/stb-tester-test-pack/blob/main/config/stbt.conf"
    click ConfigIR "https://github.com/stb-tester/stb-tester-test-pack/blob/main/config/remote-control/roku.lircd.conf"
    click DotStbt "https://github.com/stb-tester/stb-tester-test-pack/blob/main/.stbt.conf"
    click CI_Pytest "https://github.com/stb-tester/stb-tester-test-pack/blob/main/pytest.ini"
    click CI_Pylint "https://github.com/stb-tester/stb-tester-test-pack/blob/main/.pylintrc"
    click CI_Readme "https://github.com/stb-tester/stb-tester-test-pack/blob/main/README.md"
    click ScreenshotsAll "https://github.com/stb-tester/stb-tester-test-pack/tree/main/selftest/screenshots/"
    click ScreenshotsRoku "https://github.com/stb-tester/stb-tester-test-pack/tree/main/selftest/screenshots/roku/"

    %% Styles
    classDef code fill:#D6EAF8,stroke:#21618C;
    classDef config fill:#D5F5E3,stroke:#239B56;
    classDef hardware fill:#FDEDEC,stroke:#C0392B;
    classDef platform fill:#F4F6F6,stroke:#566573;
    classDef artifact fill:#F5EEF8,stroke:#8E44AD;
```
