Sprint 4 — Etapa 8: reporte de entrega
Some checks failed
/ Deploy to Cloudflare Pages (push) Has been cancelled

Tier 1 — Automatizado
Build:  limpio
Lint:  limpio en archivos nuevos de Sprint 4 (separé resource-types.ts de resource-display.tsx para sacar 2 warnings de Fast Refresh; quedan 0 errores/warnings nuevos). Quedó 1 error preexistente en ReportPage.tsx (no tocado desde Sprint 3, fuera de scope) y ~102 warnings no-explicit-any preexistentes en tests viejos.
Tests unitarios:  521/521 verdes
Tests E2E: ⚠️ 43-44/48 verdes (varía levemente entre corridas) — detalle abajo
Auditoría inicial vs. estado final
Antes: 39/39 specs (100%) fallaban — ROJO-AUTH puro, todos por #bpmn-file-input nunca apareciendo (esperaban el flujo pre-Sprint-4 directamente en /).

Decisión tomada (con tu input): Opción A — sesión real. Creaste el usuario martin.bernal@inquality.com.py; yo verifiqué que no tenía fila en public.users y se la inserté con platform_role='platform_admin'. Implementé tests/e2e/setup/auth-setup.ts como globalSetup de Playwright: hace signInWithPassword, inyecta la sesión real en localStorage con el formato exacto que usa supabase-js v2, y genera tests/e2e/setup/auth-state.json (gitignored) en cada corrida.

Fix adicional necesario: todos los specs navegaban a / esperando el input de archivo ahí — ahora vive en /import. Corregí los 18 page.goto('/') → /import, incluyendo reescribir el flujo obsoleto de prod-smoke.spec.ts (esperaba una landing pre-auth que ya no existe).

Resultado: 33→43-44 specs pasan. Quedan 5-6 ROJO-OTRO, con dos causas raíz identificadas (no relacionadas con auth, fuera del mandato de esta etapa que pide no reescribir lógica de tests):

Botón "Guardar" en ActivityPanel queda deshabilitado (3 specs de PDF) — encontré algo extraño: el texto del botón dice "Guardar cambios" (que solo se renderiza si isDirty=true) pero Playwright lo sigue viendo disabled. Esto contradice la lógica simple de disabled={!isDirty} en el componente — sospecho un bug real de re-render en producción, pero diagnosticarlo a fondo requiere debugging en vivo. Recomiendo abrir esto como bug dedicado en un sprint futuro.
2 specs usan IndexedDB/Dexie directamente (export-pdf.spec.ts, validate-dod-etapa4.spec.ts) — Dexie se eliminó completamente en Etapa 4. Estos tests necesitan reescritura para inyectar datos vía Supabase en vez de IndexedDB — eso sí es "reescribir lógica de tests", explícitamente fuera de este alcance.
Los resultados varían levemente entre corridas porque Playwright corre specs en paralelo bajo la misma cuenta de test compartida — puede haber interferencia de datos entre specs concurrentes. Sugiero como mejora futura (no implementada ahora): --workers=1 para diagnóstico determinístico.

Entregables nuevos
tests/e2e/setup/auth-setup.ts — global setup con sesión real
tests/e2e/sprint-4-smoke.spec.ts — 9 tests (4 sin auth: login, redirects de /, /workspace, /recursos; 5 con auth: biblioteca sin 500, sin 406 en simulations, catálogo carga, avatar visible, import navega a workspace)
docs/CHECKLIST_ENTREGA.md — las 4 tiers completas
.env.test (gitignored) + .env.example documentado
.gitignore actualizado (.env.test, auth-state.json)
Polish
Textos de OwnershipBadge y "Compartir con equipo" ya estaban en español — sin cambios.
Tooltip "Disponible próximamente" para "Compartir con equipo": no lo agregué, tal como pedía el propio brief, consultarte antes. ¿Lo querés?
This commit is contained in:
2026-06-19 11:22:50 -03:00
parent f77085c42d
commit 84daf82e65
42 changed files with 701 additions and 50 deletions

View File

@@ -9,6 +9,8 @@ import { fileURLToPath } from 'url'
import { PDFParse } from 'pdf-parse'
import { getDocument } from 'pdfjs-dist/legacy/build/pdf.mjs'
test.use({ storageState: 'tests/e2e/setup/auth-state.json' })
const __dirname = fileURLToPath(new URL('.', import.meta.url))
const BPMN_DIR = resolve(__dirname, '../../public/sample-processes')
const OUT_DIR = resolve(__dirname, './__output__')
@@ -35,7 +37,7 @@ async function getOrientations(buffer: Buffer): Promise<string[]> {
}
test('etapa-11-roi.pdf — polish final página 1 ROI', async ({ page }) => {
await page.goto('/')
await page.goto('/import')
await page.locator('#bpmn-file-input').setInputFiles(resolve(BPMN_DIR, 'medium-with-gateways.bpmn'))
await page.waitForURL(/\/workspace\//, { timeout: 15_000 })
await page.waitForSelector('button:has-text("Simular")', { timeout: 10_000 })

View File

@@ -13,6 +13,8 @@ import { mkdirSync, readFileSync } from 'fs'
import { fileURLToPath } from 'url'
import { PDFParse } from 'pdf-parse'
test.use({ storageState: 'tests/e2e/setup/auth-state.json' })
const __dirname = fileURLToPath(new URL('.', import.meta.url))
const BPMN_DIR = resolve(__dirname, '../../public/sample-processes')
const OUT_DIR = resolve(__dirname, './__output__')
@@ -22,7 +24,7 @@ test.beforeAll(() => { mkdirSync(OUT_DIR, { recursive: true }) })
// ─── Helpers ──────────────────────────────────────────────────────────────────
async function importBpmn(page: import('@playwright/test').Page, filename: string) {
await page.goto('/')
await page.goto('/import')
await page.locator('#bpmn-file-input').setInputFiles(resolve(BPMN_DIR, filename))
await page.waitForURL(/\/workspace\//, { timeout: 15_000 })
await page.waitForSelector('button:has-text("Simular")', { timeout: 10_000 })

View File

@@ -16,6 +16,8 @@ import { fileURLToPath } from 'url'
import { PDFParse } from 'pdf-parse'
import { getDocument } from 'pdfjs-dist/legacy/build/pdf.mjs'
test.use({ storageState: 'tests/e2e/setup/auth-state.json' })
const __dirname = fileURLToPath(new URL('.', import.meta.url))
const BPMN_DIR = resolve(__dirname, '../../public/sample-processes')
const OUT_DIR = resolve(__dirname, './__output__')
@@ -44,7 +46,7 @@ async function getPageOrientations(buffer: Buffer): Promise<Array<'portrait' | '
}
async function importBpmn(page: import('@playwright/test').Page, filename: string) {
await page.goto('/')
await page.goto('/import')
await page.locator('#bpmn-file-input').setInputFiles(resolve(BPMN_DIR, filename))
await page.waitForURL(/\/workspace\//, { timeout: 15_000 })
await page.waitForSelector('button:has-text("Simular")', { timeout: 10_000 })

View File

@@ -18,6 +18,8 @@ import { fileURLToPath } from 'url'
import { PDFParse } from 'pdf-parse'
import { getDocument } from 'pdfjs-dist/legacy/build/pdf.mjs'
test.use({ storageState: 'tests/e2e/setup/auth-state.json' })
const __dirname = fileURLToPath(new URL('.', import.meta.url))
const BPMN_DIR = resolve(__dirname, '../../public/sample-processes')
const OUT_DIR = resolve(__dirname, './__output__')
@@ -46,7 +48,7 @@ async function getPageOrientations(buffer: Buffer): Promise<Array<'portrait' | '
}
async function importBpmn(page: import('@playwright/test').Page, filename: string) {
await page.goto('/')
await page.goto('/import')
await page.locator('#bpmn-file-input').setInputFiles(resolve(BPMN_DIR, filename))
await page.waitForURL(/\/workspace\//, { timeout: 15_000 })
await page.waitForSelector('button:has-text("Simular")', { timeout: 10_000 })

View File

@@ -18,6 +18,8 @@ import { fileURLToPath } from 'url'
import { PDFParse } from 'pdf-parse'
import { getDocument } from 'pdfjs-dist/legacy/build/pdf.mjs'
test.use({ storageState: 'tests/e2e/setup/auth-state.json' })
const __dirname = fileURLToPath(new URL('.', import.meta.url))
const BPMN_DIR = resolve(__dirname, '../../public/sample-processes')
const OUT_DIR = resolve(__dirname, './__output__')
@@ -46,7 +48,7 @@ async function getPageOrientations(buffer: Buffer): Promise<Array<'portrait' | '
}
async function setupAndSimulate(page: import('@playwright/test').Page) {
await page.goto('/')
await page.goto('/import')
await page.locator('#bpmn-file-input').setInputFiles(resolve(BPMN_DIR, 'medium-with-gateways.bpmn'))
await page.waitForURL(/\/workspace\//, { timeout: 15_000 })
await page.waitForSelector('button:has-text("Simular")', { timeout: 10_000 })

View File

@@ -19,6 +19,8 @@ import { fileURLToPath } from 'url'
import { PDFParse } from 'pdf-parse'
import { getDocument } from 'pdfjs-dist/legacy/build/pdf.mjs'
test.use({ storageState: 'tests/e2e/setup/auth-state.json' })
const __dirname = fileURLToPath(new URL('.', import.meta.url))
const BPMN_DIR = resolve(__dirname, '../../public/sample-processes')
const OUT_DIR = resolve(__dirname, './__output__')
@@ -45,7 +47,7 @@ async function getPageOrientations(buffer: Buffer): Promise<Array<'portrait' | '
}
async function setupAndSimulate(page: import('@playwright/test').Page) {
await page.goto('/')
await page.goto('/import')
await page.locator('#bpmn-file-input').setInputFiles(resolve(BPMN_DIR, 'medium-with-gateways.bpmn'))
await page.waitForURL(/\/workspace\//, { timeout: 15_000 })
await page.waitForSelector('button:has-text("Simular")', { timeout: 10_000 })

View File

@@ -13,6 +13,8 @@ import { resolve } from 'path'
import { mkdirSync } from 'fs'
import { fileURLToPath } from 'url'
test.use({ storageState: 'tests/e2e/setup/auth-state.json' })
const __dirname = fileURLToPath(new URL('.', import.meta.url))
const BPMN_DIR = resolve(__dirname, '../../public/sample-processes')
const SCREENSHOTS_DIR = resolve(__dirname, '../screenshots/etapa-9')
@@ -20,7 +22,7 @@ const SCREENSHOTS_DIR = resolve(__dirname, '../screenshots/etapa-9')
test.beforeAll(() => { mkdirSync(SCREENSHOTS_DIR, { recursive: true }) })
async function loadProcess(page: import('@playwright/test').Page, filename: string) {
await page.goto('/')
await page.goto('/import')
await page.locator('#bpmn-file-input').setInputFiles(resolve(BPMN_DIR, filename))
await page.waitForURL(/\/workspace\//, { timeout: 15_000 })
await page.waitForSelector('button:has-text("Simular")', { timeout: 10_000 })

View File

@@ -14,6 +14,8 @@ import { PDFParse } from 'pdf-parse'
import sharp from 'sharp'
import { PDFDocument, PDFName, PDFRawStream } from 'pdf-lib'
test.use({ storageState: 'tests/e2e/setup/auth-state.json' })
const __dirname = fileURLToPath(new URL('.', import.meta.url))
const BPMN_DIR = resolve(__dirname, '../../public/sample-processes')
const OUTPUT_DIR = resolve(__dirname, '__output__')
@@ -34,7 +36,7 @@ async function parsePdf(buffer: Buffer): Promise<{ numpages: number; text: strin
// ─── Helper: importa un BPMN, simula y llega al reporte ──────────────────────
async function importAndSimulate(page: import('@playwright/test').Page, bpmnFile: string) {
await page.goto('/')
await page.goto('/import')
// Subir el BPMN vía el input oculto (equivalente a drag-and-drop programático)
const fileInput = page.locator('#bpmn-file-input')
@@ -308,7 +310,7 @@ test('Heatmap con gradiente real — medium-with-gateways.bpmn', async ({ page }
}
// ── 1. Importar BPMN y navegar al workspace ─────────────────────────────────
await page.goto('/')
await page.goto('/import')
await page.locator('#bpmn-file-input').setInputFiles(resolve(BPMN_DIR, 'medium-with-gateways.bpmn'))
await page.waitForURL(/\/workspace\//)

View File

@@ -21,6 +21,8 @@ import { resolve } from 'path'
import { fileURLToPath } from 'url'
import { PDFParse } from 'pdf-parse'
test.use({ storageState: 'tests/e2e/setup/auth-state.json' })
const __dirname = fileURLToPath(new URL('.', import.meta.url))
const BPMN_DIR = resolve(__dirname, '../../public/sample-processes')
const OUTPUT_DIR = resolve(__dirname, '__output__')
@@ -39,7 +41,7 @@ async function parsePdf(buffer: Buffer): Promise<{ numpages: number; text: strin
// ─── Helper: importar BPMN y llegar al workspace ──────────────────────────────
async function importBpmn(page: import('@playwright/test').Page, bpmnFile: string) {
await page.goto('/')
await page.goto('/import')
const fileInput = page.locator('#bpmn-file-input')
await fileInput.setInputFiles(resolve(BPMN_DIR, bpmnFile))
await page.waitForURL(/\/workspace\//, { timeout: 15_000 })

View File

@@ -17,6 +17,8 @@ import { resolve } from 'path'
import { mkdirSync } from 'fs'
import { fileURLToPath } from 'url'
test.use({ storageState: 'tests/e2e/setup/auth-state.json' })
const __dirname = fileURLToPath(new URL('.', import.meta.url))
const BPMN_DIR = resolve(__dirname, '../../public/sample-processes')
const OUT_DIR = resolve(__dirname, './__output__')
@@ -26,7 +28,7 @@ test.beforeAll(() => { mkdirSync(OUT_DIR, { recursive: true }) })
// ─── Helpers ──────────────────────────────────────────────────────────────────
async function importBpmn(page: import('@playwright/test').Page, filename: string) {
await page.goto('/')
await page.goto('/import')
await page.locator('#bpmn-file-input').setInputFiles(resolve(BPMN_DIR, filename))
await page.waitForURL(/\/workspace\//, { timeout: 15_000 })
await page.waitForSelector('button:has-text("Simular")', { timeout: 10_000 })

View File

@@ -9,6 +9,8 @@ import { readFileSync, mkdirSync } from 'fs'
import { resolve } from 'path'
import { fileURLToPath } from 'url'
test.use({ storageState: 'tests/e2e/setup/auth-state.json' })
const __dirname = fileURLToPath(new URL('.', import.meta.url))
const OUTPUT_DIR = resolve(__dirname, '__output__')
@@ -17,15 +19,12 @@ test.beforeAll(() => {
})
test('prod-smoke — import → simulate → export PDF', async ({ page }) => {
// ── 1. Landing page carga correctamente ──────────────────────────────────
await page.goto('/')
// ── 1. Página de import carga correctamente (Sprint 4: requiere sesión) ───
await page.goto('/import')
await expect(page).toHaveTitle(/InQ ROI/)
// Verificar heading principal
await expect(page.getByText('Cuantificá el costo operativo')).toBeVisible({ timeout: 10_000 })
// Verificar que los 3 procesos de ejemplo están presentes
await expect(page.getByText('Aprobación de crédito')).toBeVisible()
await expect(page.getByText('Aprobación de crédito')).toBeVisible({ timeout: 10_000 })
await expect(page.getByText('Proceso lineal simple')).toBeVisible()
await expect(page.getByText('Control de calidad con revisión')).toBeVisible()

View File

@@ -14,6 +14,8 @@ import { resolve } from 'path'
import { mkdirSync } from 'fs'
import { fileURLToPath } from 'url'
test.use({ storageState: 'tests/e2e/setup/auth-state.json' })
const __dirname = fileURLToPath(new URL('.', import.meta.url))
const BPMN_DIR = resolve(__dirname, '../../public/sample-processes')
const OUT_DIR = resolve(__dirname, '../screenshots/etapa-1')
@@ -21,7 +23,7 @@ const OUT_DIR = resolve(__dirname, '../screenshots/etapa-1')
test.beforeAll(() => { mkdirSync(OUT_DIR, { recursive: true }) })
test('screenshot workspace — CTAs naranjas visibles', async ({ page }) => {
await page.goto('/')
await page.goto('/import')
await page.locator('#bpmn-file-input').setInputFiles(resolve(BPMN_DIR, 'simple-linear.bpmn'))
await page.waitForURL(/\/workspace\//, { timeout: 15_000 })
await page.waitForSelector('button:has-text("Simular")', { timeout: 10_000 })
@@ -31,7 +33,7 @@ test('screenshot workspace — CTAs naranjas visibles', async ({ page }) => {
})
test('screenshot switch ON — switch de automatización naranja', async ({ page }) => {
await page.goto('/')
await page.goto('/import')
await page.locator('#bpmn-file-input').setInputFiles(resolve(BPMN_DIR, 'simple-linear.bpmn'))
await page.waitForURL(/\/workspace\//, { timeout: 15_000 })
await page.waitForSelector('button:has-text("Simular")', { timeout: 10_000 })
@@ -50,7 +52,7 @@ test('screenshot switch ON — switch de automatización naranja', async ({ page
})
test('screenshot report-tabs — tab activo naranja', async ({ page }) => {
await page.goto('/')
await page.goto('/import')
await page.locator('#bpmn-file-input').setInputFiles(resolve(BPMN_DIR, 'medium-with-gateways.bpmn'))
await page.waitForURL(/\/workspace\//, { timeout: 15_000 })
await page.waitForSelector('button:has-text("Simular")', { timeout: 10_000 })

View File

@@ -16,6 +16,8 @@ import { resolve } from 'path'
import { mkdirSync } from 'fs'
import { fileURLToPath } from 'url'
test.use({ storageState: 'tests/e2e/setup/auth-state.json' })
const __dirname = fileURLToPath(new URL('.', import.meta.url))
const BPMN_DIR = resolve(__dirname, '../../public/sample-processes')
const OUT_DIR = resolve(__dirname, '../screenshots/etapa-3')
@@ -25,7 +27,7 @@ test.beforeAll(() => { mkdirSync(OUT_DIR, { recursive: true }) })
// ─── Helpers ──────────────────────────────────────────────────────────────────
async function importBpmn(page: import('@playwright/test').Page, filename: string) {
await page.goto('/')
await page.goto('/import')
await page.locator('#bpmn-file-input').setInputFiles(resolve(BPMN_DIR, filename))
await page.waitForURL(/\/workspace\//, { timeout: 15_000 })
await page.waitForSelector('button:has-text("Simular")', { timeout: 10_000 })

View File

@@ -0,0 +1,83 @@
// Global setup de Playwright — Sprint 4 Etapa 8.
//
// Decisión tomada: Opción A (sesión real contra Supabase con usuario de test
// email/password, platform_role='platform_admin' en public.users). Permite que
// los specs E2E ejerciten el flujo real de auth + RLS + queries, no un mock.
//
// Usuario de test creado manualmente en Supabase Studio (no vía signup automático).
// Credenciales en .env.test (gitignored) — ver .env.example para el formato.
//
// Genera tests/e2e/setup/auth-state.json: storageState de Playwright con la
// sesión inyectada en localStorage bajo la clave sb-{project_ref}-auth-token,
// el mismo formato que usa supabase-js v2 y que AuthContext.getUserFromStorage()
// espera leer. Los specs que necesitan auth usan:
// test.use({ storageState: 'tests/e2e/setup/auth-state.json' })
import { chromium } from '@playwright/test'
import { createClient } from '@supabase/supabase-js'
import { readFileSync, existsSync } from 'fs'
import { resolve } from 'path'
import { fileURLToPath } from 'url'
const __dirname = fileURLToPath(new URL('.', import.meta.url))
const ROOT = resolve(__dirname, '../../..')
const STATE_PATH = resolve(__dirname, 'auth-state.json')
function loadEnvFile(filename: string): Record<string, string> {
const path = resolve(ROOT, filename)
if (!existsSync(path)) return {}
const out: Record<string, string> = {}
for (const line of readFileSync(path, 'utf-8').split('\n')) {
const trimmed = line.trim()
if (!trimmed || trimmed.startsWith('#')) continue
const idx = trimmed.indexOf('=')
if (idx === -1) continue
out[trimmed.slice(0, idx)] = trimmed.slice(idx + 1)
}
return out
}
async function globalSetup() {
const local = loadEnvFile('.env.local')
const test = loadEnvFile('.env.test')
const supabaseUrl = local.VITE_SUPABASE_URL
const supabaseAnonKey = local.VITE_SUPABASE_ANON_KEY
const email = test.TEST_USER_EMAIL
const password = test.TEST_USER_PASSWORD
if (!supabaseUrl || !supabaseAnonKey) {
console.warn('[auth-setup] VITE_SUPABASE_URL/ANON_KEY no encontradas en .env.local — specs con auth se saltarán storageState')
return
}
if (!email || !password) {
console.warn('[auth-setup] TEST_USER_EMAIL/PASSWORD no encontradas en .env.test — specs con auth se saltarán storageState')
return
}
const supabase = createClient(supabaseUrl, supabaseAnonKey)
const { data, error } = await supabase.auth.signInWithPassword({ email, password })
if (error || !data.session) {
console.error('[auth-setup] Login de usuario de test falló:', error?.message)
return
}
const projectRef = new URL(supabaseUrl).hostname.split('.')[0]
const storageKey = `sb-${projectRef}-auth-token`
const browser = await chromium.launch()
const page = await browser.newPage()
await page.goto('http://localhost:4173/login')
await page.evaluate(
([key, session]) => {
window.localStorage.setItem(key, JSON.stringify(session))
},
[storageKey, data.session] as const
)
await page.context().storageState({ path: STATE_PATH })
await browser.close()
console.log(`[auth-setup] Sesión de test guardada en ${STATE_PATH}`)
}
export default globalSetup

View File

@@ -10,6 +10,8 @@ import { fileURLToPath } from 'url'
import { PDFParse } from 'pdf-parse'
import { getDocument } from 'pdfjs-dist/legacy/build/pdf.mjs'
test.use({ storageState: 'tests/e2e/setup/auth-state.json' })
const __dirname = fileURLToPath(new URL('.', import.meta.url))
const BPMN_DIR = resolve(__dirname, '../../public/sample-processes')
const OUT_DIR = resolve(__dirname, './__output__/sprint-1-5-final')
@@ -36,7 +38,7 @@ async function getOrientations(buffer: Buffer): Promise<string[]> {
}
async function setupFullScenario(page: import('@playwright/test').Page) {
await page.goto('/')
await page.goto('/import')
await page.locator('#bpmn-file-input').setInputFiles(resolve(BPMN_DIR, 'medium-with-gateways.bpmn'))
await page.waitForURL(/\/workspace\//, { timeout: 15_000 })
await page.waitForSelector('button:has-text("Simular")', { timeout: 10_000 })

View File

@@ -0,0 +1,77 @@
/**
* Sprint 4 — Etapa 8: smoke tests de los flujos críticos introducidos por el sprint
* (auth, biblioteca con Supabase, catálogo de recursos).
*
* Los tests "sin auth" verifican el guard de rutas protegidas — corren sin storageState.
* Los tests "con auth" usan la sesión real generada por tests/e2e/setup/auth-setup.ts.
*/
import { test, expect } from '@playwright/test'
// ─── Sin auth — deben pasar sin sesión ────────────────────────────────────────
test.describe('Sin sesión', () => {
test('login page renders — botón de Google visible', async ({ page }) => {
await page.goto('/login')
await expect(page.getByRole('button', { name: /iniciar sesión con google/i })).toBeVisible()
})
test('protected route / redirects to login', async ({ page }) => {
await page.goto('/')
await expect(page).toHaveURL(/\/login/)
})
test('protected route /workspace redirects to login', async ({ page }) => {
await page.goto('/workspace/fake-id')
await expect(page).toHaveURL(/\/login/)
})
test('protected route /recursos redirects to login', async ({ page }) => {
await page.goto('/recursos')
await expect(page).toHaveURL(/\/login/)
})
})
// ─── Con auth — requieren sesión de test ──────────────────────────────────────
test.describe('Con sesión', () => {
test.use({ storageState: 'tests/e2e/setup/auth-state.json' })
test('library loads after auth — sin errores 500', async ({ page }) => {
const errors: string[] = []
page.on('response', (r) => { if (r.status() >= 500) errors.push(r.url()) })
await page.goto('/')
await page.waitForLoadState('networkidle')
expect(errors).toHaveLength(0)
})
test('library — sin errores 406 en queries de simulations', async ({ page }) => {
const errors406: string[] = []
page.on('response', (r) => {
if (r.status() === 406 && r.url().includes('simulations')) errors406.push(r.url())
})
await page.goto('/')
await page.waitForLoadState('networkidle')
expect(errors406).toHaveLength(0)
})
test('catalog page loads at /recursos', async ({ page }) => {
await page.goto('/recursos')
await expect(page.getByRole('heading', { name: /catálogo de recursos/i })).toBeVisible()
})
test('app header shows user avatar', async ({ page }) => {
await page.goto('/')
// El trigger del dropdown de usuario tiene title={user.name} (ver AppHeader.tsx)
await expect(page.locator('header button[title]').first()).toBeVisible()
})
test('import BPMN — navega al workspace', async ({ page }) => {
await page.goto('/import')
await page.getByText('Proceso lineal simple').click()
await expect(page).toHaveURL(/\/workspace\//, { timeout: 15_000 })
})
})

View File

@@ -22,6 +22,8 @@ import { PDFParse } from 'pdf-parse'
import sharp from 'sharp'
import { PDFDocument, PDFName, PDFRawStream } from 'pdf-lib'
test.use({ storageState: 'tests/e2e/setup/auth-state.json' })
const __dirname = fileURLToPath(new URL('.', import.meta.url))
const BPMN_DIR = resolve(__dirname, '../../public/sample-processes')
const OUTPUT_DIR = resolve(__dirname, '__output__')
@@ -109,7 +111,7 @@ const AUTO_TIME = 5
test('DoD Etapa 4 — genera y valida los 6 archivos de export para medium-with-gateways', async ({ page }) => {
// ── Fase 1: importar BPMN e inyectar configuración en IndexedDB ─────────────
await page.goto('/')
await page.goto('/import')
await page.locator('#bpmn-file-input').setInputFiles(resolve(BPMN_DIR, 'medium-with-gateways.bpmn'))
await page.waitForURL(/\/workspace\//, { timeout: 15_000 })
const processId = page.url().split('/workspace/')[1]

Binary file not shown.

Before

Width:  |  Height:  |  Size: 96 KiB

After

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

After

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 110 KiB

After

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 107 KiB

After

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

After

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

After

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 172 KiB

After

Width:  |  Height:  |  Size: 190 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

After

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 110 KiB

After

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 101 KiB

After

Width:  |  Height:  |  Size: 110 KiB