Skip to content

test(ui): fix key and credential e2e specs after the overflow menu migrations - #34206

Merged
yuneng-berri merged 2 commits into
litellm_internal_stagingfrom
litellm_/e2e-test-regressions-69be3e
Jul 22, 2026
Merged

test(ui): fix key and credential e2e specs after the overflow menu migrations#34206
yuneng-berri merged 2 commits into
litellm_internal_stagingfrom
litellm_/e2e-test-regressions-69be3e

Conversation

@yuneng-berri

@yuneng-berri yuneng-berri commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Relevant issues

Linear ticket

Pre-Submission checklist

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

  • I have added meaningful tests
  • My PR passes all CI/CD checks (e.g., lint, format, unit tests)
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • I have received a Greptile Confidence Score of at least 4/5 before requesting a maintainer review (Greptile reviews automatically once the PR is opened; only comment @greptileai to re-request a review after pushing changes)

Delays in PR merge?

If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).

Screenshots / Proof of Fix

Both specs run against a live proxy (freshly built UI, real Postgres, seeded DB) at 105586d, via the suite's own runner:

CI=true DATABASE_URL="postgresql://<user>:<pass>@127.0.0.1:55432/litellm_e2e" \
  ./e2e_tests/run_e2e.sh --reporter=list \
  e2e_tests/tests/modelsPage/credentials.spec.ts e2e_tests/tests/proxy-admin/keys.spec.ts
✓  1 credentials.spec.ts:34:7 › Edit LLM credential › changing only the api base does not overwrite the stored api key with its masked value (1.3s)
✓  2 keys.spec.ts:16:7 › Proxy Admin - Keys › Create a key in a team (1.8s)
✘  3 keys.spec.ts:52:7 › Proxy Admin - Keys › Regenerate key (15.9s)
✓  6 keys.spec.ts:75:7 › Proxy Admin - Keys › Update key TPM and RPM limits (1.2s)
✓  7 keys.spec.ts:96:7 › Proxy Admin - Keys › Delete key (1.4s)
✓  8 keys.spec.ts:120:7 › Proxy Admin - Keys › See internal user keys in team (812ms)
✓  9 keys.spec.ts:127:7 › Proxy Admin - Keys › Create a key with All Proxy Models (no team) (2.2s)
✓ 10 keys.spec.ts:155:7 › Proxy Admin - Keys › Create a key with a specific proxy model (no team) (1.5s)

The two specs this PR touches both pass. "Regenerate key" fails only because that run had no LITELLM_LICENSE, so the proxy was not premium and regenerateDisabled={!premiumUser} kept the button disabled ("element is not enabled"). Unrelated to this PR, and re-running that one spec with a license confirms it:

✓  1 keys.spec.ts:52:7 › Proxy Admin - Keys › Regenerate key (2.0s)
   1 passed (4.6s)

Unit side, the new guard is mutation-checked rather than just green. With stripMaskedSecrets dropped from the update path in CredentialsPanel:

× CredentialsPanel > drops the masked api key from the update payload while keeping the edited api base
  → expected { api_key: 'sk-1****2345', …(1) } to deeply equal { Object (api_base) }

and with it restored, all 10 tests in the file pass

Type

✅ Test

Changes

Two dashboard Playwright specs went red after recent UI work, and both were stale selectors rather than broken product behavior

proxy-admin/keys.spec.ts "Delete key" clicked a top-level Delete Key button on the key info page. #34116 moved Reset Spend and Delete Key into an overflow dropdown next to Regenerate Key, so Delete Key is now a menu item behind the More key actions trigger. The spec now opens that menu first. Everything downstream is unchanged: the confirm modal still requires typing the key alias and still reports "Key deleted successfully"

modelsPage/credentials.spec.ts clicked the first button in the credential's row to open the edit modal. The credentials table has since moved onto the shared DataTable, where the row's only button is the actions trigger and Edit is a menu item inside it, so the click opened a dropdown and the spec timed out waiting for the modal. It now goes through the actions menu

The behavior that second spec guards, the edit form never sending the backend's masked api key back on save, is still correct in the code; stripMaskedSecrets survived the table migration and is still applied in CredentialsPanel. That guard had no unit coverage though, so while the e2e was red nothing at all was pinning it. This PR adds a CredentialsPanel test that drives an edit submit carrying a masked api_key plus an edited api_base and asserts the outgoing credential_values contains only the api base. Removing the stripMaskedSecrets call makes that test fail, so it is a real guard and not coverage padding

Final Attestation

  • The tests check the right things, including the edge cases, and regressions in the respective real-world customer use-cases are not possible after this PR

…grations

Delete Key moved into the key info page's overflow dropdown (#34116) and the
credentials table's row actions moved into a shared DataTable overflow menu, so
both specs were clicking a button that no longer exists. Point them at the menu
items instead.

Add a CredentialsPanel unit test asserting the update payload drops the masked
api key and keeps the edited api base, so that guard is not held up solely by an
e2e a table migration can silently disarm.
@greptile-apps

greptile-apps Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR updates dashboard tests after key and credential actions moved into overflow menus. The main changes are:

  • Opens the credential row menu before selecting Edit
  • Opens the key actions menu before selecting Delete Key
  • Verifies masked API keys are removed from credential update payloads

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.
  • The updated selectors match the current menu controls.
  • The new test exercises the production credential update path and checks the outgoing payload.

Important Files Changed

Filename Overview
ui/litellm-dashboard/e2e_tests/tests/modelsPage/credentials.spec.ts Updates the edit flow to use the credential-specific actions trigger and Edit menu item.
ui/litellm-dashboard/e2e_tests/tests/proxy-admin/keys.spec.ts Updates key deletion to select Delete Key from the accessible overflow menu.
ui/litellm-dashboard/src/components/model_add/CredentialsPanel.test.tsx Adds a focused test that excludes a masked API key while retaining an edited API base in the update payload.

Reviews (1): Last reviewed commit: "Merge remote-tracking branch 'origin/lit..." | Re-trigger Greptile

@yuneng-berri
yuneng-berri merged commit 5b676b9 into litellm_internal_staging Jul 22, 2026
126 checks passed
@yuneng-berri
yuneng-berri deleted the litellm_/e2e-test-regressions-69be3e branch July 22, 2026 01:14
@codspeed-hq

codspeed-hq Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 31 untouched benchmarks


Comparing litellm_/e2e-test-regressions-69be3e (24cfae7) with litellm_internal_staging (2b2ae4c)1

Open in CodSpeed

Footnotes

  1. No successful run was found on litellm_internal_staging (e967bc8) during the generation of this report, so 2b2ae4c was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants