From 8ccd87965560aae455b67669d7eba53d27fbeb51 Mon Sep 17 00:00:00 2001 From: Ashish Gupta Date: Fri, 10 Oct 2025 18:55:24 +0530 Subject: [PATCH] PLAYWRIGHT: fix activity feed mention flaky test (#23823) --- .../e2e/Features/ActivityFeed.spec.ts | 64 ++++--------------- 1 file changed, 13 insertions(+), 51 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/ActivityFeed.spec.ts b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/ActivityFeed.spec.ts index 67875dec3fe..4056d8ee1eb 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/ActivityFeed.spec.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/ActivityFeed.spec.ts @@ -21,7 +21,6 @@ import { navigateToCustomizeLandingPage, setUserDefaultPersona, } from '../../utils/customizeLandingPage'; -import { updateDescription } from '../../utils/entity'; const test = base; @@ -382,7 +381,6 @@ test.describe('FeedWidget on landing page', () => { test.describe('Mention notifications in Notification Box', () => { const adminUser = new UserClass(); const user1 = new UserClass(); - const entity = new TableClass(); const test = base.extend<{ adminPage: Page; @@ -405,14 +403,11 @@ test.describe('Mention notifications in Notification Box', () => { test.beforeAll('Setup entities and users', async ({ browser }) => { const { apiContext, afterAction } = await performAdminLogin(browser); - try { - await adminUser.create(apiContext); - await adminUser.setAdminRole(apiContext); - await user1.create(apiContext); - await entity.create(apiContext); - } finally { - await afterAction(); - } + await adminUser.create(apiContext); + await adminUser.setAdminRole(apiContext); + await user1.create(apiContext); + await entity.create(apiContext); + await afterAction(); }); test('Mention notification shows correct user details in Notification box', async ({ @@ -421,55 +416,18 @@ test.describe('Mention notifications in Notification Box', () => { }) => { test.slow(); + const entityFQN = 'sample_data.ecommerce_db.shopify.performance_test_table'; + await test.step( 'Admin user creates a conversation on an entity', async () => { - await entity.visitEntityPage(adminPage); + await adminPage.goto(`/table/${entityFQN}`); await adminPage.waitForLoadState('networkidle'); await adminPage.waitForSelector('[data-testid="loader"]', { state: 'detached', }); - await updateDescription( - adminPage, - 'update the old description with new one' - ); - - await adminPage.reload(); - await adminPage.waitForLoadState('networkidle'); - await adminPage.waitForSelector('[data-testid="loader"]', { - state: 'detached', - }); - - let count = 0; - let iterations = 0; - const maxIterations = 20; - const delayMs = 5000; - - while (iterations < maxIterations) { - const countElement = adminPage - .getByTestId('activity_feed') - .getByTestId('filter-count'); - - const countText = await countElement.textContent(); - count = parseInt(countText ?? '0', 10); - - if (count > 0) { - break; - } - - iterations++; - if (iterations < maxIterations) { - await adminPage.waitForTimeout(delayMs); - await adminPage.reload(); - await adminPage.waitForLoadState('networkidle'); - await adminPage.waitForSelector('[data-testid="loader"]', { - state: 'detached', - }); - } - } - await adminPage.getByTestId('activity_feed').click(); await adminPage.waitForLoadState('networkidle'); @@ -504,7 +462,11 @@ test.describe('Mention notifications in Notification Box', () => { ); await test.step('User1 mentions admin user in a reply', async () => { - await entity.visitEntityPage(user1Page); + await user1Page.goto(`/table/${entityFQN}`); + await user1Page.waitForLoadState('networkidle'); + await user1Page.waitForSelector('[data-testid="loader"]', { + state: 'detached', + }); await user1Page.getByTestId('activity_feed').click(); await user1Page.waitForLoadState('networkidle');