mirror of
				https://github.com/open-metadata/OpenMetadata.git
				synced 2025-10-31 02:29:03 +00:00 
			
		
		
		
	fix activty feed and teamHierarchy playwright failure (#17991)
Co-authored-by: Shailesh Parmar <shailesh.parmar.webdev@gmail.com> (cherry picked from commit 9b45573c351ddb6c8013b9de54c0e207f2ee3798)
This commit is contained in:
		
							parent
							
								
									b7238b87b0
								
							
						
					
					
						commit
						ec0ba2e3a1
					
				| @ -209,9 +209,9 @@ test.describe('Activity feed', () => { | |||||||
| 
 | 
 | ||||||
|     await page.getByText('Accept Suggestion').click(); |     await page.getByText('Accept Suggestion').click(); | ||||||
| 
 | 
 | ||||||
|     const waitForCountFetch = page.waitForResponse('/api/v1/feed/count?**'); |  | ||||||
|     await toastNotification(page, /Task resolved successfully/); |     await toastNotification(page, /Task resolved successfully/); | ||||||
|     await waitForCountFetch; | 
 | ||||||
|  |     await page.waitForLoadState('networkidle'); | ||||||
| 
 | 
 | ||||||
|     await checkTaskCount(page, 0, 2); |     await checkTaskCount(page, 0, 2); | ||||||
|   }); |   }); | ||||||
| @ -370,9 +370,9 @@ test.describe('Activity feed', () => { | |||||||
| 
 | 
 | ||||||
|     await page.getByText('Accept Suggestion').click(); |     await page.getByText('Accept Suggestion').click(); | ||||||
| 
 | 
 | ||||||
|     const waitForCountFetch = page.waitForResponse('/api/v1/feed/count?**'); |  | ||||||
|     await toastNotification(page, /Task resolved successfully/); |     await toastNotification(page, /Task resolved successfully/); | ||||||
|     await waitForCountFetch; | 
 | ||||||
|  |     await page.waitForLoadState('networkidle'); | ||||||
| 
 | 
 | ||||||
|     await checkTaskCount(page, 0, 2); |     await checkTaskCount(page, 0, 2); | ||||||
|   }); |   }); | ||||||
| @ -432,9 +432,9 @@ test.describe('Activity feed', () => { | |||||||
|     await page.getByRole('menuitem', { name: 'close' }).click(); |     await page.getByRole('menuitem', { name: 'close' }).click(); | ||||||
|     await commentWithCloseTask; |     await commentWithCloseTask; | ||||||
| 
 | 
 | ||||||
|     const waitForCountFetch = page.waitForResponse('/api/v1/feed/count?**'); |  | ||||||
|     await toastNotification(page, 'Task closed successfully.'); |     await toastNotification(page, 'Task closed successfully.'); | ||||||
|     await waitForCountFetch; | 
 | ||||||
|  |     await page.waitForLoadState('networkidle'); | ||||||
| 
 | 
 | ||||||
|     await checkTaskCount(page, 0, 1); |     await checkTaskCount(page, 0, 1); | ||||||
|   }); |   }); | ||||||
| @ -451,12 +451,12 @@ test.describe('Activity feed', () => { | |||||||
|     await page.getByTestId('request-description').click(); |     await page.getByTestId('request-description').click(); | ||||||
| 
 | 
 | ||||||
|     // create description task
 |     // create description task
 | ||||||
|     const waitForCountFetch1 = page.waitForResponse('/api/v1/feed/count?**'); |  | ||||||
|     const openTaskAfterDescriptionResponse = |     const openTaskAfterDescriptionResponse = | ||||||
|       page.waitForResponse(TASK_OPEN_FETCH_LINK); |       page.waitForResponse(TASK_OPEN_FETCH_LINK); | ||||||
|     await createDescriptionTask(page, value); |     await createDescriptionTask(page, value); | ||||||
|     await openTaskAfterDescriptionResponse; |     await openTaskAfterDescriptionResponse; | ||||||
|     await waitForCountFetch1; | 
 | ||||||
|  |     await page.waitForLoadState('networkidle'); | ||||||
| 
 | 
 | ||||||
|     // open task count after description
 |     // open task count after description
 | ||||||
|     const openTask1 = await page.getByTestId('open-task').textContent(); |     const openTask1 = await page.getByTestId('open-task').textContent(); | ||||||
| @ -468,11 +468,11 @@ test.describe('Activity feed', () => { | |||||||
|     await page.getByTestId('request-entity-tags').click(); |     await page.getByTestId('request-entity-tags').click(); | ||||||
| 
 | 
 | ||||||
|     // create tag task
 |     // create tag task
 | ||||||
|     const waitForCountFetch2 = page.waitForResponse('/api/v1/feed/count?**'); |  | ||||||
|     const openTaskAfterTagResponse = page.waitForResponse(TASK_OPEN_FETCH_LINK); |     const openTaskAfterTagResponse = page.waitForResponse(TASK_OPEN_FETCH_LINK); | ||||||
|     await createTagTask(page, { ...value, tag: 'PII.None' }); |     await createTagTask(page, { ...value, tag: 'PII.None' }); | ||||||
|     await openTaskAfterTagResponse; |     await openTaskAfterTagResponse; | ||||||
|     await waitForCountFetch2; | 
 | ||||||
|  |     await page.waitForLoadState('networkidle'); | ||||||
| 
 | 
 | ||||||
|     // open task count after description
 |     // open task count after description
 | ||||||
|     await checkTaskCount(page, 2, 0); |     await checkTaskCount(page, 2, 0); | ||||||
| @ -492,10 +492,8 @@ test.describe('Activity feed', () => { | |||||||
|     await page.getByRole('menuitem', { name: 'close' }).click(); |     await page.getByRole('menuitem', { name: 'close' }).click(); | ||||||
|     await commentWithCloseTask; |     await commentWithCloseTask; | ||||||
| 
 | 
 | ||||||
|     const waitForCountFetch3 = page.waitForResponse('/api/v1/feed/count?**'); |  | ||||||
|     await toastNotification(page, 'Task closed successfully.'); |     await toastNotification(page, 'Task closed successfully.'); | ||||||
|     await waitForCountFetch3; |     await page.waitForLoadState('networkidle'); | ||||||
| 
 |  | ||||||
|     // open task count after closing one task
 |     // open task count after closing one task
 | ||||||
|     await checkTaskCount(page, 1, 1); |     await checkTaskCount(page, 1, 1); | ||||||
| 
 | 
 | ||||||
| @ -537,6 +535,7 @@ test.describe('Activity feed', () => { | |||||||
|   }); |   }); | ||||||
| 
 | 
 | ||||||
|   test('Mention should work for the feed reply', async ({ page }) => { |   test('Mention should work for the feed reply', async ({ page }) => { | ||||||
|  |     await test.step('Add Mention in Feed', async () => { | ||||||
|       await addMentionCommentInFeed(page, adminUser.responseData.name); |       await addMentionCommentInFeed(page, adminUser.responseData.name); | ||||||
| 
 | 
 | ||||||
|       // Close drawer
 |       // Close drawer
 | ||||||
| @ -565,23 +564,29 @@ test.describe('Activity feed', () => { | |||||||
|       expect(mentionedText).toContain(feedText); |       expect(mentionedText).toContain(feedText); | ||||||
|     }); |     }); | ||||||
| 
 | 
 | ||||||
|   test('Mention should work for the feed reply in case of users having dot in their name', async ({ |     await test.step( | ||||||
|     page, |       'Add Mention should work if users having dot in their name', | ||||||
|   }) => { |       async () => { | ||||||
|     await addMentionCommentInFeed(page, 'aaron.warren5'); |         await addMentionCommentInFeed(page, 'aaron.warren5', true); | ||||||
|  | 
 | ||||||
|  |         const lastFeedContainer = `#feed-panel [data-testid="message-container"] [data-testid="feed-replies"] .feed-card-v2-container:last-child`; | ||||||
| 
 | 
 | ||||||
|         await expect( |         await expect( | ||||||
|       page.locator( |           page | ||||||
|         `#feed-panel [data-testid="message-container"] [data-testid="feed-replies"] [data-testid="viewer-container"] [data-testid="markdown-parser"]` |             .locator(lastFeedContainer) | ||||||
|  |             .locator( | ||||||
|  |               '[data-testid="viewer-container"] [data-testid="markdown-parser"]' | ||||||
|             ) |             ) | ||||||
|         ).toContainText('Can you resolve this thread for me? @aaron.warren5'); |         ).toContainText('Can you resolve this thread for me? @aaron.warren5'); | ||||||
| 
 | 
 | ||||||
|         // Close drawer
 |         // Close drawer
 | ||||||
|         await page.locator('[data-testid="closeDrawer"]').click(); |         await page.locator('[data-testid="closeDrawer"]').click(); | ||||||
| 
 | 
 | ||||||
|     expect( |         await expect( | ||||||
|           page.locator(`${FIRST_FEED_SELECTOR} [data-testid="reply-count"]`) |           page.locator(`${FIRST_FEED_SELECTOR} [data-testid="reply-count"]`) | ||||||
|     ).toContainText('01 Reply'); |         ).toContainText('2 Replies'); | ||||||
|  |       } | ||||||
|  |     ); | ||||||
|   }); |   }); | ||||||
| }); | }); | ||||||
| 
 | 
 | ||||||
| @ -744,9 +749,9 @@ base.describe('Activity feed with Data Consumer User', () => { | |||||||
| 
 | 
 | ||||||
|       await page2.getByText('Accept Suggestion').click(); |       await page2.getByText('Accept Suggestion').click(); | ||||||
| 
 | 
 | ||||||
|       const waitForCountFetch = page2.waitForResponse('/api/v1/feed/count?**'); |  | ||||||
|       await toastNotification(page2, /Task resolved successfully/); |       await toastNotification(page2, /Task resolved successfully/); | ||||||
|       await waitForCountFetch; | 
 | ||||||
|  |       await page2.waitForLoadState('networkidle'); | ||||||
| 
 | 
 | ||||||
|       // TODO: Ashish - Enable them once issue is resolved from Backend https://github.com/open-metadata/OpenMetadata/issues/17059
 |       // 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();
 |       //   const openTask = await page2.getByTestId('open-task').textContent();
 | ||||||
|  | |||||||
| @ -77,14 +77,15 @@ test.describe('Add Nested Teams and Test TeamsSelectable', () => { | |||||||
|     await settingClick(page, GlobalSettingOptions.USERS); |     await settingClick(page, GlobalSettingOptions.USERS); | ||||||
| 
 | 
 | ||||||
|     // Click on add user button
 |     // Click on add user button
 | ||||||
|  |     const teamHierarchyResponse = page.waitForResponse( | ||||||
|  |       '/api/v1/teams/hierarchy?isJoinable=false' | ||||||
|  |     ); | ||||||
|     await page.locator('[data-testid="add-user"]').click(); |     await page.locator('[data-testid="add-user"]').click(); | ||||||
|  |     await teamHierarchyResponse; | ||||||
| 
 | 
 | ||||||
|     // Enter team name
 |     // Enter team name
 | ||||||
|     const teamSelect = page.locator( |     await page.click('[data-testid="team-select"]'); | ||||||
|       '[data-testid="team-select"] .ant-select-selector' |     await page.keyboard.type(businessTeamName); | ||||||
|     ); |  | ||||||
|     await teamSelect.click(); |  | ||||||
|     await teamSelect.type(businessTeamName); |  | ||||||
| 
 | 
 | ||||||
|     for (const teamName of teamNames) { |     for (const teamName of teamNames) { | ||||||
|       const dropdown = page.locator('.ant-tree-select-dropdown'); |       const dropdown = page.locator('.ant-tree-select-dropdown'); | ||||||
| @ -93,10 +94,10 @@ test.describe('Add Nested Teams and Test TeamsSelectable', () => { | |||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     for (const teamName of teamNames) { |     for (const teamName of teamNames) { | ||||||
|       await expect(teamSelect).toBeVisible(); |       await expect(page.getByTestId('team-select')).toBeVisible(); | ||||||
| 
 | 
 | ||||||
|       await teamSelect.click(); |       await page.click('[data-testid="team-select"]'); | ||||||
|       await teamSelect.type(teamName); |       await page.keyboard.type(teamName); | ||||||
| 
 | 
 | ||||||
|       await expect(page.locator('.ant-tree-select-dropdown')).toContainText( |       await expect(page.locator('.ant-tree-select-dropdown')).toContainText( | ||||||
|         teamName |         teamName | ||||||
|  | |||||||
| @ -102,20 +102,33 @@ export const reactOnFeed = async (page: Page) => { | |||||||
|   } |   } | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| export const addMentionCommentInFeed = async (page: Page, user: string) => { | export const addMentionCommentInFeed = async ( | ||||||
|  |   page: Page, | ||||||
|  |   user: string, | ||||||
|  |   isReply = false | ||||||
|  | ) => { | ||||||
|  |   if (!isReply) { | ||||||
|     const fetchFeedResponse = page.waitForResponse( |     const fetchFeedResponse = page.waitForResponse( | ||||||
|       '/api/v1/feed?type=Conversation*' |       '/api/v1/feed?type=Conversation*' | ||||||
|     ); |     ); | ||||||
|     await removeLandingBanner(page); |     await removeLandingBanner(page); | ||||||
|     await fetchFeedResponse; |     await fetchFeedResponse; | ||||||
|  |   } | ||||||
| 
 | 
 | ||||||
|   // Click on add reply
 |   // Click on add reply
 | ||||||
|   const feedResponse = page.waitForResponse('/api/v1/feed/*'); |   const feedResponse = page.waitForResponse('/api/v1/feed/*'); | ||||||
|  | 
 | ||||||
|  |   if (isReply) { | ||||||
|  |     await page | ||||||
|  |       .locator(FIRST_FEED_SELECTOR) | ||||||
|  |       .locator('[data-testid="reply-count"]') | ||||||
|  |       .click(); | ||||||
|  |   } else { | ||||||
|     await page |     await page | ||||||
|       .locator(FIRST_FEED_SELECTOR) |       .locator(FIRST_FEED_SELECTOR) | ||||||
|       .locator('[data-testid="thread-count"]') |       .locator('[data-testid="thread-count"]') | ||||||
|       .click(); |       .click(); | ||||||
| 
 |   } | ||||||
|   await feedResponse; |   await feedResponse; | ||||||
| 
 | 
 | ||||||
|   await page.waitForSelector('.ant-drawer-content', { |   await page.waitForSelector('.ant-drawer-content', { | ||||||
| @ -137,7 +150,7 @@ export const addMentionCommentInFeed = async (page: Page, user: string) => { | |||||||
|     .locator( |     .locator( | ||||||
|       '[data-testid="editor-wrapper"] [contenteditable="true"].ql-editor' |       '[data-testid="editor-wrapper"] [contenteditable="true"].ql-editor' | ||||||
|     ) |     ) | ||||||
|     .type(`Can you resolve this thread for me? @${user}`); |     .fill(`Can you resolve this thread for me? @${user}`); | ||||||
|   await userSuggestionsResponse; |   await userSuggestionsResponse; | ||||||
| 
 | 
 | ||||||
|   await page.locator(`[data-value="@${user}"]`).click(); |   await page.locator(`[data-value="@${user}"]`).click(); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Ashish Gupta
						Ashish Gupta