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
| Herramienta | Licencia | Proyecto | Proposito |
|---|---|---|---|
| Playwright | Apache 2.0 | nvito-admin, nvito-invitations | E2E web multi-browser |
| Maestro | Apache 2.0 | nvito-client | E2E mobile nativo |
| k6 | AGPL-3.0 | nvito-api | Load/performance testing |
| Allure Report | Apache 2.0 | Todos | Reportes 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
| Dominio | Tests | Prioridad |
|---|---|---|
| Auth | 6 | P0-P1 |
| Events | 18 | P0-P2 |
| Guests | 14 | P0-P1 |
| Invitations | 10 | P0 |
| Admin | 8 | P1 |
| Error States | 4 | P1 |
| Total | 60 + 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
| Dominio | Tests |
|---|---|
| Render invitaciones | 6 |
| 404/Not Found | 4 |
| Preview mode | 4 |
| Revalidation webhook | 5 |
| Security headers | 6 |
| Performance | 3 |
| Cross-browser | 3 + 10 cross |
| Total | 41 |
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
| Metrica | Umbral |
|---|---|
| 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.
| Proyecto | Reporter | Configuracion |
|---|---|---|
| nvito-api | allure-jest | testEnvironment: 'allure-jest/node' (condicional) |
| nvito-admin | allure-vitest | setupFiles + reporters en vitest.config.ts (condicional) |
| nvito-invitations | allure-vitest | setupFiles + reporters en vitest.config.ts (condicional) |
| nvito-client | allure-jest | testEnvironment: '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
| Proyecto | Unit Tests | E2E Tests | Framework |
|---|---|---|---|
| nvito-api | 202 suites, 3,202 tests | 6 escenarios k6 | k6 |
| nvito-admin | 117 suites, 1,145 tests | 67 tests (14 specs) | Playwright |
| nvito-invitations | 17 suites, 170 tests | 41 tests (7 specs) | Playwright |
| nvito-client | 25 suites, 181 tests | 13 flows | Maestro |
| Total | 361 suites, 4,698 tests | 121+ E2E tests + 13 flows + 6 k6 |