mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-09-30 19:36:41 +00:00
Unskip activity feed widgets E2E tests (#23024)
* Unskip activity feed widgets E2E tests * minor fix
This commit is contained in:
parent
cfaa4555bc
commit
cdf9f6ed3b
File diff suppressed because it is too large
Load Diff
@ -26,8 +26,9 @@ export const FEED_REACTIONS = [
|
||||
'eyes',
|
||||
'rocket',
|
||||
];
|
||||
export const FIRST_FEED_SELECTOR =
|
||||
'[data-testid="activity-feed-widget"] [data-testid="message-container"]:first-child';
|
||||
// Returns the nth feed message container (0-based) regardless of page context (widget, drawer, or full page)
|
||||
const getNthFeedMessage = (page: Page, indexZeroBased: number) =>
|
||||
page.locator('[data-testid="message-container"]').nth(indexZeroBased);
|
||||
|
||||
export const checkDescriptionInEditModal = async (
|
||||
page: Page,
|
||||
@ -86,14 +87,19 @@ export const deleteFeedComments = async (page: Page, feed: Locator) => {
|
||||
};
|
||||
|
||||
export const reactOnFeed = async (page: Page, feedNumber: number) => {
|
||||
// Ensure at least one message exists; the caller usually checks, but we guard here
|
||||
const message = getNthFeedMessage(page, Math.max(0, feedNumber - 1));
|
||||
|
||||
await expect(message).toBeVisible();
|
||||
|
||||
for (const reaction of FEED_REACTIONS) {
|
||||
await page
|
||||
.locator(
|
||||
`[data-testid="activity-feed-widget"] [data-testid="message-container"]:nth-child(${feedNumber})`
|
||||
)
|
||||
const addReactionButton = message
|
||||
.locator('[data-testid="feed-reaction-container"]')
|
||||
.locator('[data-testid="add-reactions"]')
|
||||
.click();
|
||||
.locator('[data-testid="add-reactions"]');
|
||||
|
||||
await expect(addReactionButton).toBeVisible();
|
||||
|
||||
await addReactionButton.click();
|
||||
|
||||
await page
|
||||
.locator('.ant-popover-feed-reactions .ant-popover-inner-content')
|
||||
@ -122,10 +128,11 @@ export const addMentionCommentInFeed = async (
|
||||
|
||||
await page.waitForSelector('[data-testid="loader"]', { state: 'detached' });
|
||||
|
||||
await page
|
||||
.locator(FIRST_FEED_SELECTOR)
|
||||
.locator('[data-testid="reply-count"]')
|
||||
.click();
|
||||
const firstMessage = getNthFeedMessage(page, 0);
|
||||
|
||||
await expect(firstMessage).toBeVisible();
|
||||
|
||||
await firstMessage.locator('[data-testid="reply-count"]').click();
|
||||
await page.waitForSelector('.ant-drawer-content', {
|
||||
state: 'visible',
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user