From 07fc2fbfa44ca859e9531d3da82bc3deb5a7ef17 Mon Sep 17 00:00:00 2001 From: Dhruv Parmar <83108871+dhruvjsx@users.noreply.github.com> Date: Wed, 2 Jul 2025 22:17:27 +0530 Subject: [PATCH] fix flaky add multiple owner (#22059) --- .../resources/ui/playwright/utils/entity.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/openmetadata-ui/src/main/resources/ui/playwright/utils/entity.ts b/openmetadata-ui/src/main/resources/ui/playwright/utils/entity.ts index 8f6e097b2f4..4cd3c61ddba 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/utils/entity.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/utils/entity.ts @@ -263,6 +263,24 @@ export const addMultiOwner = async (data: { { state: 'detached' } ); + const isClearButtonVisible = await page + .locator("[data-testid='select-owner-tabs']") + .getByTestId('clear-all-button') + .isVisible(); + + // If the user is not in the Users tab, switch to it + if (!isClearButtonVisible) { + await page + .locator("[data-testid='select-owner-tabs']") + .getByRole('tab', { name: 'Users' }) + .click(); + + await page.waitForSelector( + '[data-testid="select-owner-tabs"] [data-testid="loader"]', + { state: 'detached' } + ); + } + if (clearAll && isMultipleOwners) { await page.click('[data-testid="clear-all-button"]'); }