Skip to content

[Infra] UI - E2E Tests: Key Delete, Regenerate, and Update TPM/RPM Limits#20803

Merged
yuneng-jiang merged 2 commits intomainfrom
litellm_ui_e2e_02
Feb 11, 2026
Merged

[Infra] UI - E2E Tests: Key Delete, Regenerate, and Update TPM/RPM Limits#20803
yuneng-jiang merged 2 commits intomainfrom
litellm_ui_e2e_02

Conversation

@yuneng-jiang
Copy link
Collaborator

Relevant issues

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have Added testing in the tests/litellm/ directory, Adding at least 1 test is a hard requirement - see details
  • My PR passes all unit tests on make test-unit
  • My PR's scope is as isolated as possible, it only solves 1 specific problem

CI (LiteLLM team)

CI status guideline:

  • 50-55 passing tests: main is stable with minor issues.
  • 45-49 passing tests: acceptable but needs attention
  • <= 40 passing tests: unstable; be careful with your merges and assess the risk.
  • Branch creation CI run
    Link:

  • CI run for the last commit
    Link:

  • Merge / cherry-pick CI run
    Links:

Type

✅ Test

Changes

Adds Playwright E2E tests for the LiteLLM dashboard API keys flow: delete key (with confirmation by key name), regenerate key, and update key TPM/RPM limits. Introduces shared constants for the key IDs and names used by these tests.

Screenshots

@vercel
Copy link

vercel bot commented Feb 10, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
litellm Ready Ready Preview, Comment Feb 11, 2026 0:32am

Request Review

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 10, 2026

Greptile Overview

Greptile Summary

This PR adds Playwright E2E coverage for the LiteLLM dashboard API keys flow: selecting a key from the API Keys page, deleting it with name confirmation, regenerating it, and updating TPM/RPM limits via the Settings tab. It also introduces shared constants for the specific test key identifiers used by these specs.

Main fix needed before merge: the delete-key test locates the confirmation input using getByRole('textbox', { name: E2E_DELETE_KEY_NAME }), which relies on the input’s accessible name. Unless the confirmation textbox is literally labeled "e2eDeleteKey", the locator won’t match and the test will fail deterministically; use the actual label text or a stable test id for that field instead.

Confidence Score: 4/5

  • Mostly safe to merge, but one new E2E test likely fails deterministically due to an incorrect locator.
  • Changes are limited to Playwright E2E tests and shared constants; the main functional risk is the delete-key spec using an accessible-name-based textbox locator that is unlikely to match the real confirmation input, breaking CI. Other tests appear straightforward and isolated.
  • ui/litellm-dashboard/e2e_tests/tests/keys/deleteKey.spec.ts

Important Files Changed

Filename Overview
ui/litellm-dashboard/e2e_tests/constants.ts Adds shared constants for E2E API key ID prefixes and key name used across new Playwright tests.
ui/litellm-dashboard/e2e_tests/tests/keys/deleteKey.spec.ts Adds Playwright E2E test for deleting an API key; uses a textbox locator by accessible name that likely won’t match the confirmation input, causing deterministic failures.
ui/litellm-dashboard/e2e_tests/tests/keys/regenerateKey.spec.ts Adds Playwright E2E test for regenerating an API key by selecting a key row/button via ID prefix and confirming regeneration.
ui/litellm-dashboard/e2e_tests/tests/keys/updateKeyLimits.spec.ts Adds Playwright E2E test for editing key TPM/RPM limits via Settings tab and verifying updated values render.

Sequence Diagram

sequenceDiagram
  autonumber
  actor T as Playwright Test
  participant P as Browser Page
  participant UI as LiteLLM Dashboard UI

  T->>P: navigateToPage(ApiKeys)
  P->>UI: Load API Keys page
  UI-->>P: Keys list rendered (pagination shows Next)

  T->>P: Click key row/button (hasText ID prefix)
  P->>UI: Open key details drawer/modal

  alt Delete key flow
    T->>P: Click "Delete Key"
    P->>UI: Open confirmation dialog
    T->>P: Fill confirmation textbox with key name
    T->>P: Click "Delete"
    P->>UI: Submit delete request
    UI-->>P: Toast "Key deleted successfully"
  else Regenerate key flow
    T->>P: Click "Regenerate Key"
    P->>UI: Open regenerate confirmation
    T->>P: Click "Regenerate"
    P->>UI: Submit regenerate request
    UI-->>P: Toast "Virtual Key regenerated"
  else Update limits flow
    T->>P: Click "Settings" tab
    P->>UI: Render settings
    T->>P: Click "Edit Settings"
    P->>UI: Enable inputs
    T->>P: Fill TPM/RPM spinbuttons
    T->>P: Click "Save Changes"
    P->>UI: Submit update request
    UI-->>P: Render updated TPM/RPM values
  end
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment on lines +18 to +20
await page.getByRole("textbox", { name: E2E_DELETE_KEY_NAME }).click();
await page.getByRole("textbox", { name: E2E_DELETE_KEY_NAME }).fill(E2E_DELETE_KEY_NAME);
const deleteButton = page.getByRole("button", { name: "Delete", exact: true });
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incorrect accessible name

The locator getByRole("textbox", { name: E2E_DELETE_KEY_NAME }) uses the accessible name of the input, not the placeholder/value. If the confirmation field is labeled something like "Type key name to confirm", this will never match and the test will fail. Prefer targeting the textbox by its real label (or by a stable data-testid) and then fill(E2E_DELETE_KEY_NAME).

This same issue appears twice here (click + fill) and will break the delete flow if the textbox isn’t literally named e2eDeleteKey.

@yuneng-jiang yuneng-jiang merged commit c683830 into main Feb 11, 2026
55 of 68 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant