OmniRoute/tests/e2e/protocol-visibility.spec.ts
diegosouzapw f697c56922 fix(ci): repair unit, e2e and i18n failures
- tests/unit/combo-circuit-breaker: use full model path keys
  (combo:groq/llama-3.3-70b) matching combo.ts implementation
- tests/e2e/protocol-visibility: click Protocols tab before asserting
  MCP/A2A links (they moved into tab panel, not header nav)
- src/i18n/messages/en.json: add missing header.mcp / header.a2a keys
  that caused MISSING_MESSAGE runtime errors during E2E boot
2026-03-10 08:47:06 -03:00

41 lines
1.9 KiB
TypeScript

import { test, expect } from "@playwright/test";
test.describe("Protocol visibility", () => {
test("shows MCP/A2A links inside protocols tab in endpoint page", async ({ page }) => {
await page.goto("/dashboard/endpoint");
await page.waitForLoadState("networkidle");
const redirectedToLogin = page.url().includes("/login");
test.skip(redirectedToLogin, "Authentication enabled without a login fixture.");
// MCP and A2A are now shown inside the "Protocols" tab — click it first
const protocolTab = page.getByRole("tab", { name: /protocols|protocolos/i });
await expect(protocolTab).toBeVisible();
await protocolTab.click();
// Links to MCP and A2A management pages appear after tab switch
await expect(page.locator('a[href="/dashboard/mcp"]').first()).toBeVisible();
await expect(page.locator('a[href="/dashboard/a2a"]').first()).toBeVisible();
const mcpLinks = await page.locator('a[href="/dashboard/mcp"]').count();
const a2aLinks = await page.locator('a[href="/dashboard/a2a"]').count();
expect(mcpLinks).toBeGreaterThanOrEqual(1);
expect(a2aLinks).toBeGreaterThanOrEqual(1);
});
test("loads MCP and A2A dashboards without runtime error page", async ({ page }) => {
await page.goto("/dashboard/mcp");
await page.waitForLoadState("networkidle");
let redirectedToLogin = page.url().includes("/login");
test.skip(redirectedToLogin, "Authentication enabled without a login fixture.");
await expect(page.locator("body")).toBeVisible();
await expect(page.locator("body")).not.toContainText(/application error|500/i);
await page.goto("/dashboard/a2a");
await page.waitForLoadState("networkidle");
redirectedToLogin = page.url().includes("/login");
test.skip(redirectedToLogin, "Authentication enabled without a login fixture.");
await expect(page.locator("body")).toBeVisible();
await expect(page.locator("body")).not.toContainText(/application error|500/i);
});
});