mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-14 23:21:35 +00:00
Adds a standalone Playwright (TypeScript) suite under tests/e2e/ui that drives the Admin UI in a real browser. The single spec logs in as the proxy admin, creates a virtual key scoped to one model through the create-key modal, then asserts both halves of the contract: /key/info reflects the alias and model the form set, and the generated key serves /chat/completions on its scoped model while being denied key_model_access_denied on a model outside that scope. The suite is decoupled from the Python harness in the sibling folders; it carries its own package.json and playwright.config.ts and runs with npm test.
29 lines
656 B
TypeScript
29 lines
656 B
TypeScript
import { defineConfig, devices } from "@playwright/test";
|
|
|
|
const baseURL = process.env.LITELLM_PROXY_URL ?? "http://localhost:4000";
|
|
|
|
export default defineConfig({
|
|
testDir: ".",
|
|
testMatch: ["**/*.spec.ts"],
|
|
fullyParallel: true,
|
|
forbidOnly: !!process.env.CI,
|
|
retries: process.env.CI ? 2 : 0,
|
|
workers: process.env.CI ? 1 : undefined,
|
|
reporter: "html",
|
|
timeout: 3 * 60 * 1000,
|
|
expect: {
|
|
timeout: 10 * 1000,
|
|
},
|
|
use: {
|
|
baseURL,
|
|
trace: "on-first-retry",
|
|
actionTimeout: 15 * 1000,
|
|
navigationTimeout: 30 * 1000,
|
|
},
|
|
projects: [
|
|
{
|
|
name: "chromium",
|
|
use: { ...devices["Desktop Chrome"] },
|
|
},
|
|
],
|
|
});
|