mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-10-10 16:25:37 +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,
|
||||
setUserDefaultPersona,
|
||||
} from '../../utils/customizeLandingPage';
|
||||
import { updateDescription } from '../../utils/entity';
|
||||
|
||||
const test = base;
|
||||
|
||||
@ -418,11 +419,57 @@ test.describe('Mention notifications in Notification Box', () => {
|
||||
adminPage,
|
||||
user1Page,
|
||||
}) => {
|
||||
test.slow();
|
||||
|
||||
await test.step(
|
||||
'Admin user creates a conversation on an entity',
|
||||
async () => {
|
||||
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.waitForLoadState('networkidle');
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user