# viplove29/python-ui-api-automation-framework architecture

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

- Interactive diagram: https://gitdiagram.com/viplove29/python-ui-api-automation-framework
- Repository: https://github.com/viplove29/python-ui-api-automation-framework

## Overview

1. This repository is a Python test automation framework with two independent test surfaces: browser UI tests and HTTP API tests. It is organized around Pytest as the test runner, with Selenium for UI and Requests-style client code for API coverage.

2. The top-level execution flow starts in `tests/`, where tests are split into `tests/ui` and `tests/api`. `pytest.ini` likely defines shared pytest behavior such as discovery rules, markers, and runtime settings, while `tests/conftest.py` supplies fixtures that wire tests to the framework objects.

3. The UI automation stack is layered. `core/driver_factory.py` is the browser bootstrap boundary: it creates the WebDriver based on configuration and supports local cross-browser runs. `core/selenium_wrapper.py` sits above raw Selenium and centralizes common actions such as click, type, waits, and element interaction.

4. Page Object Model is implemented under `pages/`. `pages/base_page.py` is the shared abstraction that page classes build on, and `pages/saucedemo_login_page.py` is a concrete page object for the SauceDemo login flow. Tests should interact with page methods rather than low-level locators, which keeps business intent separate from UI mechanics.

5. The API side is isolated under `api/`. `api/api_client.py` acts as the reusable HTTP client boundary for non-UI tests, so API test cases can call a small client API instead of managing request plumbing directly.

6. Configuration is centralized in `config/config.yaml`. This is the main runtime control point for things like browser selection and other environment-specific settings, which means the same test code can run locally in different browser modes or in CI without code changes.

7. The framework is designed to run in parallel with Pytest-xdist, as noted in the README and supported by the test layout. That makes the test runner an orchestration layer over independent UI/API tests rather than a single serialized workflow.

8. External test targets are demo systems rather than internal application services. The UI test names and page object indicate SauceDemo as the browser target, and the API example in the README points to a demo endpoint pattern such as httpbin. This suggests the repo is a framework template, not an app-under-test itself.

9. CI is handled by GitHub Actions in `.github/workflows/ci.yml`. The pipeline runs on push and uses a Docker Selenium Chrome environment, which means browser execution in CI is containerized and standardized rather than dependent on a developer workstation.

10. Docker support is provided separately in `docker/Dockerfile`. That container image is intended to package the test runtime and dependencies so the same framework can be executed consistently in local containers or CI jobs.

11. Dependencies are declared in `requirements.txt`, so the repository’s runtime footprint is entirely Python-based. The stack is intentionally lightweight: Pytest for orchestration, Selenium for UI, Requests for API, and supporting libraries for parallelization/reporting.

12. Reporting is Allure-ready, but reporting itself is not a core runtime dependency of the framework. It is an output concern layered on top of test execution, which keeps test code independent from report generation.

13. Overall, the key architectural boundaries are: test orchestration in `tests/`, browser control in `core/`, page abstractions in `pages/`, API client logic in `api/`, and execution/environment control in `config/`, Docker, and GitHub Actions. A diagram should show Pytest as the entry point, branching into UI and API paths, with configuration feeding both, and CI/Docker as the execution infrastructure around them.

Main entry points: [`pytest.ini`](https://github.com/viplove29/python-ui-api-automation-framework/blob/main/pytest.ini) (Pytest), [`.github/workflows/ci.yml`](https://github.com/viplove29/python-ui-api-automation-framework/blob/main/.github/workflows/ci.yml) (CI workflow), [`tests/conftest.py`](https://github.com/viplove29/python-ui-api-automation-framework/blob/main/tests/conftest.py) (Fixtures), [`tests/ui/test_saucedemo_login.py`](https://github.com/viplove29/python-ui-api-automation-framework/blob/main/tests/ui/test_saucedemo_login.py) (UI tests)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_testing["Testing"]
  node_pytest_runner["Pytest<br/>test runner<br/>[pytest.ini]"]
  node_test_fixtures["Fixtures<br/>test setup<br/>[conftest.py]"]
  node_ui_tests["UI tests<br/>selenium tests"]
  node_api_tests["API tests<br/>http tests<br/>[test_demo_api.py]"]
end

subgraph group_ui["UI automation"]
  node_driver_factory["Driver factory<br/>browser bootstrap<br/>[driver_factory.py]"]
  node_selenium_wrapper["Selenium wrapper<br/>ui helper"]
  node_base_page["Base page<br/>page abstraction<br/>[base_page.py]"]
  node_login_page["Login page<br/>page object"]
end

subgraph group_api["API automation"]
  node_api_client["API client<br/>http client<br/>[api_client.py]"]
end

subgraph group_runtime["Runtime"]
  node_config_yaml["Config<br/>[config.yaml]"]
  node_dockerfile["Docker image<br/>container runtime"]
  node_ci_workflow["CI workflow<br/>pipeline<br/>[ci.yml]"]
  node_requirements["Dependencies<br/>python deps<br/>[requirements.txt]"]
end

node_saucedemo_target(("SauceDemo<br/>external ui target"))
node_httpbin_target(("Demo API<br/>external api target"))
node_allure_output{{"Allure<br/>reporting output"}}

node_pytest_runner -->|"loads"| node_test_fixtures
node_pytest_runner -->|"runs"| node_ui_tests
node_pytest_runner -->|"runs"| node_api_tests
node_test_fixtures -->|"provides"| node_driver_factory
node_test_fixtures -->|"provides"| node_api_client
node_ui_tests -->|"uses"| node_login_page
node_login_page -->|"extends"| node_base_page
node_base_page -->|"delegates"| node_selenium_wrapper
node_selenium_wrapper -->|"uses"| node_driver_factory
node_driver_factory -->|"reads"| node_config_yaml
node_ui_tests -->|"targets"| node_saucedemo_target
node_api_tests -->|"uses"| node_api_client
node_api_client -->|"targets"| node_httpbin_target
node_config_yaml -.->|"drives"| node_ci_workflow
node_dockerfile -.->|"supports"| node_ci_workflow
node_requirements -->|"installs"| node_pytest_runner
node_pytest_runner -.->|"emits"| node_allure_output
node_ci_workflow -->|"invokes"| node_pytest_runner
node_ci_workflow -->|"builds"| node_dockerfile

click node_pytest_runner "https://github.com/viplove29/python-ui-api-automation-framework/blob/main/pytest.ini"
click node_test_fixtures "https://github.com/viplove29/python-ui-api-automation-framework/blob/main/tests/conftest.py"
click node_ui_tests "https://github.com/viplove29/python-ui-api-automation-framework/blob/main/tests/ui/test_saucedemo_login.py"
click node_api_tests "https://github.com/viplove29/python-ui-api-automation-framework/blob/main/tests/api/test_demo_api.py"
click node_driver_factory "https://github.com/viplove29/python-ui-api-automation-framework/blob/main/core/driver_factory.py"
click node_selenium_wrapper "https://github.com/viplove29/python-ui-api-automation-framework/blob/main/core/selenium_wrapper.py"
click node_base_page "https://github.com/viplove29/python-ui-api-automation-framework/blob/main/pages/base_page.py"
click node_login_page "https://github.com/viplove29/python-ui-api-automation-framework/blob/main/pages/saucedemo_login_page.py"
click node_api_client "https://github.com/viplove29/python-ui-api-automation-framework/blob/main/api/api_client.py"
click node_config_yaml "https://github.com/viplove29/python-ui-api-automation-framework/blob/main/config/config.yaml"
click node_dockerfile "https://github.com/viplove29/python-ui-api-automation-framework/tree/main/docker/Dockerfile"
click node_ci_workflow "https://github.com/viplove29/python-ui-api-automation-framework/blob/main/.github/workflows/ci.yml"
click node_requirements "https://github.com/viplove29/python-ui-api-automation-framework/blob/main/requirements.txt"

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_runner,node_test_fixtures,node_ui_tests,node_api_tests toneBlue
class node_driver_factory,node_selenium_wrapper,node_base_page,node_login_page toneAmber
class node_api_client toneMint
class node_config_yaml,node_dockerfile,node_ci_workflow,node_requirements toneRose
class node_saucedemo_target,node_httpbin_target,node_allure_output toneNeutral
```

## Components

### Testing

Pytest-based execution and test surfaces

- [Pytest](https://github.com/viplove29/python-ui-api-automation-framework/blob/main/pytest.ini): test runner · Discovers and orchestrates UI and API tests · `pytest.ini`
- [Fixtures](https://github.com/viplove29/python-ui-api-automation-framework/blob/main/tests/conftest.py): test setup · Shared test fixtures wiring framework objects into tests · `tests/conftest.py`
- [UI tests](https://github.com/viplove29/python-ui-api-automation-framework/blob/main/tests/ui/test_saucedemo_login.py): selenium tests · Browser-based end-to-end coverage · `tests/ui/test_saucedemo_login.py`
- [API tests](https://github.com/viplove29/python-ui-api-automation-framework/blob/main/tests/api/test_demo_api.py): http tests · HTTP-level coverage against demo endpoints · `tests/api/test_demo_api.py`

### UI automation

Browser automation stack and page objects

- [Driver factory](https://github.com/viplove29/python-ui-api-automation-framework/blob/main/core/driver_factory.py): browser bootstrap · Creates WebDriver instances from configuration · `core/driver_factory.py`
- [Selenium wrapper](https://github.com/viplove29/python-ui-api-automation-framework/blob/main/core/selenium_wrapper.py): ui helper · Centralizes common browser actions and waits · `core/selenium_wrapper.py`
- [Base page](https://github.com/viplove29/python-ui-api-automation-framework/blob/main/pages/base_page.py): page abstraction · Shared page-object foundation for UI flows · `pages/base_page.py`
- [Login page](https://github.com/viplove29/python-ui-api-automation-framework/blob/main/pages/saucedemo_login_page.py): page object · SauceDemo login flow page object · `pages/saucedemo_login_page.py`

### API automation

HTTP client boundary and API tests

- [API client](https://github.com/viplove29/python-ui-api-automation-framework/blob/main/api/api_client.py): http client · Reusable request boundary for API coverage · `api/api_client.py`

### Runtime

Configuration, container, and CI execution

- [Config](https://github.com/viplove29/python-ui-api-automation-framework/blob/main/config/config.yaml): runtime config · Central settings for browser and environment behavior · `config/config.yaml`
- [Docker image](https://github.com/viplove29/python-ui-api-automation-framework/tree/main/docker/Dockerfile): container runtime · Packages the test runtime for consistent execution · `docker/Dockerfile`
- [CI workflow](https://github.com/viplove29/python-ui-api-automation-framework/blob/main/.github/workflows/ci.yml): pipeline · GitHub Actions pipeline for containerized test runs · `.github/workflows/ci.yml`
- [Dependencies](https://github.com/viplove29/python-ui-api-automation-framework/blob/main/requirements.txt): python deps · Python package set for test execution · `requirements.txt`

### Other components

- **SauceDemo**: external ui target · Demo browser application under test
- **Demo API**: external api target · Demo HTTP endpoint used by API tests
- **Allure**: reporting output · Reporting layer generated from test execution

## Connections

- Pytest → Fixtures: loads · Pytest initializes shared fixtures and hooks
- Pytest → UI tests: runs · Discovers and executes UI tests
- Pytest → API tests: runs · Discovers and executes API tests
- Fixtures → Driver factory: provides · Fixtures create and manage browser sessions
- Fixtures → API client: provides · Fixtures expose reusable API clients
- UI tests → Login page: uses · UI tests call page-object methods
- Login page → Base page: extends · Concrete page inherits shared page behavior
- Base page → Selenium wrapper: delegates · Page abstractions use the shared Selenium wrapper
- Selenium wrapper → Driver factory: uses · Wrapper operates on created WebDriver instances
- Driver factory → Config: reads · Browser selection and runtime settings come from config
- UI tests → SauceDemo: targets · Browser tests exercise the SauceDemo demo app
- API tests → API client: uses · API tests call the shared HTTP client
- API client → Demo API: targets · Client issues requests to the demo API endpoint
- Config → CI workflow: drives · Same settings support local and CI execution modes
- Docker image → CI workflow: supports · Container image is used for standardized execution
- Dependencies → Pytest: installs · Dependency set enables test execution
- Pytest → Allure: emits · Test runs can produce Allure reporting artifacts
- CI workflow → Pytest: invokes · CI runs the test suite on push
- CI workflow → Docker image: builds · Pipeline uses containerized test runtime
