Fix: Activity feed AUT failure and User flaky test (#21913)

* fix flaky test

* fix flaky user test

* minor fix

* minor fix for display name

* minor fix
This commit is contained in:
Shrushti Polekar 2025-06-24 22:30:08 +05:30 committed by GitHub
parent 51b12c40bb
commit b8112338f3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 23 additions and 7 deletions

View File

@ -906,7 +906,11 @@ base.describe('Activity feed with Data Consumer User', () => {
await tagsTask.click(); await tagsTask.click();
await entityPageTaskTab; await entityPageTaskTab;
expect(page2.getByText('no diff available').first()).toBeVisible(); await page2.waitForLoadState('networkidle');
await expect(
page2.getByText('no diff available').first()
).toBeVisible();
// Should see the add_close dropdown and comment button // Should see the add_close dropdown and comment button
await expect( await expect(

View File

@ -494,16 +494,28 @@ test.describe('User Profile Feed Interactions', () => {
await avatar.hover(); await avatar.hover();
await adminPage.waitForSelector('.ant-popover-card'); await adminPage.waitForSelector('.ant-popover-card');
await adminPage.getByTestId('user-name').nth(1).click();
await userDetailsResponse; // Ensure popover is stable and visible before clicking
await userFeedResponse; await adminPage.waitForTimeout(500); // Give popover time to stabilize
const response = await userDetailsResponse;
const { fullyQualifiedName } = await response.json(); // Get the user name element and ensure it's ready for interaction
const userNameElement = adminPage.getByTestId('user-name').nth(1);
// Click with force to handle pointer event interception
await userNameElement.click({ force: true });
const [response] = await Promise.all([
userDetailsResponse,
userFeedResponse,
]);
const { name, displayName } = await response.json();
// The UI shows displayName if available, otherwise falls back to name
const expectedText = displayName ?? name;
await expect( await expect(
adminPage.locator('[data-testid="user-display-name"]') adminPage.locator('[data-testid="user-display-name"]')
).toHaveText(fullyQualifiedName); ).toHaveText(expectedText);
}); });
test('Close the profile dropdown after redirecting to user profile page', async ({ test('Close the profile dropdown after redirecting to user profile page', async ({