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): repoint the e2e locators at the post-antd form controls (#37421)
yuneng-jiangf27d88bd138c
diff --git a/tests/e2e/ui/tests/mcp/mcpTools.spec.ts b/tests/e2e/ui/tests/mcp/mcpTools.spec.tsindex edaeab196aa..225ca8b9449 100644--- a/tests/e2e/ui/tests/mcp/mcpTools.spec.ts+++ b/tests/e2e/ui/tests/mcp/mcpTools.spec.ts@@ -63,7 +63,7 @@ test.describe("MCP Tools", () => {// The form is generated from the tool's inputSchema, so `repoName` proves the schema// round-tripped through the proxy instead of the panel falling back to a generic field.- const repoInput = page.locator('input[id="repoName"]');+ const repoInput = page.getByLabel(/repoName/);await expect(repoInput).toBeVisible();await repoInput.fill(TOOL_ARG_REPO);diff --git a/tests/e2e/ui/tests/modelsPage/addModel.spec.ts b/tests/e2e/ui/tests/modelsPage/addModel.spec.tsindex 1b11ea69f97..bd5373e1569 100644--- a/tests/e2e/ui/tests/modelsPage/addModel.spec.ts+++ b/tests/e2e/ui/tests/modelsPage/addModel.spec.ts@@ -338,8 +338,8 @@ test.describe("Add Model", () => {await page.getByRole("button", { name: "Add Model" }).last().click();- // Scope to antd's notification container so a stale toast can't satisfy this.- await expect(page.locator(".ant-notification").getByText("created successfully").last()).toBeVisible({+ // Scope to the toast container so a stale toast can't satisfy this.+ await expect(page.locator("[data-sonner-toast]").getByText("created successfully").last()).toBeVisible({timeout: 15_000,});diff --git a/tests/e2e/ui/tests/modelsPage/clearCustomPricing.spec.ts b/tests/e2e/ui/tests/modelsPage/clearCustomPricing.spec.tsindex e67dcb96f36..c532641b238 100644--- a/tests/e2e/ui/tests/modelsPage/clearCustomPricing.spec.ts+++ b/tests/e2e/ui/tests/modelsPage/clearCustomPricing.spec.ts@@ -85,9 +85,9 @@ test.describe("Clear custom pricing on a deployment", () => {const inputCost = page.getByPlaceholder("Enter input cost");const outputCost = page.getByPlaceholder("Enter output cost");// Both cache fields share the same placeholder ("Defaults to Input Cost if blank"),- // so disambiguate via the Form.Item id (AntD assigns the `name` prop as input id).- const cacheReadCost = page.locator("#cache_read_cost");- const cacheWriteCost = page.locator("#cache_write_cost");+ // so disambiguate via their labels.+ const cacheReadCost = page.getByLabel(/Cache Read Cost/);+ const cacheWriteCost = page.getByLabel(/Cache Write Cost/);await inputCost.waitFor({ timeout: 15_000 });for (const field of [inputCost, outputCost, cacheReadCost, cacheWriteCost]) {await field.click({ clickCount: 3 });diff --git a/tests/e2e/ui/tests/proxy-admin/keys.spec.ts b/tests/e2e/ui/tests/proxy-admin/keys.spec.tsindex d9b0f959c9f..004fedb3263 100644--- a/tests/e2e/ui/tests/proxy-admin/keys.spec.ts+++ b/tests/e2e/ui/tests/proxy-admin/keys.spec.ts@@ -36,9 +36,8 @@ test.describe("Proxy Admin - Keys", () => {// Wait for the key creation modalawait expect(page.getByText("Key Ownership")).toBeVisible({ timeout: 10_000 });- // Fill key name (has data-testid="base-input" in the built UI)const keyName = `e2e-admin-key-${Date.now()}`;- await page.getByTestId("base-input").fill(keyName);+ await page.getByLabel(/Key Name/).fill(keyName);// Select teamconst teamSelect = page.getByTestId("team-dropdown").getByRole("combobox");@@ -192,7 +191,7 @@ test.describe("Proxy Admin - Keys", () => {await expect(page.getByText("Key Ownership")).toBeVisible({ timeout: 10_000 });const keyName = `e2e-admin-allproxy-${Date.now()}`;- await page.getByTestId("base-input").fill(keyName);+ await page.getByLabel(/Key Name/).fill(keyName);// No team selection — leave team dropdown empty so the key is owned by the admin user@@ -220,7 +219,7 @@ test.describe("Proxy Admin - Keys", () => {await expect(page.getByText("Key Ownership")).toBeVisible({ timeout: 10_000 });const keyName = `e2e-admin-specific-${Date.now()}`;- await page.getByTestId("base-input").fill(keyName);+ await page.getByLabel(/Key Name/).fill(keyName);// Open the model multi-select and pick a single specific model. Use// getByRole("option", ...) to avoid the strict-mode collision betweendiff --git a/tests/e2e/ui/tests/proxy-admin/teams.spec.ts b/tests/e2e/ui/tests/proxy-admin/teams.spec.tsindex d7c8eb6237e..172fde173df 100644--- a/tests/e2e/ui/tests/proxy-admin/teams.spec.ts+++ b/tests/e2e/ui/tests/proxy-admin/teams.spec.ts@@ -79,7 +79,7 @@ test.describe("Proxy Admin - Teams", () => {await expect(modal).toBeVisible({ timeout: 5_000 });// The email field is a Select — type to search, then select from dropdown- await modal.locator(".ant-select").first().click();+ await modal.getByRole("combobox").first().click();await page.keyboard.type("[email protected]");// Wait for the option to appear, then select via keyboard (avoids viewport issues)diff --git a/tests/e2e/ui/tests/team-admin/teamAdmin.spec.ts b/tests/e2e/ui/tests/team-admin/teamAdmin.spec.tsindex d71d5e6c0fe..0ef74e71529 100644--- a/tests/e2e/ui/tests/team-admin/teamAdmin.spec.ts+++ b/tests/e2e/ui/tests/team-admin/teamAdmin.spec.ts@@ -66,7 +66,7 @@ test.describe("Team Admin", () => {// Use a dedicated invitee user so this doesn't race with the proxy-admin// "Invite a user" test that adds [email protected] to the same team.- await modal.locator(".ant-select").first().click();+ await modal.getByRole("combobox").first().click();await page.keyboard.type("[email protected]");const emailOption = page.getByRole("option", { name: "[email protected]" }).first();@@ -136,7 +136,7 @@ test.describe("Team Admin", () => {await expect(page.getByText("Key Ownership")).toBeVisible({ timeout: 10_000 });const keyName = `e2e-team-admin-key-${Date.now()}`;- await page.getByTestId("base-input").fill(keyName);+ await page.getByLabel(/Key Name/).fill(keyName);// Team selector — same locator pattern as the proxy-admin keys test.const teamSelect = page.getByTestId("team-dropdown").getByRole("combobox");diff --git a/ui/litellm-dashboard/src/components/ModelInfoEditForm.tsx b/ui/litellm-dashboard/src/components/ModelInfoEditForm.tsxindex e58139c80a0..fff732fe270 100644--- a/ui/litellm-dashboard/src/components/ModelInfoEditForm.tsx+++ b/ui/litellm-dashboard/src/components/ModelInfoEditForm.tsx@@ -403,28 +403,27 @@ const ModelInfoEditForm: React.FC<ModelInfoEditFormProps> = ({</div>);- const pricingField = (name: TouchedPricingField, label: string, placeholder: string, description?: string) => (- <div>- <FieldLabel>{label}</FieldLabel>- {isEditing ? (- <FormField control={form.control} name={name} description={description}>- {({ value, onChange, ...control }) => (- <NumericalInput- {...control}- value={value ?? ""}- placeholder={placeholder}- onChange={(event: React.ChangeEvent<HTMLInputElement>) => {- markTouched(name);- onChange(event);- }}- />- )}- </FormField>- ) : (+ const pricingField = (name: TouchedPricingField, label: string, placeholder: string, description?: string) =>+ isEditing ? (+ <FormField control={form.control} name={name} label={label} description={description}>+ {({ value, onChange, ...control }) => (+ <NumericalInput+ {...control}+ value={value ?? ""}+ placeholder={placeholder}+ onChange={(event: React.ChangeEvent<HTMLInputElement>) => {+ markTouched(name);+ onChange(event);+ }}+ />+ )}+ </FormField>+ ) : (+ <div>+ <FieldLabel>{label}</FieldLabel><Display>{displayCost(localModelData, name)}</Display>- )}- </div>- );+ </div>+ );const tagsField = (name: "model_access_group" | "guardrails" | "tags",