2024-06-26 17:02:30 +05:30
|
|
|
/*
|
|
|
|
|
* Copyright 2024 Collate.
|
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
|
* limitations under the License.
|
|
|
|
|
*/
|
2025-08-28 11:10:18 +05:30
|
|
|
import { expect, test } from '@playwright/test';
|
2024-06-26 17:02:30 +05:30
|
|
|
import { TableClass } from '../../support/entity/TableClass';
|
2025-08-28 11:10:18 +05:30
|
|
|
import { PersonaClass } from '../../support/persona/PersonaClass';
|
2024-06-26 17:02:30 +05:30
|
|
|
import { UserClass } from '../../support/user/UserClass';
|
2025-08-28 11:10:18 +05:30
|
|
|
import { REACTION_EMOJIS, reactOnFeed } from '../../utils/activityFeed';
|
2024-07-30 15:05:56 +05:30
|
|
|
import { performAdminLogin } from '../../utils/admin';
|
2025-08-30 18:37:45 +05:30
|
|
|
import { redirectToHomePage } from '../../utils/common';
|
2025-08-28 11:10:18 +05:30
|
|
|
import { navigateToCustomizeLandingPage } from '../../utils/customizeLandingPage';
|
|
|
|
|
import { selectPersona } from '../../utils/customizeNavigation';
|
|
|
|
|
|
2024-08-22 18:53:43 +05:30
|
|
|
const adminUser = new UserClass();
|
2025-08-28 11:10:18 +05:30
|
|
|
const user1 = new UserClass();
|
|
|
|
|
const seedEntity = new TableClass();
|
|
|
|
|
const extraEntity = new TableClass();
|
|
|
|
|
const testPersona = new PersonaClass();
|
2024-08-22 18:53:43 +05:30
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
test.describe('FeedWidget on landing page', () => {
|
|
|
|
|
test.beforeAll(
|
|
|
|
|
'setup: seed entities, users, create persona, customize widget, and create feed activity',
|
|
|
|
|
async ({ browser }) => {
|
|
|
|
|
try {
|
|
|
|
|
const { apiContext, afterAction } = await performAdminLogin(browser);
|
|
|
|
|
try {
|
|
|
|
|
// Create admin and a standard user
|
|
|
|
|
await adminUser.create(apiContext);
|
|
|
|
|
await adminUser.setAdminRole(apiContext);
|
|
|
|
|
await user1.create(apiContext);
|
|
|
|
|
|
|
|
|
|
// Create two entities to ensure feed diversity
|
|
|
|
|
await seedEntity.create(apiContext);
|
|
|
|
|
await extraEntity.create(apiContext);
|
|
|
|
|
|
|
|
|
|
// Create a persona for testing
|
|
|
|
|
await testPersona.create(apiContext, [adminUser.responseData.id]);
|
|
|
|
|
} finally {
|
|
|
|
|
await afterAction();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Log in as admin and customize the landing page for the persona
|
|
|
|
|
const adminPage = await browser.newPage();
|
|
|
|
|
await adminUser.login(adminPage);
|
|
|
|
|
try {
|
|
|
|
|
// Navigate to customize landing page for the persona
|
|
|
|
|
await navigateToCustomizeLandingPage(adminPage, {
|
|
|
|
|
personaName: testPersona.data.name,
|
|
|
|
|
});
|
2024-06-26 17:02:30 +05:30
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
// Find the Activity Feed widget and make it full size
|
|
|
|
|
const activityFeedWidget = adminPage.locator(
|
|
|
|
|
'[data-testid="KnowledgePanel.ActivityFeed"]'
|
|
|
|
|
);
|
2024-07-22 12:45:07 +05:30
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
// Click the more options button (three dots menu)
|
|
|
|
|
const moreOptionsButton = activityFeedWidget.locator(
|
|
|
|
|
'[data-testid="more-options-button"]'
|
|
|
|
|
);
|
2025-07-19 17:59:14 +05:30
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
await expect(moreOptionsButton).toBeVisible();
|
2025-07-19 17:59:14 +05:30
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
await moreOptionsButton.click();
|
2024-06-26 17:02:30 +05:30
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
// Click "Full Size" option from the dropdown menu
|
|
|
|
|
await adminPage.getByRole('menuitem', { name: 'Full Size' }).click();
|
2025-07-19 17:59:14 +05:30
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
// Save the layout
|
|
|
|
|
await adminPage.locator('[data-testid="save-button"]').click();
|
|
|
|
|
await adminPage.waitForLoadState('networkidle');
|
2024-06-26 17:02:30 +05:30
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
// Navigate back to home page
|
|
|
|
|
await redirectToHomePage(adminPage);
|
2025-07-19 17:59:14 +05:30
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
// Select the persona for the current user
|
|
|
|
|
await selectPersona(adminPage, testPersona);
|
|
|
|
|
} catch (e) {
|
|
|
|
|
// ignore failures here; tests have guards
|
|
|
|
|
} finally {
|
|
|
|
|
await adminPage.close();
|
2025-07-19 17:59:14 +05:30
|
|
|
}
|
2025-08-28 11:10:18 +05:30
|
|
|
} catch (e) {
|
|
|
|
|
// proceed even if setup fails; tests handle empty state
|
2025-07-19 17:59:14 +05:30
|
|
|
}
|
2025-08-28 11:10:18 +05:30
|
|
|
}
|
|
|
|
|
);
|
2024-06-26 17:02:30 +05:30
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
test.afterAll(
|
|
|
|
|
'cleanup: delete entities, users, and persona',
|
|
|
|
|
async ({ browser }) => {
|
|
|
|
|
try {
|
|
|
|
|
const { apiContext, afterAction } = await performAdminLogin(browser);
|
2025-07-19 17:59:14 +05:30
|
|
|
try {
|
2025-08-28 11:10:18 +05:30
|
|
|
await seedEntity.delete(apiContext);
|
|
|
|
|
await extraEntity.delete(apiContext);
|
|
|
|
|
await user1.delete(apiContext);
|
|
|
|
|
await adminUser.delete(apiContext);
|
|
|
|
|
await testPersona.delete(apiContext);
|
|
|
|
|
} finally {
|
|
|
|
|
await afterAction();
|
2025-07-19 17:59:14 +05:30
|
|
|
}
|
2025-08-28 11:10:18 +05:30
|
|
|
} catch (e) {
|
|
|
|
|
// ignore cleanup errors
|
2025-07-19 17:59:14 +05:30
|
|
|
}
|
|
|
|
|
}
|
2025-08-28 11:10:18 +05:30
|
|
|
);
|
2024-06-26 17:02:30 +05:30
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
test.beforeEach(async ({ page }) => {
|
|
|
|
|
await adminUser.login(page);
|
|
|
|
|
await redirectToHomePage(page);
|
2024-09-15 19:43:21 +05:30
|
|
|
});
|
|
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
test('renders widget wrapper and header with sort dropdown', async ({
|
2025-07-19 17:59:14 +05:30
|
|
|
page,
|
|
|
|
|
}) => {
|
2025-08-28 11:10:18 +05:30
|
|
|
const widget = page.locator('[data-testid="KnowledgePanel.ActivityFeed"]');
|
2024-09-15 19:43:21 +05:30
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
await expect(widget).toBeVisible();
|
2024-09-15 19:43:21 +05:30
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
// Header title and icon
|
|
|
|
|
const header = widget.locator('[data-testid="widget-header"]');
|
2024-09-15 19:43:21 +05:30
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
await expect(header).toBeVisible();
|
|
|
|
|
await expect(header).toContainText('Activity Feed');
|
2024-09-15 19:43:21 +05:30
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
// Sort dropdown should be visible (non-edit view)
|
|
|
|
|
const sortDropdown = header.locator(
|
|
|
|
|
'[data-testid="widget-sort-by-dropdown"]'
|
2024-06-26 17:02:30 +05:30
|
|
|
);
|
|
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
await expect(sortDropdown).toBeVisible();
|
2024-06-26 17:02:30 +05:30
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
// Open dropdown and verify options
|
|
|
|
|
await sortDropdown.click();
|
2024-06-26 17:02:30 +05:30
|
|
|
|
|
|
|
|
await expect(
|
2025-08-28 11:10:18 +05:30
|
|
|
page.getByRole('menuitem', {
|
|
|
|
|
name: 'All Activity',
|
|
|
|
|
})
|
|
|
|
|
).toBeVisible();
|
2024-07-28 17:55:06 +05:30
|
|
|
await expect(
|
2025-08-28 11:10:18 +05:30
|
|
|
page.getByRole('menuitem', {
|
|
|
|
|
name: 'My Data',
|
|
|
|
|
})
|
|
|
|
|
).toBeVisible();
|
|
|
|
|
await expect(
|
|
|
|
|
page.getByRole('menuitem', {
|
|
|
|
|
name: 'Following',
|
|
|
|
|
})
|
|
|
|
|
).toBeVisible();
|
2025-06-12 23:14:02 +05:30
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
// Close dropdown
|
|
|
|
|
await page.keyboard.press('Escape');
|
2025-06-12 23:14:02 +05:30
|
|
|
});
|
|
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
test('clicking title navigates to Explore', async ({ page }) => {
|
|
|
|
|
const widget = page.locator('[data-testid="KnowledgePanel.ActivityFeed"]');
|
2024-07-19 12:04:56 +05:30
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
await expect(widget).toBeVisible();
|
2024-07-19 12:04:56 +05:30
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
// Click the header title to navigate to Explore
|
|
|
|
|
await widget
|
|
|
|
|
.locator('[data-testid="widget-header"]')
|
|
|
|
|
.getByText('Activity Feed')
|
2024-07-19 12:04:56 +05:30
|
|
|
.click();
|
2025-08-28 11:10:18 +05:30
|
|
|
await page.waitForLoadState('networkidle');
|
2024-07-19 12:04:56 +05:30
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
await expect(page).toHaveURL(/\/explore/);
|
2024-07-22 12:45:07 +05:30
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
// Navigate back home to keep context consistent for next tests
|
2024-08-22 18:53:43 +05:30
|
|
|
await redirectToHomePage(page);
|
2025-08-28 11:10:18 +05:30
|
|
|
});
|
2024-08-22 18:53:43 +05:30
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
test('feed body renders list or empty state', async ({ page }) => {
|
|
|
|
|
const widget = page.locator('[data-testid="KnowledgePanel.ActivityFeed"]');
|
2024-07-22 12:45:07 +05:30
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
await expect(widget).toBeVisible();
|
2024-07-22 12:45:07 +05:30
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
// Feed container
|
|
|
|
|
const container = page.locator('#feedWidgetData');
|
2024-07-22 12:45:07 +05:30
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
await expect(container).toBeVisible();
|
2024-07-22 12:45:07 +05:30
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
// Either render feed messages or show the widget-level empty state
|
|
|
|
|
const messageContainers = container.locator(
|
|
|
|
|
'[data-testid="message-container"]'
|
2024-07-22 12:45:07 +05:30
|
|
|
);
|
2025-08-28 11:10:18 +05:30
|
|
|
const emptyState = container.locator(
|
|
|
|
|
'[data-testid="no-data-placeholder-container"]'
|
2024-07-22 12:45:07 +05:30
|
|
|
);
|
|
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
const hasMessages = (await messageContainers.count()) > 0;
|
|
|
|
|
const hasEmpty = (await emptyState.count()) > 0;
|
2024-09-25 23:57:59 +05:30
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
expect(hasMessages || hasEmpty).toBe(true);
|
2024-08-15 07:59:50 +05:30
|
|
|
});
|
|
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
test('changing filter triggers feed reload', async ({ page }) => {
|
|
|
|
|
const widget = page.locator('[data-testid="KnowledgePanel.ActivityFeed"]');
|
2025-06-09 11:22:18 +05:30
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
await expect(widget).toBeVisible();
|
2025-06-09 11:22:18 +05:30
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
const sortDropdown = widget.locator(
|
|
|
|
|
'[data-testid="widget-sort-by-dropdown"]'
|
|
|
|
|
);
|
2025-06-25 23:08:57 +05:30
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
await expect(sortDropdown).toBeVisible();
|
2025-06-09 11:22:18 +05:30
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
// Switch to My Data and wait for a feed API call
|
|
|
|
|
await sortDropdown.click();
|
|
|
|
|
const myData = page.getByRole('menuitem', {
|
|
|
|
|
name: 'My Data',
|
|
|
|
|
});
|
|
|
|
|
if ((await myData.count()) > 0) {
|
|
|
|
|
const feedReq = page.waitForResponse(/\/api\/v1\/feed.*/);
|
|
|
|
|
await myData.click();
|
|
|
|
|
await feedReq;
|
2025-06-09 11:22:18 +05:30
|
|
|
}
|
|
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
// Switch back to All Activity
|
|
|
|
|
await sortDropdown.click();
|
|
|
|
|
const allActivity = page.getByRole('button', {
|
|
|
|
|
name: 'All Activity',
|
2025-06-09 11:22:18 +05:30
|
|
|
});
|
2025-08-28 11:10:18 +05:30
|
|
|
if ((await allActivity.count()) > 0) {
|
|
|
|
|
const feedReq = page.waitForResponse(/\/api\/v1\/feed.*/);
|
|
|
|
|
await allActivity.click();
|
|
|
|
|
await feedReq;
|
2025-06-09 11:22:18 +05:30
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
test('footer shows View More when applicable and navigates', async ({
|
2025-03-15 10:04:21 +05:30
|
|
|
page,
|
|
|
|
|
}) => {
|
2025-08-28 11:10:18 +05:30
|
|
|
const widget = page.locator('[data-testid="KnowledgePanel.ActivityFeed"]');
|
2024-08-15 07:59:50 +05:30
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
await expect(widget).toBeVisible();
|
2024-09-25 23:57:59 +05:30
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
// Footer only renders when showMoreButton is true
|
|
|
|
|
const viewMore = widget.getByRole('link', { name: /View More/i });
|
|
|
|
|
if ((await viewMore.count()) > 0) {
|
|
|
|
|
await expect(viewMore).toBeVisible();
|
2024-08-15 07:59:50 +05:30
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
await viewMore.click();
|
|
|
|
|
await page.waitForLoadState('networkidle');
|
2024-08-15 07:59:50 +05:30
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
// We should land on user Activity Feed. We just verify navigation happened
|
|
|
|
|
await expect(page).not.toHaveURL(/home|welcome/i);
|
2024-08-15 07:59:50 +05:30
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
// Return home for subsequent tests
|
|
|
|
|
await redirectToHomePage(page);
|
|
|
|
|
}
|
2024-07-22 12:45:07 +05:30
|
|
|
});
|
2024-08-29 15:12:32 +05:30
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
test('renders feed cards via ActivityFeedListV1New in widget mode', async ({
|
2024-08-29 15:12:32 +05:30
|
|
|
page,
|
|
|
|
|
}) => {
|
2025-08-28 11:10:18 +05:30
|
|
|
const container = page.locator('#feedWidgetData');
|
2024-09-15 19:43:21 +05:30
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
await expect(container).toBeVisible();
|
2024-09-15 19:43:21 +05:30
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
const firstCard = container
|
|
|
|
|
.locator('[data-testid="message-container"]')
|
|
|
|
|
.first();
|
2024-09-15 19:43:21 +05:30
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
if ((await firstCard.count()) > 0) {
|
|
|
|
|
await expect(firstCard).toBeVisible();
|
2024-09-15 19:43:21 +05:30
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
// Typical elements within a compact feed card rendered in widget mode
|
|
|
|
|
const headerText = firstCard.locator('[data-testid="headerText"]');
|
|
|
|
|
const timestamp = firstCard.locator('[data-testid="timestamp"]');
|
2024-09-25 23:57:59 +05:30
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
if ((await headerText.count()) > 0) {
|
|
|
|
|
await expect(headerText).toBeVisible();
|
2024-09-25 23:57:59 +05:30
|
|
|
}
|
2025-08-28 11:10:18 +05:30
|
|
|
if ((await timestamp.count()) > 0) {
|
|
|
|
|
await expect(timestamp).toBeVisible();
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-09-15 19:43:21 +05:30
|
|
|
});
|
2025-01-20 22:45:17 +05:30
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
test('emoji reactions can be added and removed in widget feed cards', async ({
|
|
|
|
|
page,
|
2025-06-29 13:18:09 +05:30
|
|
|
}) => {
|
2025-08-28 11:10:18 +05:30
|
|
|
const messages = page.locator('[data-testid="message-container"]');
|
|
|
|
|
if ((await messages.count()) === 0) {
|
|
|
|
|
// nothing to react to; skip gracefully
|
|
|
|
|
return;
|
|
|
|
|
}
|
2025-01-20 22:45:17 +05:30
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
const firstMessage = messages.first();
|
2025-03-23 12:13:56 +05:30
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
await expect(firstMessage).toBeVisible();
|
2025-01-20 22:45:17 +05:30
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
// Add reactions using helper (acts on the first feed index 1)
|
|
|
|
|
await reactOnFeed(page, 1);
|
2025-05-21 19:52:43 +05:30
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
// Verify reactions are visible
|
|
|
|
|
const reactionContainer = firstMessage.locator(
|
|
|
|
|
'[data-testid="feed-reaction-container"]'
|
|
|
|
|
);
|
2025-05-21 19:52:43 +05:30
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
await expect(reactionContainer).toBeVisible();
|
2024-07-22 12:45:07 +05:30
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
for (const emoji of REACTION_EMOJIS) {
|
|
|
|
|
await expect(reactionContainer).toContainText(emoji);
|
|
|
|
|
}
|
2024-07-22 12:45:07 +05:30
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
// Toggle off the same reactions
|
|
|
|
|
await reactOnFeed(page, 1);
|
2024-07-22 12:45:07 +05:30
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
// Container remains visible even if counts change
|
|
|
|
|
await expect(reactionContainer).toBeVisible();
|
2024-07-22 12:45:07 +05:30
|
|
|
});
|
|
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
test('thread drawer opens from reply count and allows posting a reply', async ({
|
|
|
|
|
page,
|
|
|
|
|
}) => {
|
|
|
|
|
const messages = page.locator('[data-testid="message-container"]');
|
|
|
|
|
if ((await messages.count()) === 0) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
2024-07-22 12:45:07 +05:30
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
const firstMessage = messages.first();
|
2024-07-22 12:45:07 +05:30
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
await expect(firstMessage).toBeVisible();
|
2024-07-22 12:45:07 +05:30
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
// Open thread/drawer via reply count or clicking the card
|
|
|
|
|
const replyCountBtn = firstMessage.locator('[data-testid="reply-count"]');
|
|
|
|
|
if (await replyCountBtn.count()) {
|
|
|
|
|
await replyCountBtn.click();
|
|
|
|
|
} else {
|
|
|
|
|
await firstMessage.click();
|
|
|
|
|
}
|
2024-07-22 12:45:07 +05:30
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
const drawer = page.locator('.ant-drawer-content');
|
2024-07-22 12:45:07 +05:30
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
await expect(drawer).toBeVisible();
|
2024-07-22 12:45:07 +05:30
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
// Type a quick reply if editor is present
|
|
|
|
|
const commentInput = drawer.locator('[data-testid="comments-input-field"]');
|
|
|
|
|
if (await commentInput.count()) {
|
2025-03-15 10:04:21 +05:30
|
|
|
await commentInput.click();
|
2025-08-28 11:10:18 +05:30
|
|
|
await page.fill(
|
2024-07-22 12:45:07 +05:30
|
|
|
'[data-testid="editor-wrapper"] .ql-editor',
|
2025-08-28 11:10:18 +05:30
|
|
|
'Widget thread automated reply'
|
2024-07-22 12:45:07 +05:30
|
|
|
);
|
|
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
const sendReply = page.waitForResponse(/\/api\/v1\/feed\/.*\/posts/);
|
|
|
|
|
await page.getByTestId('send-button').click({ force: true });
|
|
|
|
|
await sendReply;
|
2024-07-22 12:45:07 +05:30
|
|
|
|
|
|
|
|
await expect(
|
2025-08-28 11:10:18 +05:30
|
|
|
drawer.locator('[data-testid="feed-replies"]')
|
|
|
|
|
).toContainText('Widget thread automated reply');
|
2025-07-19 17:59:14 +05:30
|
|
|
}
|
2024-08-29 15:12:32 +05:30
|
|
|
|
2025-08-28 11:10:18 +05:30
|
|
|
// Close drawer
|
|
|
|
|
const closeBtn = drawer.locator('[data-testid="closeDrawer"]');
|
|
|
|
|
if (await closeBtn.count()) {
|
|
|
|
|
await closeBtn.click();
|
|
|
|
|
} else {
|
|
|
|
|
await page.keyboard.press('Escape');
|
2024-08-29 15:12:32 +05:30
|
|
|
}
|
2025-08-28 11:10:18 +05:30
|
|
|
});
|
2024-06-26 17:02:30 +05:30
|
|
|
});
|