# heinerl97/prueba_tecnica_devsu architecture

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

- Interactive diagram: https://gitdiagram.com/heinerl97/prueba_tecnica_devsu
- Repository: https://github.com/heinerl97/prueba_tecnica_devsu

## Overview

1. **Repository shape**
   - The repo is split into two independent automation subsystems:
     - `api/` for **API testing** of Petstore users.
     - `e2e/` for **browser E2E testing** of the Demoblaze shopping flow.
   - They do not share runtime, test framework, or code; they are separate pipelines with separate reports.

2. **API testing subsystem (`api/`)**
   - Implemented in **Node.js + Cypress**.
   - The core test entry point is `api/cypress/e2e/petstore/user.cy.js`.
   - This suite targets the public **Petstore API** and exercises the user resource lifecycle: create, read, update, delete.

3. **API data flow**
   - Tests issue HTTP requests directly to the Petstore backend.
   - The test flow validates:
     - response status codes,
     - payload integrity,
     - persistence across subsequent calls.
   - Because the data is dynamic, the suite is verifying end-to-end API behavior rather than static fixtures.

4. **API support and configuration**
   - `api/cypress/support/e2e.js` contains Cypress support-level setup shared by the API tests.
   - `api/cypress.config.js` defines the Cypress runtime configuration and execution boundaries for the suite.
   - `api/package.json` and `package-lock.json` define the Node/Cypress dependency environment.

5. **API reporting**
   - Test outputs are stored under `api/reporte/`.
   - The presence of `mochawesome.html` and `mochawesome.json` indicates HTML/JSON reporting for the Cypress run.
   - This creates a clear separation between execution and post-run analysis artifacts.

6. **E2E testing subsystem (`e2e/`)**
   - Implemented in **Python 3.8+** using **Pytest** and **Selenium WebDriver**.
   - The main scenario is `e2e/tests/test_purchase_flow.py`, which validates the Demoblaze purchase journey.
   - This suite is focused on real browser interaction with the public Demoblaze site.

7. **Page Object Model boundary**
   - The browser automation is structured with **Page Object Model** classes in `e2e/pages/`:
     - `home_page.py`
     - `product_page.py`
     - `cart_page.py`
     - `purchase_page.py`
   - These classes isolate page-specific selectors and actions from the test case, so the test file describes the business flow while page objects handle UI mechanics.

8. **E2E execution and shared setup**
   - `e2e/conftest.py` likely provides Pytest fixtures and test-level setup/teardown.
   - `e2e/utils/driver_factory.py` centralizes WebDriver creation, which is the main boundary for browser configuration.
   - `e2e/utils/screenshot.py` suggests failure or diagnostic capture support during runs.

9. **E2E data flow**
   - The purchase test follows a user journey through multiple page objects:
     - start at home,
     - choose a product,
     - add it to cart,
     - inspect cart,
     - complete purchase form,
     - confirm order.
   - The test state is carried through the browser session, not through backend API calls or mocks.

10. **E2E reporting**
   - Execution artifacts are written under `e2e/reporte/`.
   - The repo includes Allure-style result files, indicating report generation for test history, failures, and step-level diagnostics.
   - This makes the E2E suite observable without mixing reporting concerns into the test logic.

11. **External dependencies and boundaries**
   - API suite external dependency: **Petstore Swagger API**.
   - E2E suite external dependency: **Demoblaze website**.
   - Both suites are integration-style automation against live services, so network availability and external site stability are part of the architecture.

12. **Overall architectural intent**
   - The repo is best understood as two parallel validation stacks:
     - **service-level API regression** in Cypress,
     - **UI-level purchase-flow regression** in Selenium/Pytest.
   - The architecture is intentionally simple: tests, page/support layers, and report artifacts, with no application code of its own.

Main entry points: [`e2e`](https://github.com/heinerl97/prueba_tecnica_devsu/tree/main/e2e) (E2E stack), [`api`](https://github.com/heinerl97/prueba_tecnica_devsu/tree/main/api) (API stack), [`e2e/pages`](https://github.com/heinerl97/prueba_tecnica_devsu/tree/main/e2e/pages) (Page objects), [`api/cypress/e2e/petstore/user.cy.js`](https://github.com/heinerl97/prueba_tecnica_devsu/blob/main/api/cypress/e2e/petstore/user.cy.js) (User tests)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API testing"]
  node_api_stack["API stack<br/>cypress pipeline"]
  node_api_config["Cypress config<br/>runtime config<br/>[cypress.config.js]"]
  node_api_test["User tests<br/>api spec<br/>[user.cy.js]"]
  node_api_support["Support setup<br/>cypress support<br/>[e2e.js]"]
  node_api_reports["API reports<br/>report artifacts"]
  node_petstore_api[("Petstore API<br/>external service")]
  node_api_pkg["Node deps<br/>package manifest<br/>[package.json]"]
end

subgraph group_e2e["Browser E2E"]
  node_e2e_stack["E2E stack<br/>pytest pipeline"]
  node_e2e_requirements["Python deps<br/>dependency spec<br/>[requirements.txt]"]
  node_e2e_conftest["Pytest setup<br/>fixture layer<br/>[conftest.py]"]
  node_purchase_test["Purchase test<br/>ui scenario"]
  node_pages_layer["Page objects<br/>page model"]
  node_home_page["Home page<br/>page object<br/>[home_page.py]"]
  node_product_page["Product page<br/>page object<br/>[product_page.py]"]
  node_cart_page["Cart page<br/>page object<br/>[cart_page.py]"]
  node_purchase_page["Checkout page<br/>page object<br/>[purchase_page.py]"]
  node_driver_factory["Driver factory<br/>[driver_factory.py]"]
  node_screenshot["Screenshot util<br/>diagnostic helper<br/>[screenshot.py]"]
  node_e2e_reports["E2E reports<br/>report artifacts"]
  node_demoblaze_site[("Demoblaze site<br/>external service")]
end

node_repo{{"Repo"}}

node_repo -->|"contains"| node_api_stack
node_repo -->|"contains"| node_e2e_stack
node_api_stack -->|"configured by"| node_api_config
node_api_stack -->|"executes"| node_api_test
node_api_stack -->|"shares setup"| node_api_support
node_api_stack -->|"depends on"| node_api_pkg
node_api_test -->|"calls"| node_petstore_api
node_api_test -->|"writes"| node_api_reports
node_api_test -->|"uses"| node_api_support
node_api_stack -->|"publishes"| node_api_reports
node_e2e_stack -->|"depends on"| node_e2e_requirements
node_e2e_stack -->|"configured by"| node_e2e_conftest
node_e2e_stack -->|"executes"| node_purchase_test
node_e2e_stack -->|"organized by"| node_pages_layer
node_e2e_stack -->|"creates browser"| node_driver_factory
node_e2e_stack -->|"diagnostics"| node_screenshot
node_purchase_test -->|"drives"| node_pages_layer
node_pages_layer -->|"includes"| node_home_page
node_pages_layer -->|"includes"| node_product_page
node_pages_layer -->|"includes"| node_cart_page
node_pages_layer -->|"includes"| node_purchase_page
node_purchase_test -->|"visits"| node_demoblaze_site
node_e2e_stack -->|"publishes"| node_e2e_reports

click node_api_stack "https://github.com/heinerl97/prueba_tecnica_devsu/tree/main/api"
click node_api_config "https://github.com/heinerl97/prueba_tecnica_devsu/blob/main/api/cypress.config.js"
click node_api_test "https://github.com/heinerl97/prueba_tecnica_devsu/blob/main/api/cypress/e2e/petstore/user.cy.js"
click node_api_support "https://github.com/heinerl97/prueba_tecnica_devsu/blob/main/api/cypress/support/e2e.js"
click node_api_reports "https://github.com/heinerl97/prueba_tecnica_devsu/tree/main/api/reporte"
click node_api_pkg "https://github.com/heinerl97/prueba_tecnica_devsu/blob/main/api/package.json"
click node_e2e_stack "https://github.com/heinerl97/prueba_tecnica_devsu/tree/main/e2e"
click node_e2e_requirements "https://github.com/heinerl97/prueba_tecnica_devsu/blob/main/e2e/requirements.txt"
click node_e2e_conftest "https://github.com/heinerl97/prueba_tecnica_devsu/blob/main/e2e/conftest.py"
click node_purchase_test "https://github.com/heinerl97/prueba_tecnica_devsu/blob/main/e2e/tests/test_purchase_flow.py"
click node_pages_layer "https://github.com/heinerl97/prueba_tecnica_devsu/tree/main/e2e/pages"
click node_home_page "https://github.com/heinerl97/prueba_tecnica_devsu/blob/main/e2e/pages/home_page.py"
click node_product_page "https://github.com/heinerl97/prueba_tecnica_devsu/blob/main/e2e/pages/product_page.py"
click node_cart_page "https://github.com/heinerl97/prueba_tecnica_devsu/blob/main/e2e/pages/cart_page.py"
click node_purchase_page "https://github.com/heinerl97/prueba_tecnica_devsu/blob/main/e2e/pages/purchase_page.py"
click node_driver_factory "https://github.com/heinerl97/prueba_tecnica_devsu/blob/main/e2e/utils/driver_factory.py"
click node_screenshot "https://github.com/heinerl97/prueba_tecnica_devsu/blob/main/e2e/utils/screenshot.py"
click node_e2e_reports "https://github.com/heinerl97/prueba_tecnica_devsu/tree/main/e2e/reporte"

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_api_stack,node_api_config,node_api_test,node_api_support,node_api_reports,node_petstore_api,node_api_pkg toneBlue
class node_e2e_stack,node_e2e_requirements,node_e2e_conftest,node_purchase_test,node_pages_layer,node_home_page,node_product_page,node_cart_page,node_purchase_page,node_driver_factory,node_screenshot,node_e2e_reports,node_demoblaze_site toneAmber
class node_repo toneNeutral
```

## Components

### API testing

Cypress-based Petstore API regression pipeline

- [API stack](https://github.com/heinerl97/prueba_tecnica_devsu/tree/main/api): cypress pipeline · Node.js and Cypress suite for Petstore user lifecycle testing · `api`
- [Cypress config](https://github.com/heinerl97/prueba_tecnica_devsu/blob/main/api/cypress.config.js): runtime config · Defines Cypress execution boundaries and runtime settings · `api/cypress.config.js`
- [User tests](https://github.com/heinerl97/prueba_tecnica_devsu/blob/main/api/cypress/e2e/petstore/user.cy.js): api spec · Main Petstore user CRUD test scenario · `api/cypress/e2e/petstore/user.cy.js`
- [Support setup](https://github.com/heinerl97/prueba_tecnica_devsu/blob/main/api/cypress/support/e2e.js): cypress support · Shared Cypress support-level setup for API tests · `api/cypress/support/e2e.js`
- [API reports](https://github.com/heinerl97/prueba_tecnica_devsu/tree/main/api/reporte): report artifacts · Mochawesome HTML and JSON output from the Cypress run · `api/reporte`
- **Petstore API**: external service · Live backend exercised directly by the API suite
- [Node deps](https://github.com/heinerl97/prueba_tecnica_devsu/blob/main/api/package.json): package manifest · Cypress and Node dependency environment · `api/package.json`

### Browser E2E

Pytest/Selenium Demoblaze purchase-flow pipeline

- [E2E stack](https://github.com/heinerl97/prueba_tecnica_devsu/tree/main/e2e): pytest pipeline · Python and Selenium suite for Demoblaze browser purchase flow · `e2e`
- [Python deps](https://github.com/heinerl97/prueba_tecnica_devsu/blob/main/e2e/requirements.txt): dependency spec · Python package requirements for the Selenium test environment · `e2e/requirements.txt`
- [Pytest setup](https://github.com/heinerl97/prueba_tecnica_devsu/blob/main/e2e/conftest.py): fixture layer · Shared pytest fixtures and test-level setup/teardown · `e2e/conftest.py`
- [Purchase test](https://github.com/heinerl97/prueba_tecnica_devsu/blob/main/e2e/tests/test_purchase_flow.py): ui scenario · Main Demoblaze purchase-journey test case · `e2e/tests/test_purchase_flow.py`
- [Page objects](https://github.com/heinerl97/prueba_tecnica_devsu/tree/main/e2e/pages): page model · UI boundary that isolates selectors and actions from the test · `e2e/pages`
- [Home page](https://github.com/heinerl97/prueba_tecnica_devsu/blob/main/e2e/pages/home_page.py): page object · Entry page interactions and navigation · `e2e/pages/home_page.py`
- [Product page](https://github.com/heinerl97/prueba_tecnica_devsu/blob/main/e2e/pages/product_page.py): page object · Product selection and add-to-cart interactions · `e2e/pages/product_page.py`
- [Cart page](https://github.com/heinerl97/prueba_tecnica_devsu/blob/main/e2e/pages/cart_page.py): page object · Cart inspection and checkout interactions · `e2e/pages/cart_page.py`
- [Checkout page](https://github.com/heinerl97/prueba_tecnica_devsu/blob/main/e2e/pages/purchase_page.py): page object · Purchase form entry and order confirmation · `e2e/pages/purchase_page.py`
- [Driver factory](https://github.com/heinerl97/prueba_tecnica_devsu/blob/main/e2e/utils/driver_factory.py): webdriver factory · Centralized WebDriver creation and browser configuration · `e2e/utils/driver_factory.py`
- [Screenshot util](https://github.com/heinerl97/prueba_tecnica_devsu/blob/main/e2e/utils/screenshot.py): diagnostic helper · Capture support for failures and debugging · `e2e/utils/screenshot.py`
- [E2E reports](https://github.com/heinerl97/prueba_tecnica_devsu/tree/main/e2e/reporte): report artifacts · Allure-style result artifacts from browser runs · `e2e/reporte`
- **Demoblaze site**: external service · Live browser target for the purchase-flow regression

### Other components

- **Repo**: automation repo · Two independent integration-testing subsystems

## Connections

- Repo → API stack: contains · Repository includes the Cypress API testing subsystem
- Repo → E2E stack: contains · Repository includes the Selenium/Pytest E2E subsystem
- API stack → Cypress config: configured by · Cypress runtime is defined in the suite config
- API stack → User tests: executes · Primary API regression spec runs under Cypress
- API stack → Support setup: shares setup · Support file provides shared Cypress test setup
- API stack → Node deps: depends on · Node package manifest defines runtime dependencies
- User tests → Petstore API: calls · Tests issue live HTTP requests to Petstore
- User tests → API reports: writes · Run results are published as Mochawesome artifacts
- User tests → Support setup: uses · Spec relies on Cypress support initialization
- API stack → API reports: publishes · API pipeline emits report artifacts
- E2E stack → Python deps: depends on · Python dependencies define the Selenium environment
- E2E stack → Pytest setup: configured by · Shared fixtures and teardown live in conftest
- E2E stack → Purchase test: executes · Primary browser regression scenario
- E2E stack → Page objects: organized by · UI automation is structured with page objects
- E2E stack → Driver factory: creates browser · WebDriver creation is centralized here
- E2E stack → Screenshot util: diagnostics · Screenshot capture supports failures and debugging
- Purchase test → Page objects: drives · Test flow is expressed through page objects
- Page objects → Home page: includes · Home page object represents the entry point
- Page objects → Product page: includes · Product page object handles selection and add-to-cart
- Page objects → Cart page: includes · Cart page object handles cart review and checkout
- Page objects → Checkout page: includes · Checkout page object handles form completion and confirmation
- Purchase test → Demoblaze site: visits · Browser session exercises the live Demoblaze site
- E2E stack → E2E reports: publishes · Browser suite emits Allure-style result artifacts
