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 e0fbfc864ca..8b94c0766dd 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 @@ -159,7 +159,9 @@ test.describe('Activity feed', () => { await page.getByText('Accept Suggestion').click(); + const waitForCountFetch = page.waitForResponse('/api/v1/feed/count?**'); await toastNotification(page, /Task resolved successfully/); + await waitForCountFetch; await checkTaskCount(page, 0, 2); }); @@ -316,7 +318,9 @@ test.describe('Activity feed', () => { await page.getByText('Accept Suggestion').click(); + const waitForCountFetch = page.waitForResponse('/api/v1/feed/count?**'); await toastNotification(page, /Task resolved successfully/); + await waitForCountFetch; await checkTaskCount(page, 0, 2); }); @@ -378,7 +382,9 @@ test.describe('Activity feed', () => { await page.getByRole('menuitem', { name: 'close' }).click(); await commentWithCloseTask; + const waitForCountFetch = page.waitForResponse('/api/v1/feed/count?**'); await toastNotification(page, 'Task closed successfully.'); + await waitForCountFetch; await checkTaskCount(page, 0, 1); }); @@ -410,9 +416,11 @@ test.describe('Activity feed', () => { await page.getByTestId('request-entity-tags').click(); // create tag task + const waitForCountFetch = page.waitForResponse('/api/v1/feed/count?**'); const openTaskAfterTagResponse = page.waitForResponse(TASK_OPEN_FETCH_LINK); await createTagTask(page, { ...value, tag: 'PII.None' }); await openTaskAfterTagResponse; + await waitForCountFetch; // open task count after description await checkTaskCount(page, 2, 0); @@ -432,11 +440,9 @@ test.describe('Activity feed', () => { await page.getByRole('menuitem', { name: 'close' }).click(); await commentWithCloseTask; - const waitForCountFetch = page.waitForResponse('/api/v1/feed/count?*'); - + const waitForCountFetch2 = page.waitForResponse('/api/v1/feed/count?**'); await toastNotification(page, 'Task closed successfully.'); - - await waitForCountFetch; + await waitForCountFetch2; // open task count after closing one task await checkTaskCount(page, 1, 1); @@ -660,7 +666,9 @@ base.describe('Activity feed with Data Consumer User', () => { await page2.getByText('Accept Suggestion').click(); + const waitForCountFetch = page2.waitForResponse('/api/v1/feed/count?**'); await toastNotification(page2, /Task resolved successfully/); + await waitForCountFetch; // TODO: Ashish - Enable them once issue is resolved from Backend https://github.com/open-metadata/OpenMetadata/issues/17059 // const openTask = await page2.getByTestId('open-task').textContent(); diff --git a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/MyData.spec.ts b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/MyData.spec.ts index 483f94272d0..a71cf6ad1f5 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/MyData.spec.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/MyData.spec.ts @@ -31,11 +31,11 @@ const test = base.extend<{ page: Page }>({ }, }); -test.describe('My Data page', () => { +test.describe.serial('My Data page', () => { test.beforeAll('Setup pre-requests', async ({ browser }) => { const { apiContext, afterAction } = await performAdminLogin(browser); await user.create(apiContext); - for (const table of TableEntities) { + const tablePromises = TableEntities.map(async (table) => { await table.create(apiContext); await table.patch({ apiContext, @@ -56,16 +56,18 @@ test.describe('My Data page', () => { ], }); await table.followTable(apiContext, user.responseData.id); - } + }); + + await Promise.all(tablePromises); + await afterAction(); }); test.afterAll('Cleanup', async ({ browser }) => { const { apiContext, afterAction } = await performAdminLogin(browser); await user.delete(apiContext); - for (const table of TableEntities) { - await table.delete(apiContext); - } + + await Promise.all(TableEntities.map((table) => table.delete(apiContext))); await afterAction(); });