test: add timeout on freeze test to prevent errors on ci (#7227)

This commit is contained in:
Cristhian Zanforlin Lousa 2025-03-22 08:10:23 -03:00 • committed by GitHub
commit 603efe7911
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 20 additions and 70 deletions

View file

@ -219,6 +219,8 @@ test(
await page.getByTestId("icon-FreezeAll").last().click();
await page.waitForTimeout(3000);
await page.keyboard.press("Escape");
await page.locator('//*[@id="react-flow-id"]').click();
@ -232,6 +234,8 @@ test(
timeout: 1000,
});
await page.waitForTimeout(2000);
await page.getByTestId("button_run_chat output").click();
await page.waitForSelector("text=built successfully", { timeout: 30000 });
@ -270,12 +274,10 @@ test(
await page.getByText("Freeze", { exact: true }).click();
await page.waitForTimeout(3000);
await page.keyboard.press("Escape");
await page.locator('//*[@id="react-flow-id"]').click();
await page.waitForTimeout(1000);
await page.getByTestId("button_run_chat output").click();
await page.waitForTimeout(1000);
@ -304,15 +306,11 @@ test(
.getByPlaceholder("Empty")
.textContent();
expect(firstTextFreezed).toContain("Lorem Ipsum");
expect(secondRunWithoutFreezing).not.toBe(firstTextFreezed);
expect(firstTextFreezed).toBe(secondRunWithoutFreezing);
expect(firstTextFreezed).not.toBe(firstRunWithoutFreezing);
expect(firstTextFreezed).not.toBe(thirdTextWithoutFreezing);
expect(firstRunWithoutFreezing).not.toBe(secondRunWithoutFreezing);
expect(thirdTextWithoutFreezing).toContain("Lorem Ipsum");
const lengthDifference = Math.abs(
thirdTextWithoutFreezing?.length! - firstTextFreezed?.length!,
);
expect(lengthDifference).toBeLessThan(100);
expect(thirdTextWithoutFreezing).not.toBe(secondRunWithoutFreezing);
},
);

View file

@ -11,7 +11,7 @@ declare const __dirname: string;
withEventDeliveryModes(
"Vector Store RAG",
{ tag: ["@release", "@starter-projects", "@development"] },
{ tag: ["@release", "@starter-projects"] },
async ({ page }) => {
test.skip(
!process?.env?.OPENAI_API_KEY,