# thanhtu1125/toolshop-practice architecture

> Architecture diagram of the GitHub repository thanhtu1125/toolshop-practice, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/thanhtu1125/toolshop-practice
- Repository: https://github.com/thanhtu1125/toolshop-practice

## Overview

Toolshop Practice is a hands-on Python automation-testing lab, not the Toolshop application itself. Learners run staged exercises against Toolshop’s production or buggy site, using shared fixtures and page objects to exercise UI, API, BDD, network, and assertion skills. Fixtures create a fresh test account through the API and provide authenticated UI state. The README documents several exercise areas whose source was not sampled; their nodes and documented links are included, but unverified internal calls are omitted.

Main entry points: [`pages/base_page.py`](https://github.com/thanhtu1125/toolshop-practice/blob/main/pages/base_page.py) (Page navigation), [`conftest.py`](https://github.com/thanhtu1125/toolshop-practice/blob/main/conftest.py) (Shared fixtures), [`tests/buoi1`](https://github.com/thanhtu1125/toolshop-practice/tree/main/tests/buoi1) (POM exercises), [`tests/buoi2`](https://github.com/thanhtu1125/toolshop-practice/tree/main/tests/buoi2) (API exercises)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_exercises["Practice exercises"]
  node_session1["POM exercises"]
  node_session2["API exercises"]
  node_session3["BDD exercises"]
  node_features["BDD features"]
  node_session4["Bug assertions"]
  node_clinic["Flaky clinic"]
  node_ui_tests["UI exercises"]
end

subgraph group_ui["UI page objects"]
  node_home["Home and search<br/>[home_page.py]"]
  node_product["Product page<br/>[product_page.py]"]
  node_cart["Cart page<br/>[cart_page.py]"]
  node_login["Login page<br/>[login_page.py]"]
  node_contact["Contact page<br/>[contact_page.py]"]
  node_account["Account page<br/>[account_page.py]"]
  node_base["Page navigation<br/>[base_page.py]"]
end

subgraph group_support["Shared test support"]
  node_fixtures["Shared fixtures<br/>[conftest.py]"]
end

subgraph group_targets["Test targets"]
  node_toolshop_ui["Toolshop website"]
  node_toolshop_api["Toolshop API"]
  node_github_api["GitHub API"]
end

node_learner(("Learner"))

node_learner -->|"runs"| node_session1
node_learner -->|"runs"| node_session2
node_learner -->|"runs"| node_session3
node_learner -->|"runs"| node_session4
node_learner -->|"diagnoses"| node_clinic
node_learner -->|"runs"| node_ui_tests
node_session1 -->|"uses"| node_home
node_session1 -->|"uses"| node_base
node_features -->|"defines scenarios"| node_session3
node_session1 -->|"uses"| node_fixtures
node_session2 -->|"uses"| node_fixtures
node_ui_tests -->|"uses"| node_fixtures
node_session4 -->|"tests buggy site"| node_toolshop_ui
node_ui_tests -->|"tests"| node_toolshop_ui
node_session2 -->|"tests"| node_toolshop_api
node_session2 -->|"tests"| node_github_api
node_fixtures -->|"registers and logs in"| node_toolshop_api
node_fixtures -->|"configures client"| node_github_api
node_fixtures -->|"saves authenticated state"| node_toolshop_ui
node_home -->|"inherits"| node_base
node_product -->|"inherits"| node_base
node_cart -->|"inherits"| node_base
node_login -->|"inherits"| node_base
node_contact -->|"inherits"| node_base
node_account -->|"inherits"| node_base
node_home -->|"opens product"| node_product
node_base -->|"navigates to"| node_cart
node_base -->|"navigates to"| node_login
node_base -->|"navigates to"| node_contact
node_cart -->|"returns to"| node_home

click node_session1 "https://github.com/thanhtu1125/toolshop-practice/tree/main/tests/buoi1"
click node_session2 "https://github.com/thanhtu1125/toolshop-practice/tree/main/tests/buoi2"
click node_session3 "https://github.com/thanhtu1125/toolshop-practice/tree/main/tests/buoi3"
click node_features "https://github.com/thanhtu1125/toolshop-practice/tree/main/tests/buoi3/features"
click node_session4 "https://github.com/thanhtu1125/toolshop-practice/tree/main/tests/buoi4"
click node_clinic "https://github.com/thanhtu1125/toolshop-practice/tree/main/clinic"
click node_ui_tests "https://github.com/thanhtu1125/toolshop-practice/tree/main/tests/ui"
click node_home "https://github.com/thanhtu1125/toolshop-practice/blob/main/pages/home_page.py"
click node_product "https://github.com/thanhtu1125/toolshop-practice/blob/main/pages/product_page.py"
click node_cart "https://github.com/thanhtu1125/toolshop-practice/blob/main/pages/cart_page.py"
click node_login "https://github.com/thanhtu1125/toolshop-practice/blob/main/pages/login_page.py"
click node_contact "https://github.com/thanhtu1125/toolshop-practice/blob/main/pages/contact_page.py"
click node_account "https://github.com/thanhtu1125/toolshop-practice/blob/main/pages/account_page.py"
click node_base "https://github.com/thanhtu1125/toolshop-practice/blob/main/pages/base_page.py"
click node_fixtures "https://github.com/thanhtu1125/toolshop-practice/blob/main/conftest.py"

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_session1,node_session2,node_session3,node_features,node_session4,node_clinic,node_ui_tests toneBlue
class node_home,node_product,node_cart,node_login,node_contact,node_account,node_base toneAmber
class node_fixtures toneMint
class node_toolshop_ui,node_toolshop_api,node_github_api toneRose
class node_learner toneIndigo
```

## Components

### Practice exercises

- [POM exercises](https://github.com/thanhtu1125/toolshop-practice/tree/main/tests/buoi1): `tests/buoi1`
- [API exercises](https://github.com/thanhtu1125/toolshop-practice/tree/main/tests/buoi2): `tests/buoi2`
- [BDD exercises](https://github.com/thanhtu1125/toolshop-practice/tree/main/tests/buoi3): `tests/buoi3`
- [BDD features](https://github.com/thanhtu1125/toolshop-practice/tree/main/tests/buoi3/features): `tests/buoi3/features`
- [Bug assertions](https://github.com/thanhtu1125/toolshop-practice/tree/main/tests/buoi4): `tests/buoi4`
- [Flaky clinic](https://github.com/thanhtu1125/toolshop-practice/tree/main/clinic): `clinic`
- [UI exercises](https://github.com/thanhtu1125/toolshop-practice/tree/main/tests/ui): `tests/ui`

### UI page objects

- [Home and search](https://github.com/thanhtu1125/toolshop-practice/blob/main/pages/home_page.py): `pages/home_page.py`
- [Product page](https://github.com/thanhtu1125/toolshop-practice/blob/main/pages/product_page.py): `pages/product_page.py`
- [Cart page](https://github.com/thanhtu1125/toolshop-practice/blob/main/pages/cart_page.py): `pages/cart_page.py`
- [Login page](https://github.com/thanhtu1125/toolshop-practice/blob/main/pages/login_page.py): `pages/login_page.py`
- [Contact page](https://github.com/thanhtu1125/toolshop-practice/blob/main/pages/contact_page.py): `pages/contact_page.py`
- [Account page](https://github.com/thanhtu1125/toolshop-practice/blob/main/pages/account_page.py): `pages/account_page.py`
- [Page navigation](https://github.com/thanhtu1125/toolshop-practice/blob/main/pages/base_page.py): `pages/base_page.py`

### Shared test support

- [Shared fixtures](https://github.com/thanhtu1125/toolshop-practice/blob/main/conftest.py): `conftest.py`

### Test targets

- **Toolshop website**
- **Toolshop API**
- **GitHub API**

### Other components

- **Learner**

## Connections

- Learner → POM exercises: runs (evidence: `README.md`)
- Learner → API exercises: runs (evidence: `README.md`)
- Learner → BDD exercises: runs (evidence: `README.md`)
- Learner → Bug assertions: runs (evidence: `README.md`)
- Learner → Flaky clinic: diagnoses (evidence: `README.md`)
- Learner → UI exercises: runs (evidence: `README.md`)
- POM exercises → Home and search: uses (evidence: `README.md`)
- POM exercises → Page navigation: uses (evidence: `README.md`)
- BDD features → BDD exercises: defines scenarios (evidence: `README.md`)
- POM exercises → Shared fixtures: uses (evidence: `README.md`)
- API exercises → Shared fixtures: uses (evidence: `README.md`)
- UI exercises → Shared fixtures: uses (evidence: `README.md`)
- Bug assertions → Toolshop website: tests buggy site (evidence: `README.md`)
- UI exercises → Toolshop website: tests (evidence: `README.md`)
- API exercises → Toolshop API: tests (evidence: `README.md`)
- API exercises → GitHub API: tests (evidence: `README.md`)
- Shared fixtures → Toolshop API: registers and logs in (evidence: `conftest.py`)
- Shared fixtures → GitHub API: configures client (evidence: `conftest.py`)
- Shared fixtures → Toolshop website: saves authenticated state (evidence: `conftest.py`)
- Home and search → Page navigation: inherits (evidence: `pages/home_page.py`)
- Product page → Page navigation: inherits (evidence: `pages/product_page.py`)
- Cart page → Page navigation: inherits (evidence: `pages/cart_page.py`)
- Login page → Page navigation: inherits (evidence: `pages/login_page.py`)
- Contact page → Page navigation: inherits (evidence: `pages/contact_page.py`)
- Account page → Page navigation: inherits (evidence: `pages/account_page.py`)
- Home and search → Product page: opens product (evidence: `pages/home_page.py`)
- Page navigation → Cart page: navigates to (evidence: `pages/base_page.py`)
- Page navigation → Login page: navigates to (evidence: `pages/base_page.py`)
- Page navigation → Contact page: navigates to (evidence: `pages/base_page.py`)
- Cart page → Home and search: returns to (evidence: `pages/cart_page.py`)
