FactuGES_ERP/tests/e2e
David ba257fd489 Add end-to-end tests for proforma customer selection and persistence
- Implement tests to verify that the selected customer is retained when creating a proforma.
- Add functionality to change the customer and ensure the change is persisted.
- Include tests to confirm the customer change and refresh the recipient name.
- Test cancellation of customer change to ensure the previous customer remains selected.
2026-09-15 11:37:50 +02:00
..
customer-invoices/proformas Add end-to-end tests for proforma customer selection and persistence 2026-09-15 11:37:50 +02:00
customers feat(customers): implementar pruebas y lógica de ordenación para la lista de clientes 2026-09-14 10:53:11 +02:00
identity feat(e2e): agregar pruebas E2E para la creación y actualización de clientes, y mejorar la navegación 2026-09-10 17:32:09 +02:00
support feat(e2e): agregar pruebas E2E para la creación y actualización de clientes, y mejorar la navegación 2026-09-10 17:32:09 +02:00
.gitkeep Entorno para test E2E 2026-09-10 14:04:03 +02:00
README.md Entorno para test E2E 2026-09-10 14:04:03 +02:00

Infraestructura E2E

Suite de Playwright para navegador, frontend, backend y MariaDB E2E. Aún no contiene pruebas funcionales.

Estructura

El primer nivel debe coincidir exactamente con el módulo propietario en modules: por ejemplo, identity usará tests/e2e/identity/login.spec.ts y facturas de clientes tests/e2e/customer-invoices/. No usar auth, invoices ni settings. support/ es exclusivamente infraestructura transversal.

Variables y base de datos

Copia apps/server/.env.e2e.example a apps/server/.env.e2e y completa una MariaDB exclusiva E2E; DB_NAME nunca debe ser la base de desarrollo. Copia apps/web/.env.e2e.example a apps/web/.env.e2e.

El backend arranca con node --env-file=.env.e2e, que prevalece sobre .env. La plantilla usa DB_SYNC_MODE=none; no hay reset, seed ni operación destructiva en esta fase. Las futuras operaciones destructivas deberán rechazar cualquier base que no sea E2E.

E2E_BASE_URL permite usar un stack E2E ya iniciado y evita levantar procesos locales. Futuras credenciales: E2E_USER_EMAIL y E2E_USER_PASSWORD, nunca versionadas.

Ejecución

pnpm test:e2e
pnpm test:e2e:ui
pnpm test:e2e:headed

Localmente se espera backend en http://127.0.0.1:3002/api/v1/__ready y Vite en http://127.0.0.1:5173.

Selectores

Prioridad: id técnico estable, data-testid, atributo técnico como name y CSS estable solo excepcionalmente. No usar textos, labels o aria-label traducibles, Tailwind visual, nth-child ni DOM incidental. Playwright configura data-testid.