refactor: Improve flow creation and search performance in test (#5139)

feat: Improve flow creation and search functionality

Improve the flow creation and search functionality by adding explicit wait conditions for modals and search results. This ensures that the necessary elements are loaded before interacting with them, preventing potential errors or timeouts.

Refactor the code in the 'generalBugs-shard-8.spec.ts' file to include the following changes:
- Add a timeout of 3000ms for the modal title selector
- Add a timeout of 3000ms for the dataAPI request selector

These changes enhance the reliability and stability of the tests in the 'generalBugs-shard-8.spec.ts' file.
This commit is contained in:
anovazzi1 2024-12-07 00:07:28 -03:00 committed by GitHub
commit 39335a7e47
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -25,14 +25,18 @@ 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.getByTestId("blank-flow").click();
await page.getByTestId("sidebar-search-input").click();
await page.getByTestId("sidebar-search-input").fill("api request");
await page.waitForTimeout(1000);
await page.waitForSelector('[data-testid="dataAPI Request"]', {
timeout: 3000,
});
await page
.getByTestId("dataAPI Request")