mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-22 16:08:13 +00:00
Playwright: fixed AUT failure of main (#20453)
* Playwright: fixed AUT failure of main * Remove Advanced search tests for entityType field * Improve searchIndex application spec * Add slow test flag for entity version page and remove unused entityType field from advanced search * replace heading click with clickoutside function * conditional allowed --------- Co-authored-by: Aniket Katkar <aniketkatkar97@gmail.com>
This commit is contained in:
parent
df4510ceba
commit
11af2b44eb
@ -233,7 +233,6 @@ test.describe('Advanced Search', { tag: '@advanced-search' }, () => {
|
||||
],
|
||||
status: ['Approved', 'In Review'],
|
||||
tableType: [table.entity.tableType, 'MaterializedView'],
|
||||
entityType: ['dashboard', 'mlmodel'],
|
||||
'charts.displayName.keyword': [
|
||||
EntityDataClass.dashboard1.charts.displayName,
|
||||
EntityDataClass.dashboard2.charts.displayName,
|
||||
|
@ -49,11 +49,10 @@ 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 resetTokenFromBotPage(page, {
|
||||
name: 'testsuite',
|
||||
testId: 'bot-link-TestSuiteBot',
|
||||
});
|
||||
if (!process.env.PLAYWRIGHT_IS_OSS) {
|
||||
// Todo: Remove this patch once the issue is fixed #19140
|
||||
await resetTokenFromBotPage(page, 'testsuite-bot');
|
||||
}
|
||||
|
||||
for (const user of users) {
|
||||
await user.create(apiContext);
|
||||
|
@ -185,9 +185,9 @@ test.describe('Ingestion Bot ', () => {
|
||||
});
|
||||
|
||||
// check if service has domain or not
|
||||
await expect(ingestionBotPage.getByTestId('domain-link')).toHaveText(
|
||||
domain1.data.displayName
|
||||
);
|
||||
await expect(
|
||||
ingestionBotPage.getByTestId('domain-link').first()
|
||||
).toHaveText(domain1.data.displayName);
|
||||
}
|
||||
);
|
||||
|
||||
|
@ -215,8 +215,6 @@ test('Verify column lineage between table and topic', async ({ browser }) => {
|
||||
'entityResponseData.service.fullyQualifiedName'
|
||||
);
|
||||
|
||||
const tableServiceName = get(table, 'entityResponseData.service.name');
|
||||
|
||||
const topicServiceFqn = get(
|
||||
topic,
|
||||
'entityResponseData.service.fullyQualifiedName'
|
||||
@ -355,6 +353,8 @@ test('Verify column lineage between table and api endpoint', async ({
|
||||
});
|
||||
|
||||
test('Verify function data in edge drawer', async ({ browser }) => {
|
||||
test.slow();
|
||||
|
||||
const { page } = await createNewPage(browser);
|
||||
const { apiContext, afterAction } = await getApiContext(page);
|
||||
const table1 = new TableClass();
|
||||
@ -414,6 +414,8 @@ test('Verify function data in edge drawer', async ({ browser }) => {
|
||||
await page.reload();
|
||||
await lineageReq1;
|
||||
|
||||
await page.waitForLoadState('networkidle');
|
||||
|
||||
await activateColumnLayer(page);
|
||||
await page
|
||||
.locator(
|
||||
|
@ -10,7 +10,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { expect, Page, test as base } from '@playwright/test';
|
||||
import { test as base, expect, Page } from '@playwright/test';
|
||||
import {
|
||||
PROFILER_EMPTY_RESPONSE_CONFIG,
|
||||
PROFILER_REQUEST_CONFIG,
|
||||
@ -19,7 +19,11 @@ import { SidebarItem } from '../../constant/sidebar';
|
||||
import { AdminClass } from '../../support/user/AdminClass';
|
||||
import { UserClass } from '../../support/user/UserClass';
|
||||
import { performAdminLogin } from '../../utils/admin';
|
||||
import { redirectToHomePage, toastNotification } from '../../utils/common';
|
||||
import {
|
||||
clickOutside,
|
||||
redirectToHomePage,
|
||||
toastNotification,
|
||||
} from '../../utils/common';
|
||||
import { sidebarClick } from '../../utils/sidebar';
|
||||
|
||||
const user = new UserClass();
|
||||
@ -80,7 +84,7 @@ test.describe('Profiler Configuration Page', () => {
|
||||
await adminPage.click('#metricConfiguration_0_metrics');
|
||||
await adminPage.fill('#metricConfiguration_0_metrics', 'All');
|
||||
await adminPage.getByRole('tree').getByText('All').click();
|
||||
await adminPage.getByTestId('heading').click();
|
||||
await clickOutside(adminPage);
|
||||
|
||||
await adminPage.click('[data-testid="add-fields"]');
|
||||
await adminPage.click('#metricConfiguration_1_dataType');
|
||||
@ -95,7 +99,7 @@ test.describe('Profiler Configuration Page', () => {
|
||||
await adminPage.fill('#metricConfiguration_1_metrics', 'column');
|
||||
await adminPage.click(`[title="Column Count"]:has(:visible)`);
|
||||
await adminPage.click(`[title="Column Names"]:has(:visible)`);
|
||||
await adminPage.getByTestId('heading').click();
|
||||
await clickOutside(adminPage);
|
||||
|
||||
await adminPage.click('[data-testid="add-fields"]');
|
||||
await adminPage.click('#metricConfiguration_2_dataType');
|
||||
@ -111,7 +115,7 @@ test.describe('Profiler Configuration Page', () => {
|
||||
await adminPage.click('#metricConfiguration_2_metrics');
|
||||
await adminPage.fill('#metricConfiguration_2_metrics', 'All');
|
||||
await adminPage.getByRole('tree').getByText('All').click();
|
||||
await adminPage.getByTestId('heading').click();
|
||||
await clickOutside(adminPage);
|
||||
|
||||
await adminPage.click('#metricConfiguration_2_disabled');
|
||||
|
||||
|
@ -200,16 +200,21 @@ test('Search Index Application', async ({ page }) => {
|
||||
await expect(page.locator('[data-testid="cron-type"]')).not.toBeVisible();
|
||||
|
||||
const installApplicationResponse = page.waitForResponse('api/v1/apps');
|
||||
const getApplications = page.waitForRequest(
|
||||
(request) =>
|
||||
request.url().includes('/api/v1/apps?limit') &&
|
||||
request.method() === 'GET'
|
||||
);
|
||||
await page.click('[data-testid="deploy-button"]');
|
||||
await installApplicationResponse;
|
||||
|
||||
await toastNotification(page, 'Application installed successfully');
|
||||
|
||||
const card = page.locator(
|
||||
'[data-testid="search-indexing-application-card"]'
|
||||
);
|
||||
await getApplications;
|
||||
|
||||
expect(await card.isVisible()).toBe(true);
|
||||
await expect(
|
||||
page.getByTestId('search-indexing-application-card')
|
||||
).toBeVisible();
|
||||
});
|
||||
|
||||
if (process.env.PLAYWRIGHT_IS_OSS) {
|
||||
|
@ -127,6 +127,8 @@ test.describe('Entity Version pages', () => {
|
||||
|
||||
entities.forEach((entity) => {
|
||||
test(`${entity.getType()}`, async ({ page }) => {
|
||||
test.slow();
|
||||
|
||||
await entity.visitEntityPage(page);
|
||||
const versionDetailResponse = page.waitForResponse(`**/versions/0.2`);
|
||||
await page.locator('[data-testid="version-button"]').click();
|
||||
|
@ -86,12 +86,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 resetTokenFromBotPage(page, {
|
||||
name: 'profiler',
|
||||
testId: 'bot-link-ProfilerBot',
|
||||
});
|
||||
if (!process.env.PLAYWRIGHT_IS_OSS) {
|
||||
// Todo: Remove this patch once the issue is fixed #19140
|
||||
await resetTokenFromBotPage(page, 'profiler-bot');
|
||||
}
|
||||
|
||||
await visitServiceDetailsPage(
|
||||
page,
|
||||
|
@ -119,11 +119,6 @@ export const FIELDS: EntityFields[] = [
|
||||
name: 'tableType',
|
||||
localSearch: false,
|
||||
},
|
||||
{
|
||||
id: 'Entity Type',
|
||||
name: 'entityType',
|
||||
localSearch: false,
|
||||
},
|
||||
{
|
||||
id: 'Chart',
|
||||
name: 'charts.displayName.keyword',
|
||||
|
@ -22,7 +22,7 @@ import { customFormatDateTime, getEpochMillisForFutureDays } from './dateTime';
|
||||
import { settingClick } from './sidebar';
|
||||
import { revokeToken } from './user';
|
||||
|
||||
const botName = `pw%bot-test-${uuid()}`;
|
||||
const botName = `a-bot-pw%test-${uuid()}`;
|
||||
|
||||
const BOT_DETAILS = {
|
||||
botName: botName,
|
||||
@ -75,7 +75,7 @@ export const createBot = async (page: Page) => {
|
||||
|
||||
// Verify bot is getting added in the bots listing page
|
||||
await expect(
|
||||
page.getByRole('cell', { name: BOT_DETAILS.botName })
|
||||
page.getByTestId(`bot-link-${BOT_DETAILS.botName}`)
|
||||
).toBeVisible();
|
||||
|
||||
await expect(
|
||||
@ -222,21 +222,10 @@ export const redirectToBotPage = async (page: Page) => {
|
||||
await fetchResponse;
|
||||
};
|
||||
|
||||
export const resetTokenFromBotPage = async (
|
||||
page: Page,
|
||||
bot: {
|
||||
name: string;
|
||||
testId: string;
|
||||
}
|
||||
) => {
|
||||
const settingClickResponse = page.waitForResponse('api/v1/bots?*');
|
||||
await settingClick(page, GlobalSettingOptions.BOTS);
|
||||
await settingClickResponse;
|
||||
|
||||
await page.getByTestId('searchbar').click();
|
||||
await page.getByTestId('searchbar').fill(bot.name);
|
||||
|
||||
await page.getByTestId(bot.testId).click();
|
||||
export const resetTokenFromBotPage = async (page: Page, botName: string) => {
|
||||
await page.goto(`/bots/${botName}`);
|
||||
await page.waitForLoadState('networkidle');
|
||||
await page.waitForSelector('[data-testid="loader"]', { state: 'detached' });
|
||||
|
||||
await expect(page.getByTestId('revoke-button')).toBeVisible();
|
||||
|
||||
|
@ -503,6 +503,7 @@ export const visitLineageTab = async (page: Page) => {
|
||||
const lineageRes = page.waitForResponse('/api/v1/lineage/getLineage?*');
|
||||
await page.click('[data-testid="lineage"]');
|
||||
await lineageRes;
|
||||
await page.waitForLoadState('networkidle');
|
||||
};
|
||||
|
||||
export const fillLineageConfigForm = async (
|
||||
|
Loading…
x
Reference in New Issue
Block a user