fix: e2e ui tests for providers management#4517
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughSummary by CodeRabbit
Walkthrough
ChangesProvider E2E Test Updates
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
This stack of pull requests is managed by Graphite. Learn more about stacking. |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tests/e2e/features/providers/pages/providers.page.ts (1)
666-672: ⚡ Quick winReturn and await the exact budget row created by
addBudgetLine.On Line 667, this helper only clicks. Downstream callers then default to index
0, which can target the wrong row when budgets already exist and make tests state-dependent. Prefer capturing the pre-click row count, waiting for that new input, and returning it.♻️ Proposed update
- async addBudgetLine(): Promise<void> { - await this.page.getByTestId('provider-governance-budgets-add-btn').click() - } + async addBudgetLine(): Promise<Locator> { + const nextIndex = await this.page.getByTestId(/provider-governance-budgets-amount-/).count() + await this.page.getByTestId('provider-governance-budgets-add-btn').click() + const input = this.getBudgetAmountInput(nextIndex) + await expect(input).toBeVisible({ timeout: 5000 }) + return input + }- await providersPage.addBudgetLine(); - const budgetInput = providersPage.getBudgetAmountInput(); + const budgetInput = await providersPage.addBudgetLine();🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/e2e/features/providers/pages/providers.page.ts` around lines 666 - 672, The addBudgetLine() method only clicks the button but does not return the newly created budget row, forcing downstream callers to default to index 0 which targets the wrong row when budgets already exist. Modify the addBudgetLine() method to first capture the current number of budget rows by counting existing elements matching the test ID pattern used in getBudgetAmountInput(), then click the add button, wait for the new budget input at the next index to be visible using waitFor(), and finally return the Locator for that newly created input. This ensures callers always reference the correct budget row that was just added.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@tests/e2e/features/providers/pages/providers.page.ts`:
- Around line 666-672: The addBudgetLine() method only clicks the button but
does not return the newly created budget row, forcing downstream callers to
default to index 0 which targets the wrong row when budgets already exist.
Modify the addBudgetLine() method to first capture the current number of budget
rows by counting existing elements matching the test ID pattern used in
getBudgetAmountInput(), then click the add button, wait for the new budget input
at the next index to be visible using waitFor(), and finally return the Locator
for that newly created input. This ensures callers always reference the correct
budget row that was just added.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 4a82ecbd-1834-49c2-b60a-abb90d94593a
📒 Files selected for processing (2)
tests/e2e/features/providers/pages/providers.page.tstests/e2e/features/providers/providers.spec.ts
90c96b7 to
64ffcd7
Compare
64ffcd7 to
79c6471
Compare
1c050bf to
ded002a
Compare
Merge activity
|
The base branch was changed.

Summary
Updates e2e tests for provider governance budgets and custom provider validation to align with recent UI changes, and fixes base URLs used in test fixtures to use real provider endpoints.
Changes
addBudgetLine()andgetBudgetAmountInput()helper methods toProvidersPageto interact with the new budget line UI, replacing the old static#providerBudgetMaxLimitlocatoraddBudgetLine()before interacting with the budget amount input, reflecting the new add-then-fill flowhttps://api.openai.com/v1,https://api.anthropic.com) to avoid false failures from URL validationType of change
Affected areas
How to test
Expected outcomes:
https://api.nonexistent-provider.invalid/v1) surfaces an "Invalid base URL" error toast and keeps the sheet openScreenshots/Recordings
N/A
Breaking changes
Related issues
N/A
Security considerations
No security implications. Test fixtures now use real provider hostnames, but no real credentials are used.
Checklist
docs/contributing/README.mdand followed the guidelines