fix metrics test (#22781)

(cherry picked from commit 78776021678ac462524dc5699a4b5f048a087c7e)
This commit is contained in:
Shrushti Polekar 2025-08-06 20:59:54 +05:30 committed by OpenMetadata Release Bot
parent e99684dc9c
commit e2155e1b20

View File

@ -184,14 +184,24 @@ export const updateRelatedMetric = async (
state: 'visible',
});
// Wait for the metrics API call to complete
const metricsResponsePromise1 = page.waitForResponse(
'/api/v1/metrics/name/*?fields=*'
);
await page
.getByRole('link', { name: dataAsset.entity.name, exact: true })
.click();
await metricsResponsePromise1;
await page.waitForLoadState('networkidle');
await page.waitForSelector('[data-testid="loader"]', { state: 'detached' });
// Wait for the metrics API call to complete
const metricsResponsePromise2 = page.waitForResponse(
'/api/v1/metrics/name/*?fields=*'
);
await page.getByRole('link', { name: title }).click();
await metricsResponsePromise2;
};
export const addMetric = async (page: Page) => {