Refactor: update fileUploadComponent.spec.ts to improve test reliability, performance and readability (#4856)

Refactor fileUploadComponent.spec.ts to improve test reliability and readability
This commit is contained in:
anovazzi1 2024-11-27 12:48:41 -03:00 committed by GitHub
commit 4d599590e2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -28,7 +28,9 @@ test(
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();
}
await page.waitForSelector('[data-testid="blank-flow"]', {
@ -39,7 +41,9 @@ test(
await page.getByTestId("sidebar-search-input").click();
await page.getByTestId("sidebar-search-input").fill("file");
await page.waitForTimeout(1000);
await page.waitForSelector('[data-testid="dataFile"]', {
timeout: 3000,
});
await page
.getByTestId("dataFile")
@ -165,7 +169,8 @@ test(
await page.getByText("Run Flow", { exact: true }).click();
await page.waitForTimeout(3000);
expect(await page.getByText("this is a test file").isVisible()).toBe(true);
await expect(page.getByText("this is a test file")).toBeVisible({
timeout: 3000,
});
},
);