E2E test see models for specific provider

This commit is contained in:
yuneng-jiang 2026-01-03 15:10:52 -08:00
parent 969790c463
commit a6c3fb1fb5
3 changed files with 26 additions and 1 deletions

View file

@ -0,0 +1 @@
export const ADMIN_STORAGE_PATH = "admin.storageState.json";

View file

@ -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();
});
});

View file

@ -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`, () => {