Skip to content

test(ui): e2e cover team model edit + admin identity in navbar#28652

Merged
ryan-crabbe-berri merged 5 commits into
litellm_internal_stagingfrom
litellm_e2e_team_models_and_admin_user_info
May 27, 2026
Merged

test(ui): e2e cover team model edit + admin identity in navbar#28652
ryan-crabbe-berri merged 5 commits into
litellm_internal_stagingfrom
litellm_e2e_team_models_and_admin_user_info

Conversation

@ryan-crabbe-berri

@ryan-crabbe-berri ryan-crabbe-berri commented May 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds two Playwright tests as part of the manual-QA → e2e migration. "Edit team model selection" opens the seeded E2E Team CRUD, switches to the Settings tab, removes the fake-anthropic-claude model from the multi-select, and verifies the success notification. The existing login test now opens the navbar User dropdown after login and asserts the role and User ID render — catching the class of bug where login succeeds but the auth context is empty (the bare "Virtual Keys" check would not).

Test plan

  • e2e_tests/tests/proxy-admin/teams.spec.ts::Edit team model selection — Settings tab → remove a model tag → Save → verify success toast
  • e2e_tests/tests/login/login.spec.ts::user can log in — login, hover navbar User button, assert role "Admin" and user id "default_user_id" render in the popup
  • Both pass locally with slowmo enabled (SLOWMO=500 ./e2e_tests/run_e2e.sh --headed -g "Edit team model selection|user can log in")

Refs LIT-3093

Adds two Playwright tests as part of the manual-QA → e2e migration:
"Edit team model selection" exercises the Settings tab Models multi-select
+ Save Changes flow on a seeded team, and the existing login test now
opens the User dropdown and asserts the role and User ID render — guarding
against regressions where login succeeds but the auth context is empty.

Resolves LIT-3093
@greptile-apps

greptile-apps Bot commented May 22, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR migrates two manual-QA checks into Playwright e2e tests: the login test now verifies the navbar account popup renders the correct role and user ID after login, and a new "Edit team model selection" test exercises the Settings tab on an existing team.

  • login.spec.ts: replaces the old synthetic-event approach with a stable aria-label-based button click (button[aria-label^=\"Account menu\"]) and filters the popup by its popupRender wrapper class, then asserts \"Admin\" role and \"default_user_id\" render correctly.
  • teams.spec.ts: adds an idempotent model-edit test that calls /team/update via the Playwright request fixture to restore seeded models both before the test and in a finally block, addressing the prior-thread idempotency concern.

Confidence Score: 5/5

Test-only change with no production code affected; both tests are safe to merge.

Both changes are confined to e2e test files. The login test uses proper Playwright interactions with a stable aria-label selector, and the teams test correctly restores fixture state via a pre/finally API call. The only non-blocking concern is that a finally-block throw can obscure the original failure in CI, but this does not affect production correctness or test reliability under normal conditions.

No files require special attention beyond the minor finally error-masking note in teams.spec.ts.

Important Files Changed

Filename Overview
ui/litellm-dashboard/e2e_tests/tests/login/login.spec.ts Extends the login test to click the account button and verify role/userId in the popup, using a stable aria-label selector and proper Playwright click instead of synthetic events.
ui/litellm-dashboard/e2e_tests/tests/proxy-admin/teams.spec.ts Adds "Edit team model selection" test with API-based fixture restore in a try/finally; idempotency concern from prior thread is addressed, but a finally-block throw can mask the original test failure.

Reviews (4): Last reviewed commit: "fix(e2e): match navbar account button by..." | Re-trigger Greptile

Comment thread ui/litellm-dashboard/e2e_tests/tests/proxy-admin/teams.spec.ts Outdated
Comment thread ui/litellm-dashboard/e2e_tests/tests/login/login.spec.ts Outdated
@codecov

codecov Bot commented May 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

The 'Edit team model selection' test removed fake-anthropic-claude from
E2E_TEAM_CRUD_ID without restoring it. CI runs with retries: 2 and the seed
script runs once before the suite, so a flake on this test would fail the
retry at the "tag is visible" assertion. Wrap the test in try/finally and
restore the seeded models via /team/update before and after.
@ryan-crabbe-berri

Copy link
Copy Markdown
Collaborator Author

@greptileai re review

Surfaces the real cause when the master key is wrong or the proxy is
unreachable, instead of silently leaving the team in a stale state and
failing later on the visibility assertion.
@ryan-crabbe-berri

Copy link
Copy Markdown
Collaborator Author

@greptileai re review

… "User" text

The previous trigger filter (hasText: /^User$/) didn't match the rendered
UserDropdown button — its text is the displayName ("Account" for the
master-key admin, an email for SSO users), never "User". The evaluate
call then timed out after 15s in CI. Use the stable aria-label prefix
the component always emits, and click directly since the dropdown is
configured trigger=["click"] (the synthetic hover was unnecessary).
@ryan-crabbe-berri

Copy link
Copy Markdown
Collaborator Author

@greptileai re review

@ryan-crabbe-berri ryan-crabbe-berri merged commit 7cae5dc into litellm_internal_staging May 27, 2026
115 of 118 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.

2 participants