diff --git a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/IncidentManager.spec.ts b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/IncidentManager.spec.ts index b7b5a7f38fb..4e3dbd74f1a 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/IncidentManager.spec.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/IncidentManager.spec.ts @@ -15,6 +15,7 @@ import { PLAYWRIGHT_INGESTION_TAG_OBJ } from '../../constant/config'; import { SidebarItem } from '../../constant/sidebar'; import { TableClass } from '../../support/entity/TableClass'; import { UserClass } from '../../support/user/UserClass'; +import { resetTokenFromProfilerBotPage } from '../../utils/bot'; import { createNewPage, descriptionBox, @@ -47,6 +48,9 @@ test.describe('Incident Manager', PLAYWRIGHT_INGESTION_TAG_OBJ, () => { const { afterAction, apiContext, page } = await createNewPage(browser); + // Todo: Remove this patch once the issue is fixed #19140 + await resetTokenFromProfilerBotPage(page); + for (const user of users) { await user.create(apiContext); } diff --git a/openmetadata-ui/src/main/resources/ui/playwright/support/entity/ingestion/MySqlIngestionClass.ts b/openmetadata-ui/src/main/resources/ui/playwright/support/entity/ingestion/MySqlIngestionClass.ts index d71358f6058..d4045bdc581 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/support/entity/ingestion/MySqlIngestionClass.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/support/entity/ingestion/MySqlIngestionClass.ts @@ -18,6 +18,7 @@ import { TestType, } from '@playwright/test'; import { env } from 'process'; +import { resetTokenFromProfilerBotPage } from '../../../utils/bot'; import { getApiContext, redirectToHomePage, @@ -84,6 +85,10 @@ class MysqlIngestionClass extends ServiceBaseClass { await test.step('Add Profiler ingestion', async () => { const { apiContext } = await getApiContext(page); await redirectToHomePage(page); + + // Todo: Remove this patch once the issue is fixed #19140 + await resetTokenFromProfilerBotPage(page); + await visitServiceDetailsPage( page, { diff --git a/openmetadata-ui/src/main/resources/ui/playwright/utils/bot.ts b/openmetadata-ui/src/main/resources/ui/playwright/utils/bot.ts index 3e0c01b4808..39a4a813e89 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/utils/bot.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/utils/bot.ts @@ -221,3 +221,33 @@ export const redirectToBotPage = async (page: Page) => { await settingClick(page, GlobalSettingOptions.BOTS); await fetchResponse; }; + +export const resetTokenFromProfilerBotPage = async (page: Page) => { + await settingClick(page, GlobalSettingOptions.BOTS); + + await page.getByTestId('searchbar').click(); + await page.getByTestId('searchbar').fill('profiler'); + + await expect(page.getByTestId('bot-link-ProfilerBot')).toBeVisible(); + + await page.getByTestId('bot-link-ProfilerBot').click(); + + await expect(page.getByTestId('revoke-button')).toBeVisible(); + + await page.getByTestId('revoke-button').click(); + + await expect(page.getByTestId('save-button')).toBeVisible(); + + await page.getByTestId('save-button').click(); + + await expect(page.getByTestId('token-expiry').locator('div')).toBeVisible(); + + await page.getByText('hr').click(); + await page.getByText('Unlimited days').click(); + + await expect(page.getByTestId('save-edit')).toBeVisible(); + + await page.getByTestId('save-edit').click(); + + await redirectToHomePage(page); +};