mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-10-11 08:43:31 +00:00
chore(ui):fix the activity feed flaky playwright test (#23721)
This commit is contained in:
parent
a4da0b90b9
commit
ebfb98a022
@ -21,6 +21,7 @@ import {
|
|||||||
navigateToCustomizeLandingPage,
|
navigateToCustomizeLandingPage,
|
||||||
setUserDefaultPersona,
|
setUserDefaultPersona,
|
||||||
} from '../../utils/customizeLandingPage';
|
} from '../../utils/customizeLandingPage';
|
||||||
|
import { updateDescription } from '../../utils/entity';
|
||||||
|
|
||||||
const test = base;
|
const test = base;
|
||||||
|
|
||||||
@ -418,11 +419,57 @@ test.describe('Mention notifications in Notification Box', () => {
|
|||||||
adminPage,
|
adminPage,
|
||||||
user1Page,
|
user1Page,
|
||||||
}) => {
|
}) => {
|
||||||
|
test.slow();
|
||||||
|
|
||||||
await test.step(
|
await test.step(
|
||||||
'Admin user creates a conversation on an entity',
|
'Admin user creates a conversation on an entity',
|
||||||
async () => {
|
async () => {
|
||||||
await entity.visitEntityPage(adminPage);
|
await entity.visitEntityPage(adminPage);
|
||||||
|
|
||||||
|
await adminPage.waitForLoadState('networkidle');
|
||||||
|
await adminPage.waitForSelector('[data-testid="loader"]', {
|
||||||
|
state: 'detached',
|
||||||
|
});
|
||||||
|
|
||||||
|
await updateDescription(
|
||||||
|
adminPage,
|
||||||
|
'update the old description with new one'
|
||||||
|
);
|
||||||
|
|
||||||
|
await adminPage.reload();
|
||||||
|
await adminPage.waitForLoadState('networkidle');
|
||||||
|
await adminPage.waitForSelector('[data-testid="loader"]', {
|
||||||
|
state: 'detached',
|
||||||
|
});
|
||||||
|
|
||||||
|
let count = 0;
|
||||||
|
let iterations = 0;
|
||||||
|
const maxIterations = 10;
|
||||||
|
const delayMs = 5000;
|
||||||
|
|
||||||
|
while (iterations < maxIterations) {
|
||||||
|
const countElement = adminPage
|
||||||
|
.getByTestId('activity_feed')
|
||||||
|
.getByTestId('filter-count');
|
||||||
|
|
||||||
|
const countText = await countElement.textContent();
|
||||||
|
count = parseInt(countText ?? '0', 10);
|
||||||
|
|
||||||
|
if (count > 0) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
iterations++;
|
||||||
|
if (iterations < maxIterations) {
|
||||||
|
await adminPage.waitForTimeout(delayMs);
|
||||||
|
await adminPage.reload();
|
||||||
|
await adminPage.waitForLoadState('networkidle');
|
||||||
|
await adminPage.waitForSelector('[data-testid="loader"]', {
|
||||||
|
state: 'detached',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
await adminPage.getByTestId('activity_feed').click();
|
await adminPage.getByTestId('activity_feed').click();
|
||||||
await adminPage.waitForLoadState('networkidle');
|
await adminPage.waitForLoadState('networkidle');
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user