From 9a76b07025fade6285ddcd45819fa93c40fe6806 Mon Sep 17 00:00:00 2001 From: Karan Hotchandani <33024356+karanh37@users.noreply.github.com> Date: Thu, 19 Dec 2024 23:05:55 +0530 Subject: [PATCH] Fix flaky e2e tests (#19038) * fix lineage flaky tests * fix glossary flakiness --- .../src/main/resources/ui/playwright/utils/glossary.ts | 2 ++ .../src/main/resources/ui/playwright/utils/lineage.ts | 7 +++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/playwright/utils/glossary.ts b/openmetadata-ui/src/main/resources/ui/playwright/utils/glossary.ts index d694d659f3db..361e19fc0aa0 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/utils/glossary.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/utils/glossary.ts @@ -1071,7 +1071,9 @@ export const approveTagsTask = async ( await taskResolve; await redirectToHomePage(page); + const glossaryTermsResponse = page.waitForResponse('/api/v1/glossaryTerms*'); await sidebarClick(page, SidebarItem.GLOSSARY); + await glossaryTermsResponse; await selectActiveGlossary(page, entity.data.displayName); const tagVisibility = await page.isVisible( diff --git a/openmetadata-ui/src/main/resources/ui/playwright/utils/lineage.ts b/openmetadata-ui/src/main/resources/ui/playwright/utils/lineage.ts index 1c8f2cf5aa69..9dcdbb85e250 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/utils/lineage.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/utils/lineage.ts @@ -133,10 +133,9 @@ export const dragAndDropNode = async ( await page.hover(originSelector); await page.mouse.down(); const box = (await destinationElement.boundingBox())!; - const x = (box.x + box.width / 2) * 0.25; // 0.25 as zoom factor - const y = (box.y + box.height / 2) * 0.25; // 0.25 as zoom factor - await page.mouse.move(x, y); - await destinationElement.hover(); + const x = box.x + 250; + const y = box.y + box.height / 2; + await page.mouse.move(x, y, { steps: 20 }); await page.mouse.up(); };