Refactor: Improve test stability and reliability (#5135)
fix: Improve test stability and reliability Improve the stability and reliability of the tests in the generalBugs-shard-2.spec.ts file. - Use waitForSelector instead of waitForTimeout to ensure that the modal and data elements are present before proceeding. - Increase the timeout value to 3000 milliseconds for better reliability. - Add a comment to indicate the purpose of the timeout. This commit addresses the issue of intermittent failures in the tests and enhances the overall test stability.
This commit is contained in:
parent
39335a7e47
commit
47d7004fc0
1 changed files with 8 additions and 2 deletions
|
|
@ -36,7 +36,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();
|
||||
}
|
||||
|
||||
|
|
@ -45,7 +47,9 @@ test(
|
|||
await page.getByTestId("sidebar-search-input").click();
|
||||
await page.getByTestId("sidebar-search-input").fill("webhook");
|
||||
|
||||
await page.waitForTimeout(1000);
|
||||
await page.waitForSelector('[data-testid="dataWebhook"]', {
|
||||
timeout: 3000,
|
||||
});
|
||||
|
||||
await page
|
||||
.getByTestId("dataWebhook")
|
||||
|
|
@ -62,7 +66,9 @@ test(
|
|||
await page.getByTestId("zoom_out").click();
|
||||
await page.getByTestId("zoom_out").click();
|
||||
|
||||
// wait for the update to be applied
|
||||
await page.waitForTimeout(1000);
|
||||
|
||||
await page.getByText("API", { exact: true }).click();
|
||||
|
||||
await page.getByText("Webhook cURL", { exact: true }).click();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue