mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-09-30 03:16:30 +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',
|
'eyes',
|
||||||
'rocket',
|
'rocket',
|
||||||
];
|
];
|
||||||
export const FIRST_FEED_SELECTOR =
|
// Returns the nth feed message container (0-based) regardless of page context (widget, drawer, or full page)
|
||||||
'[data-testid="activity-feed-widget"] [data-testid="message-container"]:first-child';
|
const getNthFeedMessage = (page: Page, indexZeroBased: number) =>
|
||||||
|
page.locator('[data-testid="message-container"]').nth(indexZeroBased);
|
||||||
|
|
||||||
export const checkDescriptionInEditModal = async (
|
export const checkDescriptionInEditModal = async (
|
||||||
page: Page,
|
page: Page,
|
||||||
@ -86,14 +87,19 @@ export const deleteFeedComments = async (page: Page, feed: Locator) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const reactOnFeed = async (page: Page, feedNumber: number) => {
|
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) {
|
for (const reaction of FEED_REACTIONS) {
|
||||||
await page
|
const addReactionButton = message
|
||||||
.locator(
|
|
||||||
`[data-testid="activity-feed-widget"] [data-testid="message-container"]:nth-child(${feedNumber})`
|
|
||||||
)
|
|
||||||
.locator('[data-testid="feed-reaction-container"]')
|
.locator('[data-testid="feed-reaction-container"]')
|
||||||
.locator('[data-testid="add-reactions"]')
|
.locator('[data-testid="add-reactions"]');
|
||||||
.click();
|
|
||||||
|
await expect(addReactionButton).toBeVisible();
|
||||||
|
|
||||||
|
await addReactionButton.click();
|
||||||
|
|
||||||
await page
|
await page
|
||||||
.locator('.ant-popover-feed-reactions .ant-popover-inner-content')
|
.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.waitForSelector('[data-testid="loader"]', { state: 'detached' });
|
||||||
|
|
||||||
await page
|
const firstMessage = getNthFeedMessage(page, 0);
|
||||||
.locator(FIRST_FEED_SELECTOR)
|
|
||||||
.locator('[data-testid="reply-count"]')
|
await expect(firstMessage).toBeVisible();
|
||||||
.click();
|
|
||||||
|
await firstMessage.locator('[data-testid="reply-count"]').click();
|
||||||
await page.waitForSelector('.ant-drawer-content', {
|
await page.waitForSelector('.ant-drawer-content', {
|
||||||
state: 'visible',
|
state: 'visible',
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user