Skip to content

Commit 1305407

Browse files
committed
fix(e2e): fix flaky SearchExport filter on MySQL by normalizing sample_data displayName (#27631)
(cherry picked from commit 39e5cc0)
1 parent c65a035 commit 1305407

1 file changed

Lines changed: 24 additions & 9 deletions

File tree

openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/SearchExport.spec.ts

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@
1111
* limitations under the License.
1212
*/
1313

14-
import { expect, Page } from '@playwright/test';
15-
import { redirectToHomePage } from '../../utils/common';
14+
import { expect } from '@playwright/test';
15+
import { performAdminLogin } from '../../utils/admin';
16+
import { redirectToExplorePage } from '../../utils/common';
1617
import { waitForAllLoadersToDisappear } from '../../utils/entity';
1718
import {
1819
countCsvResponseRows,
@@ -22,15 +23,29 @@ import {
2223
} from '../../utils/explore';
2324
import { test } from '../fixtures/pages';
2425

25-
const navigateToExplorePage = async (page: Page) => {
26-
await redirectToHomePage(page);
27-
await page.getByTestId('app-bar-item-explore').click();
28-
await expect(page.getByTestId('explore-page')).toBeVisible();
29-
};
30-
3126
test.describe('Search Export', { tag: ['@Features', '@Discovery'] }, () => {
27+
test.beforeAll(async ({ browser }) => {
28+
const { apiContext, afterAction } = await performAdminLogin(browser);
29+
30+
const serviceRes = await apiContext.get(
31+
'/api/v1/services/databaseServices/name/sample_data'
32+
);
33+
const service = await serviceRes.json();
34+
if (service.displayName) {
35+
await apiContext.patch(
36+
`/api/v1/services/databaseServices/${service.id}`,
37+
{
38+
data: [{ op: 'replace', path: '/displayName', value: 'sample_data' }],
39+
headers: { 'Content-Type': 'application/json-patch+json' },
40+
}
41+
);
42+
43+
await afterAction();
44+
}
45+
});
46+
3247
test.beforeEach(async ({ page }) => {
33-
await navigateToExplorePage(page);
48+
await redirectToExplorePage(page);
3449
});
3550

3651
test('Export button opens scope modal with correct options', async ({

0 commit comments

Comments
 (0)