mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-31 12:39:01 +00:00
playwright: reset the profiler bot token in AUT (#19156)
* playwright: reset the profiler bot token in AUT * addressing comment
This commit is contained in:
parent
06d71f9450
commit
f87b0662fa
@ -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);
|
||||
}
|
||||
|
@ -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,
|
||||
{
|
||||
|
@ -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);
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user