Fix : Delete user playwright test (#20399)

* fix delete user playwright test

* alert fix for failing test
This commit is contained in:
Shrushti Polekar 2025-03-25 21:33:31 +05:30 committed by GitHub
parent 801788072e
commit 6773e015fa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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!/);
};