Docs

E2E Testing & Quality Assurance

Nvito implementa una arquitectura de testing E2E completa utilizando herramientas 100% open source para automatizar la validacion de flujos completos en los 4 proyectos.

Herramientas

HerramientaLicenciaProyectoProposito
PlaywrightApache 2.0nvito-admin, nvito-invitationsE2E web multi-browser
MaestroApache 2.0nvito-clientE2E mobile nativo
k6AGPL-3.0nvito-apiLoad/performance testing
Allure ReportApache 2.0TodosReportes unificados

nvito-admin (Playwright)

Estructura

e2e/
├── auth.setup.ts                    # Autenticacion Clerk
├── fixtures/                        # Helpers y datos de prueba
│   ├── auth.fixture.ts
│   └── test-data.ts
├── pages/                           # Page Object Model
│   ├── sign-in.page.ts
│   ├── events-list.page.ts
│   ├── event-creation.page.ts
│   ├── event-detail.page.ts
│   ├── guests.page.ts
│   ├── invitations.page.ts
│   └── admin/
│       ├── users.page.ts
│       ├── organizations.page.ts
│       └── templates.page.ts
└── specs/                           # Tests organizados por dominio
    ├── auth/
    ├── events/
    ├── guests/
    ├── invitations/
    ├── admin/
    └── error-states/

Ejecutar

# Todos los tests
npx playwright test

# Con UI interactiva
npx playwright test --ui

# Solo smoke tests
npx playwright test --grep @smoke

# Solo cross-browser (Chromium + Firefox)
npx playwright test --grep @cross-browser

Requisitos

  • Variables de entorno: E2E_CLERK_EMAIL, E2E_CLERK_PASSWORD
  • Server corriendo en localhost:5050

Cobertura

DominioTestsPrioridad
Auth6P0-P1
Events18P0-P2
Guests14P0-P1
Invitations10P0
Admin8P1
Error States4P1
Total60 + 7 cross-browser = 67

nvito-invitations (Playwright)

Estructura

e2e/
├── specs/
│   ├── invitation-render.spec.ts
│   ├── invitation-not-found.spec.ts
│   ├── preview-mode.spec.ts
│   ├── revalidation-webhook.spec.ts
│   ├── security-headers.spec.ts
│   ├── performance-metrics.spec.ts
│   └── cross-browser.spec.ts
└── helpers/
    └── test-constants.ts

Ejecutar

npx playwright test
npx playwright test --ui

Cobertura

DominioTests
Render invitaciones6
404/Not Found4
Preview mode4
Revalidation webhook5
Security headers6
Performance3
Cross-browser3 + 10 cross
Total41

nvito-api (k6)

Estructura

test/performance/
├── config/
│   ├── thresholds.js              # Umbrales compartidos
│   └── auth-helpers.js            # Login mobile JWT
├── scenarios/
│   ├── health.js                  # Health + readiness
│   ├── public-endpoints.js        # RSVP, invitation, event-types
│   ├── event-day-simulation.js    # Check-ins 200 VUs concurrentes
│   ├── authenticated-crud.js      # Events/Guests CRUD
│   ├── webhook-processing.js      # Clerk + revalidacion
│   └── media-upload.js            # Presigned URLs
└── load-test.js                   # Test original (mantenido)

Ejecutar

# Escenarios individuales
npm run perf:health
npm run perf:public
npm run perf:event-day

# Escenarios P0 en secuencia
npm run perf:all

Umbrales

MetricaUmbral
p(50) latencia< 200ms
p(95) latencia< 500ms
p(99) latencia< 1000ms
Error rate< 1%
Health p(95)< 100ms

nvito-client (Maestro)

Estructura

maestro/
├── flows/
│   ├── auth/           # Login host, guest, logout
│   ├── host/           # Dashboard, guests, scanner, gallery
│   ├── guest/          # Home, itinerary, gallery
│   └── navigation/     # Deep links
└── scripts/
    ├── run-ios.sh
    └── run-android.sh

Ejecutar

# Instalar Maestro
curl -Ls "https://get.maestro.mobile.dev" | bash

# iOS
bash maestro/scripts/run-ios.sh

# Android
bash maestro/scripts/run-android.sh

# Flow individual
maestro test maestro/flows/auth/host-login.yaml

Cobertura: 13 flows

Dashboard Allure unificado (e2e-shared)

El proyecto e2e-shared genera un dashboard HTML unificado que combina metricas de los 4 proyectos usando Allure Report (Apache 2.0).

Arquitectura

e2e-shared/
├── allure/
│   └── categories.json              # Categorias: Producto, Infraestructura, Ignorados
├── docker/
│   └── docker-compose.e2e.yml       # PostgreSQL (tmpfs) + Redis + MinIO
├── scripts/
│   ├── generate-allure-report.sh    # Combina resultados de los 4 proyectos
│   ├── start-e2e-env.sh             # Levanta entorno Docker aislado
│   └── stop-e2e-env.sh              # Detiene entorno Docker
└── .env.e2e.example                 # Template de variables E2E

Reporters por proyecto

Cada proyecto tiene Allure configurado de forma condicional con la variable de entorno ALLURE=1. Sin esta variable, los tests corren normalmente sin overhead.

ProyectoReporterConfiguracion
nvito-apiallure-jesttestEnvironment: 'allure-jest/node' (condicional)
nvito-adminallure-vitestsetupFiles + reporters en vitest.config.ts (condicional)
nvito-invitationsallure-vitestsetupFiles + reporters en vitest.config.ts (condicional)
nvito-clientallure-jesttestEnvironment: 'allure-jest/node' (condicional)

Generar resultados Allure

# Ejecutar tests con Allure habilitado (genera allure-results/)
cd nvito-api && npm run test:allure
cd nvito-admin && npm run test:allure
cd nvito-invitations && npm run test:allure
cd nvito-client && npm run test:allure

# E2E Playwright ya genera allure-results/ automaticamente (allure-playwright)
cd nvito-admin && npx playwright test
cd nvito-invitations && npx playwright test

Generar y abrir dashboard

# Combinar resultados de los 4 proyectos y generar reporte HTML
bash e2e-shared/scripts/generate-allure-report.sh

# Abrir en el navegador
allure open e2e-shared/allure-report

El script generate-allure-report.sh busca resultados en:

  • nvito-api/allure-results/ (Jest unit)
  • nvito-admin/allure-results/unit/ (Vitest unit) + nvito-admin/allure-results/ (Playwright E2E)
  • nvito-invitations/allure-results/unit/ (Vitest unit) + nvito-invitations/allure-results/ (Playwright E2E)
  • nvito-client/allure-results/ (Jest unit)

Prerequisitos

# Instalar Allure CLI (requiere Java)
brew install allure

Docker Compose E2E

# Levantar entorno aislado
bash e2e-shared/scripts/start-e2e-env.sh

# Detener
bash e2e-shared/scripts/stop-e2e-env.sh

Servicios: PostgreSQL (tmpfs:5433), Redis (no-persist:6380), MinIO (tmpfs:9001).

GitLab CI

Cada proyecto tiene un stage e2e en su .gitlab-ci.yml:

  • nvito-admin: test:e2e:smoke -- Playwright smoke en MR
  • nvito-invitations: test:e2e -- Playwright completo en develop/MR
  • nvito-api: test:performance -- k6 manual en develop
  • nvito-client: Solo quality (typecheck + unit) -- Maestro requiere emulador

Metricas actuales

ProyectoUnit TestsE2E TestsFramework
nvito-api202 suites, 3,202 tests6 escenarios k6k6
nvito-admin117 suites, 1,145 tests67 tests (14 specs)Playwright
nvito-invitations17 suites, 170 tests41 tests (7 specs)Playwright
nvito-client25 suites, 181 tests13 flowsMaestro
Total361 suites, 4,698 tests121+ E2E tests + 13 flows + 6 k6
Esta pagina fue util?