How heinerl97/prueba_tecnica_devsu works
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 E2E stack · api API stack · pages Page objects · user.cy.js User tests
Components 21
API testing
Cypress-based Petstore API regression pipeline
- API stack · Node.js and Cypress suite for Petstore user lifecycle testing
api - Cypress config · Defines Cypress execution boundaries and runtime settings
api/cypress.config.js - User tests · Main Petstore user CRUD test scenario
api/cypress/e2e/petstore/user.cy.js - Support setup · Shared Cypress support-level setup for API tests
api/cypress/support/e2e.js - API reports · Mochawesome HTML and JSON output from the Cypress run
api/reporte - Petstore API · Live backend exercised directly by the API suite
- Node deps · Cypress and Node dependency environment
api/package.json
Browser E2E
Pytest/Selenium Demoblaze purchase-flow pipeline
- E2E stack · Python and Selenium suite for Demoblaze browser purchase flow
e2e - Python deps · Python package requirements for the Selenium test environment
e2e/requirements.txt - Pytest setup · Shared pytest fixtures and test-level setup/teardown
e2e/conftest.py - Purchase test · Main Demoblaze purchase-journey test case
e2e/tests/test_purchase_flow.py - Page objects · UI boundary that isolates selectors and actions from the test
e2e/pages - Home page · Entry page interactions and navigation
e2e/pages/home_page.py - Product page · Product selection and add-to-cart interactions
e2e/pages/product_page.py - Cart page · Cart inspection and checkout interactions
e2e/pages/cart_page.py - Checkout page · Purchase form entry and order confirmation
e2e/pages/purchase_page.py - Driver factory · Centralized WebDriver creation and browser configuration
e2e/utils/driver_factory.py - Screenshot util · Capture support for failures and debugging
e2e/utils/screenshot.py - E2E reports · Allure-style result artifacts from browser runs
e2e/reporte - Demoblaze site · Live browser target for the purchase-flow regression
Other components
- Repo · Two independent integration-testing subsystems
Connections 23
- 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