The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
test(ui): wait for the logout navigation before checking the session is gone (#47008)
yuneng-jiang53ef63145bab
diff --git a/tests/e2e/ui/tests/auth/logout.spec.ts b/tests/e2e/ui/tests/auth/logout.spec.tsindex fcdd71898e2..8d251d52ef7 100644--- a/tests/e2e/ui/tests/auth/logout.spec.ts+++ b/tests/e2e/ui/tests/auth/logout.spec.ts@@ -2,6 +2,8 @@ import { test, expect } from "@playwright/test";import { Role, users } from "../../fixtures/users";import { logInThroughLoginPage } from "../../helpers/userOnboarding";+const LOGOUT_URL = process.env.PROXY_LOGOUT_URL ?? "";+test.describe("Logout", () => {test.use({ storageState: { cookies: [], origins: [] } });@@ -9,9 +11,21 @@ test.describe("Logout", () => {const admin = users[Role.ProxyAdmin];await logInThroughLoginPage(page, admin.email, admin.password);+ if (LOGOUT_URL) {+ const target = new URL(LOGOUT_URL);+ await page.route(+ (url) => url.origin === target.origin,+ (route) =>+ route.fulfill({ status: 200, contentType: "text/html", body: "<html><body>logged out</body></html>" }),+ );+ }+ const settingsLoaded = page.waitForResponse((r) => r.url().includes("/sso/get/ui_settings") && r.ok(), {+ timeout: 30_000,+ });await page.goto("/ui");// Scope to the sidebar; the top-bar breadcrumb also shows "Virtual Keys".await expect(page.getByRole("complementary").getByText("Virtual Keys")).toBeVisible({ timeout: 10_000 });+ await settingsLoaded;// Open the sidebar account menu. The trigger button exposes an aria-label// of "Account menu — <role> — signed in as <email>"; clicking it opens the@@ -22,8 +36,12 @@ test.describe("Logout", () => {await expect(popup).toBeVisible({ timeout: 5_000 });// Click Logout — the handler clears the auth cookie and navigates via- // window.location.href = PROXY_LOGOUT_URL (empty string in the e2e env).+ // window.location.href = PROXY_LOGOUT_URL.+ const loggedOut = LOGOUT_URL+ ? page.waitForURL((url) => url.origin === new URL(LOGOUT_URL).origin, { timeout: 15_000 })+ : page.waitForEvent("load", { timeout: 15_000 });await popup.getByRole("button", { name: "Logout" }).click();+ await loggedOut;await expect.poll(async () => (await page.context().cookies()).filter((c) => c.name === "token").length, {timeout: 15_000,