test(e2e): cover Team-BYOK add-model flow as proxy admin#29068
Conversation
The team-only model + team assignment was an uncovered manual-QA path. This adds a premium-gated test that toggles Team-BYOK, picks the seeded E2E Team CRUD, submits, and verifies the model lands in All Models with the team alias attached.
Greptile SummaryAdds a Playwright e2e test covering the Team-BYOK add-model flow for proxy admins: toggles the premium-gated switch, assigns the model to the seeded E2E Team CRUD, and verifies the team alias appears in the All Models table. The test self-skips when
Confidence Score: 5/5Safe to merge — the change is a single additive e2e test with no modifications to production code or existing tests. The new test follows the established patterns in this file, correctly guards against the premium license gate, cleans up after itself, and uses the same search/results-count/row-filter assertions as the sibling tests. There are no modifications to existing test logic and no production code is touched. No files require special attention.
|
| Filename | Overview |
|---|---|
| ui/litellm-dashboard/e2e_tests/tests/modelsPage/addModel.spec.ts | New e2e test for Team-BYOK add-model flow; well-structured with proper cleanup, license guard, and assertions. Minor comment inaccuracy and team selection inconsistency noted. |
Reviews (2): Last reviewed commit: "test(e2e): harden Team-BYOK test against..." | Re-trigger Greptile
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
- Add the 2s networkidle settle that the sibling addModel tests use — networkidle fires before the All Models table finishes re-rendering, so the search input was racing with the render. - Assert on `models-results-count` before inspecting the table body so an empty search result fails with a clear "expected results count" message instead of timing out on a missing row. Addresses Greptile P2s on PR #29068.
- Add before/after cleanup that deletes any Cohere model already scoped to e2e-team-crud via /v2/model/info + /model/delete, so Playwright retries and local reruns don't accumulate rows. - Pick the team from the dropdown by role/option name instead of a global getByText match — avoids matching a previously-rendered tag elsewhere in the form. - Scope the "created successfully" assertion to .ant-notification so a stale toast from an earlier test in the same browser context can't vacuously satisfy it. - Tighten the All Models assertion: require a single row that contains BOTH the cohere model name AND the e2e-team-crud alias, so the team-less wildcard from the sibling "Add wildcard route" test can't satisfy the check.
|
@greptileai re review |
9cac047
into
litellm_internal_staging
* test(e2e): cover Team-BYOK add-model flow as proxy admin The team-only model + team assignment was an uncovered manual-QA path. This adds a premium-gated test that toggles Team-BYOK, picks the seeded E2E Team CRUD, submits, and verifies the model lands in All Models with the team alias attached. * test(e2e): apply greptile fixes to Team-BYOK test - Add the 2s networkidle settle that the sibling addModel tests use — networkidle fires before the All Models table finishes re-rendering, so the search input was racing with the render. - Assert on `models-results-count` before inspecting the table body so an empty search result fails with a clear "expected results count" message instead of timing out on a missing row. Addresses Greptile P2s on PR BerriAI#29068. * test(e2e): harden Team-BYOK test against flake and stale state - Add before/after cleanup that deletes any Cohere model already scoped to e2e-team-crud via /v2/model/info + /model/delete, so Playwright retries and local reruns don't accumulate rows. - Pick the team from the dropdown by role/option name instead of a global getByText match — avoids matching a previously-rendered tag elsewhere in the form. - Scope the "created successfully" assertion to .ant-notification so a stale toast from an earlier test in the same browser context can't vacuously satisfy it. - Tighten the All Models assertion: require a single row that contains BOTH the cohere model name AND the e2e-team-crud alias, so the team-less wildcard from the sibling "Add wildcard route" test can't satisfy the check.
Summary
Adds an e2e test for the previously-uncovered manual-QA item "Add team-only model → assign to team". The test toggles the Team-BYOK switch on the Add Model form, picks the seeded E2E Team CRUD, submits, then verifies the model appears in All Models with the team alias attached. Skips when
LITELLM_LICENSEis unset, since the toggle is premium-gated.Test plan
e2e_tests/tests/modelsPage/addModel.spec.ts::Add team-only model via Team-BYOK toggle and verify it appears with the teamlicense.spec.ts)Refs LIT-3093