chore(ui): fix the flaky test around metric spec (#23181)

* fix the flaky test around metric and customize landing

* reverted the customize test

* reverted the unwanted changes
This commit is contained in:
Ashish Gupta 2025-09-03 12:19:27 +05:30 committed by GitHub
parent 04a3639e47
commit 9aa194d877
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -186,22 +186,38 @@ export const updateRelatedMetric = async (
// Wait for the metrics API call to complete // Wait for the metrics API call to complete
const metricsResponsePromise1 = page.waitForResponse( const metricsResponsePromise1 = page.waitForResponse(
'/api/v1/metrics/name/*?fields=*' `/api/v1/metrics/name/${dataAsset.entity.name}?fields=*`
); );
await page await page
.getByRole('link', { name: dataAsset.entity.name, exact: true }) .getByRole('button', { name: dataAsset.entity.name, exact: true })
.click(); .click();
await metricsResponsePromise1; await metricsResponsePromise1;
await page.waitForLoadState('networkidle'); await page.waitForLoadState('networkidle');
await page.waitForSelector('[data-testid="loader"]', { state: 'detached' }); await page.waitForSelector('[data-testid="loader"]', { state: 'detached' });
await expect(page.getByTestId('entity-header-display-name')).toContainText(
dataAsset.entity.name
);
// Adding manual wait for,right panel to be in place
await page.waitForTimeout(1000);
// Wait for the metrics API call to complete // Wait for the metrics API call to complete
const metricsResponsePromise2 = page.waitForResponse( const metricsResponsePromise2 = page.waitForResponse(
'/api/v1/metrics/name/*?fields=*' `/api/v1/metrics/name/${title}?fields=*`
); );
await page.getByRole('link', { name: title }).click(); await page.getByRole('button', { name: title, exact: true }).click();
await metricsResponsePromise2; await metricsResponsePromise2;
await page.waitForLoadState('networkidle');
await page.waitForSelector('[data-testid="loader"]', { state: 'detached' });
await expect(page.getByTestId('entity-header-display-name')).toContainText(
title
);
}; };
export const addMetric = async (page: Page) => { export const addMetric = async (page: Page) => {