litellm/tests/e2e/ui/constants.ts
ryan-crabbe-berri 871629e8f3 test(e2e): run the UI Playwright suite against the shared e2e gateway
The suite now targets LITELLM_PROXY_URL (default http://localhost:4000),
the same live gateway the python e2e suites use, instead of provisioning
its own postgres, mock LLM server and SQL-seeded proxy. globalSetup seeds
every e2e-* user, team, org, key and model deployment through the
management API with the master key, so any gateway with a master key and
store_model_in_db works; seed.sql and the mock LLM server are gone. The
two deployments (e2e-ui-openai, e2e-ui-anthropic) route to real providers
per the harness's no-mocks rule, and the key creation spec now asserts a
real completion instead of the mock's canned body.

Seeding is idempotent against a persistent gateway: teardown deletes
per-entity (batch deletes are all-or-nothing and one missing id used to
strand every other row), the modelHub spec resets the public model groups
list it fills, and the MCP spec purges its dead-URL servers whose failing
health checks kept networkidle navigation from settling on reruns. Both
Playwright configs pin workers: 1 since several specs mutate global
gateway state; the suite documents that it needs the gateway to itself
while it runs.

Two specs are also caught up with UI refactors that had moved their
buttons into dropdown menus (key deletion under "More key actions",
credential editing under the row's actions menu).

run_e2e.sh keeps a provisioning mode for CI and machines with no gateway,
and skips provisioning entirely when LITELLM_PROXY_URL is set. The
CircleCI jobs drop their seed and mock-server steps; the mock server's
removal also lets tests/e2e/ui leave the basedpyright exclude list.
2026-07-21 18:17:01 -07:00

34 lines
1.7 KiB
TypeScript

export const PROXY_BASE_URL = (process.env.LITELLM_PROXY_URL ?? "http://localhost:4000").replace(/\/+$/, "");
export const E2E_UI_OPENAI_MODEL = "e2e-ui-openai";
export const E2E_UI_ANTHROPIC_MODEL = "e2e-ui-anthropic";
// Storage state paths for each role
export const ADMIN_STORAGE_PATH = "admin.storageState.json";
export const ADMIN_VIEWER_STORAGE_PATH = "adminViewer.storageState.json";
export const INTERNAL_USER_STORAGE_PATH = "internalUser.storageState.json";
export const INTERNAL_VIEWER_STORAGE_PATH = "internalViewer.storageState.json";
export const TEAM_ADMIN_STORAGE_PATH = "teamAdmin.storageState.json";
// Seeded user identities (match fixtures/apiSeed.ts)
export const E2E_PROXY_ADMIN_USER_ID = "e2e-proxy-admin";
export const E2E_PROXY_ADMIN_EMAIL = "admin@test.local";
export const E2E_INTERNAL_USER_ID = "e2e-internal-user";
export const E2E_INTERNAL_USER_EMAIL = "internal@test.local";
// Key aliases for seeded test keys (match fixtures/apiSeed.ts)
export const E2E_UPDATE_LIMITS_KEY_ALIAS = "e2eUpdateLimitsKey";
export const E2E_DELETE_KEY_ALIAS = "e2eDeleteKey";
export const E2E_REGENERATE_KEY_ALIAS = "e2eRegenerateKey";
export const E2E_INTERNAL_USER_KEY_ALIAS = "e2eInternalUserKey";
export const E2E_VIEWER_KEY_ALIAS = "e2eViewerKey";
// Team identifiers (match fixtures/apiSeed.ts)
export const E2E_TEAM_CRUD_ID = "e2e-team-crud";
export const E2E_TEAM_CRUD_ALIAS = "E2E Team CRUD";
export const E2E_TEAM_DELETE_ID = "e2e-team-delete";
export const E2E_TEAM_DELETE_ALIAS = "E2E Team Delete";
export const E2E_TEAM_ORG_ID = "e2e-team-org";
export const E2E_TEAM_ORG_ALIAS = "E2E Team In Org";
export const E2E_TEAM_NO_ADMIN_ID = "e2e-team-no-admin";
export const E2E_TEAM_NO_ADMIN_ALIAS = "E2E Team No Admin";