Refactor: improve YouTube Transcripts integration tests (#5129)

fix: improve YouTube Transcripts integration tests

Improve the integration tests for the YouTube Transcripts feature by adding explicit wait conditions for modals and elements. This ensures that the tests are more reliable and less prone to timing issues.
This commit is contained in:
anovazzi1 2024-12-07 00:43:23 -03:00 committed by GitHub
commit 6d252d34c6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -25,7 +25,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();
}
@ -33,7 +35,9 @@ test(
await page.getByTestId("sidebar-search-input").click();
await page.getByTestId("sidebar-search-input").fill("youtube");
await page.waitForTimeout(1000);
await page.waitForSelector('[id="toolsYouTube Transcripts"]', {
timeout: 3000,
});
await page
.locator('//*[@id="toolsYouTube Transcripts"]')
@ -48,7 +52,6 @@ test(
while (outdatedComponents > 0) {
await page.getByTestId("icon-AlertTriangle").first().click();
await page.waitForTimeout(1000);
outdatedComponents = await page.getByTestId("icon-AlertTriangle").count();
}
@ -62,12 +65,10 @@ test(
await page.getByTestId("output-inspection-data").first().click();
await page.waitForTimeout(1000);
await page.waitForSelector("text=Component Output", { timeout: 30000 });
await page.getByRole("gridcell").first().click();
await page.waitForTimeout(1000);
const value = await page.getByPlaceholder("Empty").inputValue();
expect(value.length).toBeGreaterThan(10);
},