diff --git a/frontend/e2e/auth.setup.ts b/frontend/e2e/auth.setup.ts index 0d68983a..d0cab768 100644 --- a/frontend/e2e/auth.setup.ts +++ b/frontend/e2e/auth.setup.ts @@ -52,11 +52,22 @@ setup('autenticacion', async ({ page }) => { throw e } if (/\/app-launcher/.test(page.url())) { - await page.getByRole('button', { name: /^anexo76-dev/i }).click() + // Nuevo botón de Fixed Assets en el launcher de Workspace. + // Intentar primero el botón de Fixed Asset y, si no existe (compatibilidad), + // caer al botón legacy de anexo76-dev. + const fixedAssetButton = page.getByRole('button', { + name: /fixed asset|activo fijo/i + }) + if (await fixedAssetButton.isVisible().catch(() => false)) { + await fixedAssetButton.click() + } else { + await page.getByRole('button', { name: /^anexo76-dev/i }).click() + } } - // ── 4. Esperar redirect SSO con active_system=fixed_asset ──────────────── - await expect(page).toHaveURL(/active_system=fixed_asset/, { timeout: 30_000 }) + // ── 4. Esperar redirect SSO con active_system=fixed_asset y luego /dashboard ── + await page.waitForURL(/\/auth\/sso\?.*active_system=fixed_asset/, { timeout: 30_000 }) + await page.waitForURL(/\/dashboard/, { timeout: 30_000 }) // ── 5. ExchangeRateGuard abre un dialog modal en cada carga del dashboard // si no existe un tipo de cambio para hoy. El guard espera a que