# youngyangyang04/test-automation-framework architecture

> Architecture diagram of the GitHub repository youngyangyang04/test-automation-framework, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/youngyangyang04/test-automation-framework
- Repository: https://github.com/youngyangyang04/test-automation-framework

## Overview

This repository is a Pytest-based API automation framework. A tester runs YAML-defined single-interface or business-flow cases; fixtures and request utilities load and parameterize cases, send HTTP requests, extract values for later cases, and assert responses. Supporting layers provide configuration, logging, data helpers, and database access; an included Flask mock service supplies test endpoints. The README documents CI execution and result reporting, while some case-runner and integration wiring is not sampled, so those links are marked unverified where appropriate.

Main entry points: [`testcase/conftest.py`](https://github.com/youngyangyang04/test-automation-framework/blob/main/testcase/conftest.py) (Case fixtures), [`base/apiutil.py`](https://github.com/youngyangyang04/test-automation-framework/blob/main/base/apiutil.py) (Single API executor), [`common/sendrequest.py`](https://github.com/youngyangyang04/test-automation-framework/blob/main/common/sendrequest.py) (HTTP requests), [`common/debugtalk.py`](https://github.com/youngyangyang04/test-automation-framework/blob/main/common/debugtalk.py) (Value helpers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_execution["Case execution"]
  node_pytest["Pytest runner<br/>[run.py]"]
  node_single["Single API cases"]
  node_business["Business cases"]
  node_case_fixture["Case fixtures<br/>[conftest.py]"]
end

subgraph group_runtime["Request runtime"]
  node_api_single["Single API executor<br/>[apiutil.py]"]
  node_api_business["Business executor"]
  node_requests["HTTP requests<br/>[sendrequest.py]"]
  node_yaml["YAML data<br/>[readyaml.py]"]
  node_assertions["Response assertions<br/>[assertions.py]"]
end

subgraph group_support["Framework support"]
  node_extract["Value helpers<br/>[debugtalk.py]"]
  node_csv["CSV helpers<br/>[operationcsv.py]"]
  node_data_helpers["Data shaping"]
  node_config["INI configuration<br/>[operationConfig.py]"]
  node_settings["Runtime settings<br/>[setting.py]"]
  node_logging["Logging<br/>[recordlog.py]"]
  node_db["Database connectors<br/>[connection.py]"]
  node_cleanup["Report cleanup<br/>[removefile.py]"]
  node_notify["DingTalk notification<br/>[dingRobot.py]"]
end

subgraph group_mock["Mock API"]
  node_mock_app["Mock endpoints<br/>[flask_service.py]"]
  node_mock_config["Mock settings<br/>[setting.py]"]
  node_mock_data["Mock data files"]
end

node_tester(("Tester"))
node_api_service{{"Tested API"}}
node_reporting["Allure reporting"]
node_ci(("CI system"))
node_sql_store[("Database service")]

node_tester -->|"runs"| node_pytest
node_pytest -.->|"loads fixtures"| node_case_fixture
node_single -.->|"provides cases"| node_case_fixture
node_business -.->|"provides cases"| node_case_fixture
node_case_fixture -->|"invokes"| node_api_single
node_case_fixture -->|"reads cases"| node_yaml
node_case_fixture -->|"accesses"| node_db
node_api_single -->|"sends requests"| node_requests
node_api_single -->|"reads and writes"| node_yaml
node_api_single -->|"checks responses"| node_assertions
node_api_single -->|"resolves parameters"| node_extract
node_api_business -->|"sends requests"| node_requests
node_api_business -->|"reads and writes"| node_yaml
node_api_business -->|"checks responses"| node_assertions
node_api_business -->|"resolves parameters"| node_extract
node_requests -->|"sends HTTP"| node_api_service
node_requests -->|"reads data"| node_yaml
node_requests -->|"logs failures"| node_logging
node_assertions -->|"queries database"| node_db
node_assertions -->|"logs outcomes"| node_logging
node_extract -->|"reads extracted values"| node_yaml
node_extract -->|"uses CSV helpers"| node_csv
node_extract -->|"reads configuration"| node_config
node_db -->|"loads connection settings"| node_config
node_db -->|"uses data shaping"| node_data_helpers
node_db -.->|"connects to"| node_sql_store
node_config -->|"reads paths"| node_settings
node_config -->|"logs errors"| node_logging
node_logging -->|"uses log settings"| node_settings
node_case_fixture -->|"cleans reports"| node_cleanup
node_case_fixture -->|"may notify"| node_notify
node_pytest -.->|"produces results"| node_reporting
node_ci -.->|"runs tests"| node_pytest
node_api_service -.->|"may be simulated by"| node_mock_app
node_mock_app -->|"loads settings"| node_mock_config
node_mock_app -.->|"reads and writes"| node_mock_data

click node_pytest "https://github.com/youngyangyang04/test-automation-framework/blob/main/run.py"
click node_single "https://github.com/youngyangyang04/test-automation-framework/tree/main/testcase/Single%20interface"
click node_business "https://github.com/youngyangyang04/test-automation-framework/tree/main/testcase/Business%20interface"
click node_case_fixture "https://github.com/youngyangyang04/test-automation-framework/blob/main/testcase/conftest.py"
click node_api_single "https://github.com/youngyangyang04/test-automation-framework/blob/main/base/apiutil.py"
click node_api_business "https://github.com/youngyangyang04/test-automation-framework/blob/main/base/apiutil_business.py"
click node_requests "https://github.com/youngyangyang04/test-automation-framework/blob/main/common/sendrequest.py"
click node_yaml "https://github.com/youngyangyang04/test-automation-framework/blob/main/common/readyaml.py"
click node_assertions "https://github.com/youngyangyang04/test-automation-framework/blob/main/common/assertions.py"
click node_extract "https://github.com/youngyangyang04/test-automation-framework/blob/main/common/debugtalk.py"
click node_csv "https://github.com/youngyangyang04/test-automation-framework/blob/main/common/operationcsv.py"
click node_data_helpers "https://github.com/youngyangyang04/test-automation-framework/blob/main/common/two_dimension_data.py"
click node_config "https://github.com/youngyangyang04/test-automation-framework/blob/main/conf/operationConfig.py"
click node_settings "https://github.com/youngyangyang04/test-automation-framework/blob/main/conf/setting.py"
click node_logging "https://github.com/youngyangyang04/test-automation-framework/blob/main/common/recordlog.py"
click node_db "https://github.com/youngyangyang04/test-automation-framework/blob/main/common/connection.py"
click node_cleanup "https://github.com/youngyangyang04/test-automation-framework/blob/main/base/removefile.py"
click node_notify "https://github.com/youngyangyang04/test-automation-framework/blob/main/common/dingRobot.py"
click node_mock_app "https://github.com/youngyangyang04/test-automation-framework/blob/main/mock_server/api_server/base/flask_service.py"
click node_mock_config "https://github.com/youngyangyang04/test-automation-framework/blob/main/mock_server/api_server/confs/setting.py"
click node_mock_data "https://github.com/youngyangyang04/test-automation-framework/tree/main/mock_server/api_server/data/mockdata"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_pytest,node_single,node_business,node_case_fixture toneBlue
class node_api_single,node_api_business,node_requests,node_yaml,node_assertions,node_sql_store toneAmber
class node_extract,node_csv,node_data_helpers,node_config,node_settings,node_logging,node_db,node_cleanup,node_notify,node_api_service toneMint
class node_mock_app,node_mock_config,node_mock_data toneRose
class node_tester,node_reporting,node_ci toneIndigo
```

## Components

### Case execution

- [Pytest runner](https://github.com/youngyangyang04/test-automation-framework/blob/main/run.py): `run.py`
- [Single API cases](https://github.com/youngyangyang04/test-automation-framework/tree/main/testcase/Single%20interface): `testcase/Single interface`
- [Business cases](https://github.com/youngyangyang04/test-automation-framework/tree/main/testcase/Business%20interface): `testcase/Business interface`
- [Case fixtures](https://github.com/youngyangyang04/test-automation-framework/blob/main/testcase/conftest.py): `testcase/conftest.py`

### Request runtime

- [Single API executor](https://github.com/youngyangyang04/test-automation-framework/blob/main/base/apiutil.py): `base/apiutil.py`
- [Business executor](https://github.com/youngyangyang04/test-automation-framework/blob/main/base/apiutil_business.py): `base/apiutil_business.py`
- [HTTP requests](https://github.com/youngyangyang04/test-automation-framework/blob/main/common/sendrequest.py): `common/sendrequest.py`
- [YAML data](https://github.com/youngyangyang04/test-automation-framework/blob/main/common/readyaml.py): `common/readyaml.py`
- [Response assertions](https://github.com/youngyangyang04/test-automation-framework/blob/main/common/assertions.py): `common/assertions.py`

### Framework support

- [Value helpers](https://github.com/youngyangyang04/test-automation-framework/blob/main/common/debugtalk.py): `common/debugtalk.py`
- [CSV helpers](https://github.com/youngyangyang04/test-automation-framework/blob/main/common/operationcsv.py): `common/operationcsv.py`
- [Data shaping](https://github.com/youngyangyang04/test-automation-framework/blob/main/common/two_dimension_data.py): `common/two_dimension_data.py`
- [INI configuration](https://github.com/youngyangyang04/test-automation-framework/blob/main/conf/operationConfig.py): `conf/operationConfig.py`
- [Runtime settings](https://github.com/youngyangyang04/test-automation-framework/blob/main/conf/setting.py): `conf/setting.py`
- [Logging](https://github.com/youngyangyang04/test-automation-framework/blob/main/common/recordlog.py): `common/recordlog.py`
- [Database connectors](https://github.com/youngyangyang04/test-automation-framework/blob/main/common/connection.py): `common/connection.py`
- [Report cleanup](https://github.com/youngyangyang04/test-automation-framework/blob/main/base/removefile.py): `base/removefile.py`
- [DingTalk notification](https://github.com/youngyangyang04/test-automation-framework/blob/main/common/dingRobot.py): `common/dingRobot.py`

### Mock API

- [Mock endpoints](https://github.com/youngyangyang04/test-automation-framework/blob/main/mock_server/api_server/base/flask_service.py): `mock_server/api_server/base/flask_service.py`
- [Mock settings](https://github.com/youngyangyang04/test-automation-framework/blob/main/mock_server/api_server/confs/setting.py): `mock_server/api_server/confs/setting.py`
- [Mock data files](https://github.com/youngyangyang04/test-automation-framework/tree/main/mock_server/api_server/data/mockdata): `mock_server/api_server/data/mockdata`

### Other components

- **Tester**
- **Tested API**
- **Allure reporting**
- **CI system**
- **Database service**

## Connections

- Tester → Pytest runner: runs (evidence: `README.md`)
- Pytest runner → Case fixtures: loads fixtures
- Single API cases → Case fixtures: provides cases
- Business cases → Case fixtures: provides cases
- Case fixtures → Single API executor: invokes (evidence: `testcase/conftest.py`)
- Case fixtures → YAML data: reads cases (evidence: `testcase/conftest.py`)
- Case fixtures → Database connectors: accesses (evidence: `testcase/conftest.py`)
- Single API executor → HTTP requests: sends requests (evidence: `base/apiutil.py`)
- Single API executor → YAML data: reads and writes (evidence: `base/apiutil.py`)
- Single API executor → Response assertions: checks responses (evidence: `base/apiutil.py`)
- Single API executor → Value helpers: resolves parameters (evidence: `base/apiutil.py`)
- Business executor → HTTP requests: sends requests (evidence: `base/apiutil_business.py`)
- Business executor → YAML data: reads and writes (evidence: `base/apiutil_business.py`)
- Business executor → Response assertions: checks responses (evidence: `base/apiutil_business.py`)
- Business executor → Value helpers: resolves parameters (evidence: `base/apiutil_business.py`)
- HTTP requests → Tested API: sends HTTP (evidence: `common/sendrequest.py`)
- HTTP requests → YAML data: reads data (evidence: `common/sendrequest.py`)
- HTTP requests → Logging: logs failures (evidence: `common/sendrequest.py`)
- Response assertions → Database connectors: queries database (evidence: `common/assertions.py`)
- Response assertions → Logging: logs outcomes (evidence: `common/assertions.py`)
- Value helpers → YAML data: reads extracted values (evidence: `common/debugtalk.py`)
- Value helpers → CSV helpers: uses CSV helpers (evidence: `common/debugtalk.py`)
- Value helpers → INI configuration: reads configuration (evidence: `common/debugtalk.py`)
- Database connectors → INI configuration: loads connection settings (evidence: `common/connection.py`)
- Database connectors → Data shaping: uses data shaping (evidence: `common/connection.py`)
- Database connectors → Database service: connects to
- INI configuration → Runtime settings: reads paths (evidence: `conf/operationConfig.py`)
- INI configuration → Logging: logs errors (evidence: `conf/operationConfig.py`)
- Logging → Runtime settings: uses log settings (evidence: `common/recordlog.py`)
- Case fixtures → Report cleanup: cleans reports
- Case fixtures → DingTalk notification: may notify
- Pytest runner → Allure reporting: produces results (evidence: `README.md`)
- CI system → Pytest runner: runs tests (evidence: `README.md`)
- Tested API → Mock endpoints: may be simulated by
- Mock endpoints → Mock settings: loads settings (evidence: `mock_server/api_server/base/flask_service.py`)
- Mock endpoints → Mock data files: reads and writes
