From 6773e015fa6833507f42e530d4ce0e814c9d88e5 Mon Sep 17 00:00:00 2001 From: Shrushti Polekar Date: Tue, 25 Mar 2025 21:33:31 +0530 Subject: [PATCH] Fix : Delete user playwright test (#20399) * fix delete user playwright test * alert fix for failing test --- .../src/main/resources/ui/playwright/utils/user.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/playwright/utils/user.ts b/openmetadata-ui/src/main/resources/ui/playwright/utils/user.ts index 85e4d2c1477..7d1ab6efcf4 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/utils/user.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/utils/user.ts @@ -196,13 +196,18 @@ export const hardDeleteUserProfilePage = async ( await page.check('[data-testid="hard-delete"]'); await page.fill('[data-testid="confirmation-text-input"]', 'DELETE'); + const toastPromises = [ + page.waitForSelector('[data-testid="alert-bar"]'), + page.waitForSelector('[data-testid="alert-icon"]'), + page.waitForSelector('[data-testid="alert-icon-close"]'), + ]; const deleteResponse = page.waitForResponse( '/api/v1/users/*?hardDelete=true&recursive=true' ); await page.click('[data-testid="confirm-button"]'); - await deleteResponse; - + // Wait for both the delete response and all toast elements to appear + await Promise.all([deleteResponse, ...toastPromises]); await toastNotification(page, /deleted successfully!/); };