mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-07 08:26:10 +00:00
E2E test see models for specific provider
This commit is contained in:
parent
969790c463
commit
a6c3fb1fb5
3 changed files with 26 additions and 1 deletions
1
ui/litellm-dashboard/e2e_tests/constants.ts
Normal file
1
ui/litellm-dashboard/e2e_tests/constants.ts
Normal file
|
|
@ -0,0 +1 @@
|
|||
export const ADMIN_STORAGE_PATH = "admin.storageState.json";
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
import { test, expect } from "@playwright/test";
|
||||
import { ADMIN_STORAGE_PATH } from "../../constants";
|
||||
|
||||
test.describe("Add Model", () => {
|
||||
test.use({ storageState: ADMIN_STORAGE_PATH });
|
||||
|
||||
test("Able to see all models for a specific provider in the model dropdown", async ({ page }) => {
|
||||
await page.goto("http://localhost:4000/ui");
|
||||
|
||||
await page.getByText("Models + Endpoints").click();
|
||||
await page.getByRole("tab", { name: "Add Model" }).click();
|
||||
|
||||
const providerInputDropdown = page.getByRole("combobox", { name: /Provider/i });
|
||||
await providerInputDropdown.fill("Anthropic");
|
||||
await page.waitForTimeout(1000);
|
||||
await providerInputDropdown.press("Enter");
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
const providerModelsDropdown = page.locator(".ant-select-selection-overflow").first();
|
||||
await providerModelsDropdown.click();
|
||||
await expect(page.getByTitle("claude-haiku-4-5", { exact: true })).toBeVisible();
|
||||
});
|
||||
});
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
import test, { expect } from "@playwright/test";
|
||||
import { Role } from "../../fixtures/roles";
|
||||
import { ADMIN_STORAGE_PATH } from "../../constants";
|
||||
|
||||
const sidebarButtons = {
|
||||
[Role.ProxyAdmin]: [
|
||||
|
|
@ -16,7 +17,7 @@ const sidebarButtons = {
|
|||
],
|
||||
};
|
||||
|
||||
const roles = [{ role: Role.ProxyAdmin, storage: "admin.storageState.json" }];
|
||||
const roles = [{ role: Role.ProxyAdmin, storage: ADMIN_STORAGE_PATH }];
|
||||
|
||||
for (const { role, storage } of roles) {
|
||||
test.describe(`${role} sidebar`, () => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue