Skip to content

Commit

Permalink
refactor: improve waiting logic in Basic Prompting test (#4770)
Browse files Browse the repository at this point in the history
  • Loading branch information
anovazzi1 authored Nov 24, 2024
1 parent eb960cf commit 647ceea
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/frontend/tests/core/integrations/Basic Prompting.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ test("Basic Prompting (Hello, World)", async ({ page }) => {

while (modalCount === 0) {
await page.getByText("New Flow", { exact: true }).click();
await page.waitForTimeout(3000);
await page.waitForSelector('[data-testid="modal-title"]', {
timeout: 3000,
});
modalCount = await page.getByTestId("modal-title")?.count();
}

Expand All @@ -53,14 +55,12 @@ test("Basic Prompting (Hello, World)", async ({ page }) => {

while (outdatedComponents > 0) {
await page.getByTestId("icon-AlertTriangle").first().click();
await page.waitForTimeout(1000);
outdatedComponents = await page.getByTestId("icon-AlertTriangle").count();
}

let filledApiKey = await page.getByTestId("remove-icon-badge").count();
while (filledApiKey > 0) {
await page.getByTestId("remove-icon-badge").first().click();
await page.waitForTimeout(1000);
filledApiKey = await page.getByTestId("remove-icon-badge").count();
}

Expand All @@ -74,8 +74,6 @@ test("Basic Prompting (Hello, World)", async ({ page }) => {
await page.getByTestId("dropdown_str_model_name").click();
await page.getByTestId("gpt-4o-1-option").click();

await page.waitForTimeout(1000);

await page.getByTestId("button_run_chat output").click();
await page.waitForSelector("text=built successfully", { timeout: 30000 });

Expand Down

0 comments on commit 647ceea

Please sign in to comment.