diff --git a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/SearchExport.spec.ts b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/SearchExport.spec.ts index 05f122531dc4..45e506dc79b1 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/SearchExport.spec.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/SearchExport.spec.ts @@ -11,8 +11,9 @@ * limitations under the License. */ -import { expect, Page } from '@playwright/test'; -import { redirectToHomePage } from '../../utils/common'; +import { expect } from '@playwright/test'; +import { performAdminLogin } from '../../utils/admin'; +import { redirectToExplorePage } from '../../utils/common'; import { waitForAllLoadersToDisappear } from '../../utils/entity'; import { countCsvResponseRows, @@ -22,15 +23,29 @@ import { } from '../../utils/explore'; import { test } from '../fixtures/pages'; -const navigateToExplorePage = async (page: Page) => { - await redirectToHomePage(page); - await page.getByTestId('app-bar-item-explore').click(); - await expect(page.getByTestId('explore-page')).toBeVisible(); -}; - test.describe('Search Export', { tag: ['@Features', '@Discovery'] }, () => { + test.beforeAll(async ({ browser }) => { + const { apiContext, afterAction } = await performAdminLogin(browser); + + const serviceRes = await apiContext.get( + '/api/v1/services/databaseServices/name/sample_data' + ); + const service = await serviceRes.json(); + if (service.displayName) { + await apiContext.patch( + `/api/v1/services/databaseServices/${service.id}`, + { + data: [{ op: 'replace', path: '/displayName', value: 'sample_data' }], + headers: { 'Content-Type': 'application/json-patch+json' }, + } + ); + + await afterAction(); + } + }); + test.beforeEach(async ({ page }) => { - await navigateToExplorePage(page); + await redirectToExplorePage(page); }); test('Export button opens scope modal with correct options', async ({