Skip to content

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]

e2e tests

yuneng-jiang3de84b3f8b2e
diff --git a/litellm/proxy/proxy_server.py b/litellm/proxy/proxy_server.py
index 40436e1716b..ebe2a90f37f 100644
--- a/litellm/proxy/proxy_server.py
+++ b/litellm/proxy/proxy_server.py
@@ -555,7 +555,7 @@ else:
global_max_parallel_request_retry_timeout_env
)
-ui_link = f"{server_root_path}/ui/login"
+ui_link = f"{server_root_path}/ui"
fallback_login_link = f"{server_root_path}/fallback/login"
model_hub_link = f"{server_root_path}/ui/model_hub_table"
ui_message = (
diff --git a/tests/proxy_admin_ui_tests/e2e_ui_tests/login_to_ui.spec.ts b/tests/proxy_admin_ui_tests/e2e_ui_tests/login_to_ui.spec.ts
index fc4d4653246..793ae53b39a 100644
--- a/tests/proxy_admin_ui_tests/e2e_ui_tests/login_to_ui.spec.ts
+++ b/tests/proxy_admin_ui_tests/e2e_ui_tests/login_to_ui.spec.ts
@@ -10,7 +10,9 @@ import { test, expect } from "@playwright/test";
test("admin login test", async ({ page }) => {
// Go to the specified URL
- await page.goto("http://localhost:4000/ui/login");
+ await page.goto("http://localhost:4000/ui");
+
+ page.screenshot({ path: "login_before.png" });
// Enter "admin" in the username input field
await page.fill('input[name="username"]', "admin");
@@ -18,8 +20,10 @@ test("admin login test", async ({ page }) => {
// Enter "gm" in the password input field
await page.fill('input[name="password"]', "gm");
+ page.screenshot({ path: "login_after_inputs.png" });
+
// Optionally, you can add an assertion to verify the login button is enabled
- const loginButton = page.locator('button[type="submit"]');
+ const loginButton = page.getByRole("button", { name: "Login" });
await expect(loginButton).toBeEnabled();
// Optionally, you can click the login button to submit the form
diff --git a/tests/proxy_admin_ui_tests/e2e_ui_tests/search_users.spec.ts b/tests/proxy_admin_ui_tests/e2e_ui_tests/search_users.spec.ts
index 7b9da6a27db..a384248a5f7 100644
--- a/tests/proxy_admin_ui_tests/e2e_ui_tests/search_users.spec.ts
+++ b/tests/proxy_admin_ui_tests/e2e_ui_tests/search_users.spec.ts
@@ -31,7 +31,7 @@ test("user search test", async ({ page }) => {
await page.fill('input[name="password"]', "gm");
console.log("Filled login credentials");
- const loginButton = page.locator('input[type="submit"]');
+ const loginButton = page.getByRole("button", { name: "Login" });
await expect(loginButton).toBeEnabled();
await loginButton.click();
console.log("Clicked login button");
@@ -138,7 +138,7 @@ test("user filter test", async ({ page }) => {
await page.fill('input[name="password"]', "gm");
console.log("Filled login credentials");
- const loginButton = page.locator('input[type="submit"]');
+ const loginButton = page.getByRole("button", { name: "Login" });
await expect(loginButton).toBeEnabled();
await loginButton.click();
console.log("Clicked login button");
diff --git a/tests/proxy_admin_ui_tests/e2e_ui_tests/view_internal_user.spec.ts b/tests/proxy_admin_ui_tests/e2e_ui_tests/view_internal_user.spec.ts
index e578ab57e3f..dd6f812df4a 100644
--- a/tests/proxy_admin_ui_tests/e2e_ui_tests/view_internal_user.spec.ts
+++ b/tests/proxy_admin_ui_tests/e2e_ui_tests/view_internal_user.spec.ts
@@ -15,7 +15,7 @@ test("view internal user page", async ({ page }) => {
await page.fill('input[name="password"]', "gm");
// Click the login button
- const loginButton = page.locator('input[type="submit"]');
+ const loginButton = page.getByRole("button", { name: "Login" });
await expect(loginButton).toBeEnabled();
await loginButton.click();
@@ -35,9 +35,9 @@ test("view internal user page", async ({ page }) => {
const rowCount = await page.locator("tbody tr").count();
expect(rowCount).toBeGreaterThan(0);
- // Verify table headers are present (including Virtual Keys column)
- const virtualKeysHeader = page.locator("th", { hasText: "Virtual Keys" });
- await expect(virtualKeysHeader).toBeVisible();
+ const userIdHeader = page.locator("th", { hasText: "User ID" });
+ page.screenshot({ path: "user_id_header.png" });
+ await expect(userIdHeader).toBeVisible();
// test pagination
// Wait for pagination controls to be visible
diff --git a/tests/proxy_admin_ui_tests/e2e_ui_tests/view_user_info.spec.ts b/tests/proxy_admin_ui_tests/e2e_ui_tests/view_user_info.spec.ts
index 01eadc9ad1a..742dbd14d44 100644
--- a/tests/proxy_admin_ui_tests/e2e_ui_tests/view_user_info.spec.ts
+++ b/tests/proxy_admin_ui_tests/e2e_ui_tests/view_user_info.spec.ts
@@ -14,6 +14,7 @@ test.describe("User Info View", () => {
// Wait for loading state to disappear
await page.waitForSelector('text="🚅 Loading users..."', {
state: "hidden",
+ timeout: 10000,
});
// Wait for users table to load
await page.waitForSelector("table");
diff --git a/ui/litellm-dashboard/src/app/page.tsx b/ui/litellm-dashboard/src/app/page.tsx
index 68060ae6968..20f5480c970 100644
--- a/ui/litellm-dashboard/src/app/page.tsx
+++ b/ui/litellm-dashboard/src/app/page.tsx
@@ -186,7 +186,7 @@ export default function CreateKeyPage() {
useEffect(() => {
if (redirectToLogin) {
// Replace instead of assigning to avoid back-button loops
- const dest = (proxyBaseUrl || "") + "/sso/key/generate";
+ const dest = (proxyBaseUrl || "") + "/ui/login";
window.location.replace(dest);
}
}, [redirectToLogin]);