refactor: Improve reliability of flowPage.spec.ts test (#5070)

* test: Improve flowPage.spec.ts test reliability

Enhance the reliability of the flowPage.spec.ts test by adding explicit wait conditions for the modal and sidebar components. This ensures that the test waits for the necessary elements to be present before interacting with them, reducing the likelihood of test failures due to timing issues.
This commit is contained in:
anovazzi1 2024-12-05 21:39:14 -03:00 committed by GitHub
commit d60508ec85
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -23,13 +23,20 @@ test.describe("Flow Page tests", () => {
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.waitForTimeout(1000);
await page.waitForSelector(
'[data-testid="sidebar-custom-component-button"]',
{
timeout: 3000,
},
);
await page.getByTestId("sidebar-custom-component-button").click();