mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-20 00:11:50 +00:00
Merge pull request #41756 from BerriAI/litellm_/regression-analysis-deep-dive-dd13e8
test(e2e/ui): wait for the filtered budget list before clicking a row action
This commit is contained in:
commit
ea95631181
1 changed files with 12 additions and 0 deletions
|
|
@ -4,6 +4,8 @@ import { Page } from "../../fixtures/pages";
|
|||
import { navigateToPage, dismissFeedbackPopup } from "../../helpers/navigation";
|
||||
import { masterKey } from "../../helpers/traffic";
|
||||
|
||||
const BUDGET_LIST_PATH = "/management/v1/budgets";
|
||||
|
||||
interface StoredBudget {
|
||||
budget_id: string;
|
||||
max_budget: number | null;
|
||||
|
|
@ -30,7 +32,17 @@ async function createBudgetViaApi(page: PlaywrightPage, budget: Partial<StoredBu
|
|||
}
|
||||
|
||||
async function searchForBudget(page: PlaywrightPage, budgetId: string): Promise<void> {
|
||||
const searched = page.waitForResponse((response) => {
|
||||
const url = new URL(response.url());
|
||||
return (
|
||||
response.request().method() === "GET" &&
|
||||
url.pathname === BUDGET_LIST_PATH &&
|
||||
url.searchParams.get("q") === budgetId
|
||||
);
|
||||
});
|
||||
await page.getByPlaceholder("Search by budget ID").fill(budgetId);
|
||||
const response = await searched;
|
||||
expect(response.ok(), `GET ${BUDGET_LIST_PATH}?q=${budgetId} (${response.status()})`).toBe(true);
|
||||
}
|
||||
|
||||
test.describe("Budgets", () => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue