refactor: Improve page loading and element selection in DuckDuckGo integration test (#5128)

* fix: Improve page loading and element selection in DuckDuckGo integration test
This commit is contained in:
anovazzi1 2024-12-06 21:13:12 -03:00 committed by GitHub
commit 3f4c8fb3c8
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("duck");
await page.waitForTimeout(1000);
await page.waitForSelector('//*[@id="toolsDuckDuckGo Search"]', {
timeout: 3000,
});
await page
.locator('//*[@id="toolsDuckDuckGo Search"]')
@ -61,9 +65,7 @@ test(
"built successfully",
) ?? false;
await page.waitForTimeout(500);
await page.getByTestId("output-inspection-data").first().click();
await page.waitForTimeout(1000);
if (isBuiltSuccessfully) {
await page.getByRole("gridcell").first().click();