mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-10-04 05:16:47 +00:00
improve playwright test of bulk import/edit (#23538)
This commit is contained in:
parent
f528616b2f
commit
bcae472cc0
@ -15,10 +15,11 @@ import { expect, test } from '@playwright/test';
|
||||
import { RDG_ACTIVE_CELL_SELECTOR } from '../../constant/bulkImportExport';
|
||||
import { SERVICE_TYPE } from '../../constant/service';
|
||||
import { GlobalSettingOptions } from '../../constant/settings';
|
||||
import { EntityDataClass } from '../../support/entity/EntityDataClass';
|
||||
import { Domain } from '../../support/domain/Domain';
|
||||
import { TableClass } from '../../support/entity/TableClass';
|
||||
import { Glossary } from '../../support/glossary/Glossary';
|
||||
import { GlossaryTerm } from '../../support/glossary/GlossaryTerm';
|
||||
import { UserClass } from '../../support/user/UserClass';
|
||||
import {
|
||||
createNewPage,
|
||||
descriptionBoxReadOnly,
|
||||
@ -49,9 +50,16 @@ test.use({
|
||||
storageState: 'playwright/.auth/admin.json',
|
||||
});
|
||||
|
||||
const user1 = new UserClass();
|
||||
const user2 = new UserClass();
|
||||
const glossary = new Glossary();
|
||||
const glossaryTerm = new GlossaryTerm(glossary);
|
||||
const domain1 = new Domain();
|
||||
const domain2 = new Domain();
|
||||
|
||||
const glossaryDetails = {
|
||||
name: EntityDataClass.glossaryTerm1.data.name,
|
||||
parent: EntityDataClass.glossary1.data.name,
|
||||
name: glossaryTerm.data.name,
|
||||
parent: glossary.data.name,
|
||||
};
|
||||
|
||||
const databaseSchemaDetails1 = {
|
||||
@ -70,19 +78,16 @@ const columnDetails1 = {
|
||||
};
|
||||
|
||||
test.describe('Bulk Edit Entity', () => {
|
||||
test.beforeAll('setup pre-test', async ({ browser }, testInfo) => {
|
||||
test.beforeAll('setup pre-test', async ({ browser }) => {
|
||||
const { apiContext, afterAction } = await createNewPage(browser);
|
||||
|
||||
testInfo.setTimeout(90000);
|
||||
await EntityDataClass.preRequisitesForTests(apiContext);
|
||||
await afterAction();
|
||||
});
|
||||
await user1.create(apiContext);
|
||||
await user2.create(apiContext);
|
||||
await glossary.create(apiContext);
|
||||
await glossaryTerm.create(apiContext);
|
||||
await domain1.create(apiContext);
|
||||
await domain2.create(apiContext);
|
||||
|
||||
test.afterAll('Cleanup', async ({ browser }, testInfo) => {
|
||||
const { apiContext, afterAction } = await createNewPage(browser);
|
||||
|
||||
testInfo.setTimeout(90000);
|
||||
await EntityDataClass.postRequisitesForTests(apiContext);
|
||||
await afterAction();
|
||||
});
|
||||
|
||||
@ -109,7 +114,7 @@ test.describe('Bulk Edit Entity', () => {
|
||||
await test.step('Perform bulk edit action', async () => {
|
||||
const databaseDetails = {
|
||||
...createDatabaseRowDetails(),
|
||||
domains: EntityDataClass.domain1.responseData,
|
||||
domains: domain1.responseData,
|
||||
glossary: glossaryDetails,
|
||||
};
|
||||
|
||||
@ -145,8 +150,8 @@ test.describe('Bulk Edit Entity', () => {
|
||||
...databaseDetails,
|
||||
name: table.database.name,
|
||||
owners: [
|
||||
EntityDataClass.user1.responseData?.['displayName'],
|
||||
EntityDataClass.user2.responseData?.['displayName'],
|
||||
user1.responseData?.['displayName'],
|
||||
user2.responseData?.['displayName'],
|
||||
],
|
||||
retentionPeriod: undefined,
|
||||
sourceUrl: undefined,
|
||||
@ -191,10 +196,10 @@ test.describe('Bulk Edit Entity', () => {
|
||||
|
||||
// Verify Owners
|
||||
await expect(
|
||||
page.getByTestId(EntityDataClass.user1.responseData?.['displayName'])
|
||||
page.getByTestId(user1.responseData?.['displayName'])
|
||||
).toBeVisible();
|
||||
await expect(
|
||||
page.getByTestId(EntityDataClass.user2.responseData?.['displayName'])
|
||||
page.getByTestId(user2.responseData?.['displayName'])
|
||||
).toBeVisible();
|
||||
|
||||
// Verify Tags
|
||||
@ -212,7 +217,7 @@ test.describe('Bulk Edit Entity', () => {
|
||||
|
||||
await expect(
|
||||
page.getByRole('link', {
|
||||
name: EntityDataClass.glossaryTerm1.data.displayName,
|
||||
name: glossaryTerm.data.displayName,
|
||||
})
|
||||
).toBeVisible();
|
||||
});
|
||||
@ -280,10 +285,10 @@ test.describe('Bulk Edit Entity', () => {
|
||||
...databaseSchemaDetails1,
|
||||
name: table.schema.name,
|
||||
owners: [
|
||||
EntityDataClass.user1.responseData?.['displayName'],
|
||||
EntityDataClass.user2.responseData?.['displayName'],
|
||||
user1.responseData?.['displayName'],
|
||||
user2.responseData?.['displayName'],
|
||||
],
|
||||
domains: EntityDataClass.domain1.responseData,
|
||||
domains: domain1.responseData,
|
||||
},
|
||||
page,
|
||||
customPropertyRecord
|
||||
@ -327,11 +332,11 @@ test.describe('Bulk Edit Entity', () => {
|
||||
|
||||
// Verify Owners
|
||||
await expect(
|
||||
page.getByTestId(EntityDataClass.user1.responseData?.['displayName'])
|
||||
page.getByTestId(user1.responseData?.['displayName'])
|
||||
).toBeVisible();
|
||||
|
||||
await expect(
|
||||
page.getByTestId(EntityDataClass.user2.responseData?.['displayName'])
|
||||
page.getByTestId(user2.responseData?.['displayName'])
|
||||
).toBeVisible();
|
||||
|
||||
await page.getByTestId('column-display-name').click();
|
||||
@ -354,7 +359,7 @@ test.describe('Bulk Edit Entity', () => {
|
||||
|
||||
await expect(
|
||||
page.getByRole('link', {
|
||||
name: EntityDataClass.glossaryTerm1.data.displayName,
|
||||
name: glossaryTerm.data.displayName,
|
||||
})
|
||||
).toBeVisible();
|
||||
});
|
||||
@ -420,10 +425,10 @@ test.describe('Bulk Edit Entity', () => {
|
||||
...tableDetails1,
|
||||
name: table.entity.name,
|
||||
owners: [
|
||||
EntityDataClass.user1.responseData?.['displayName'],
|
||||
EntityDataClass.user2.responseData?.['displayName'],
|
||||
user1.responseData?.['displayName'],
|
||||
user2.responseData?.['displayName'],
|
||||
],
|
||||
domains: EntityDataClass.domain1.responseData,
|
||||
domains: domain1.responseData,
|
||||
},
|
||||
page,
|
||||
customPropertyRecord
|
||||
@ -464,16 +469,16 @@ test.describe('Bulk Edit Entity', () => {
|
||||
|
||||
// Verify Domain
|
||||
await expect(page.getByTestId('domain-link')).toContainText(
|
||||
EntityDataClass.domain1.responseData.displayName
|
||||
domain1.responseData.displayName
|
||||
);
|
||||
|
||||
// Verify Owners
|
||||
await expect(
|
||||
page.getByTestId(EntityDataClass.user1.responseData?.['displayName'])
|
||||
page.getByTestId(user1.responseData?.['displayName'])
|
||||
).toBeVisible();
|
||||
|
||||
await expect(
|
||||
page.getByTestId(EntityDataClass.user2.responseData?.['displayName'])
|
||||
page.getByTestId(user2.responseData?.['displayName'])
|
||||
).toBeVisible();
|
||||
|
||||
// Verify Tags
|
||||
@ -491,7 +496,7 @@ test.describe('Bulk Edit Entity', () => {
|
||||
|
||||
await expect(
|
||||
page.getByRole('link', {
|
||||
name: EntityDataClass.glossaryTerm1.data.displayName,
|
||||
name: glossaryTerm.data.displayName,
|
||||
})
|
||||
).toBeVisible();
|
||||
});
|
||||
@ -583,7 +588,7 @@ test.describe('Bulk Edit Entity', () => {
|
||||
|
||||
await expect(
|
||||
page.getByRole('link', {
|
||||
name: EntityDataClass.glossaryTerm1.data.displayName,
|
||||
name: glossaryTerm.data.displayName,
|
||||
})
|
||||
).toBeVisible();
|
||||
});
|
||||
@ -626,8 +631,8 @@ test.describe('Bulk Edit Entity', () => {
|
||||
{
|
||||
...additionalGlossaryTerm,
|
||||
name: glossaryTerm.data.name,
|
||||
owners: [EntityDataClass.user1.responseData?.['displayName']],
|
||||
reviewers: [EntityDataClass.user2.responseData?.['displayName']],
|
||||
owners: [user1.responseData?.['displayName']],
|
||||
reviewers: [user2.responseData?.['displayName']],
|
||||
relatedTerm: {
|
||||
parent: glossary.data.name,
|
||||
name: glossaryTerm.data.name,
|
||||
@ -689,12 +694,12 @@ test.describe('Bulk Edit Entity', () => {
|
||||
|
||||
// Verify Owners
|
||||
await expect(
|
||||
page.getByTestId(EntityDataClass.user1.responseData?.['displayName'])
|
||||
page.getByTestId(user1.responseData?.['displayName'])
|
||||
).toBeVisible();
|
||||
|
||||
// Verify Reviewers
|
||||
await expect(
|
||||
page.getByTestId(EntityDataClass.user2.responseData?.['displayName'])
|
||||
page.getByTestId(user2.responseData?.['displayName'])
|
||||
).toBeVisible();
|
||||
});
|
||||
|
||||
|
@ -14,11 +14,14 @@ import { expect, test } from '@playwright/test';
|
||||
|
||||
import { RDG_ACTIVE_CELL_SELECTOR } from '../../constant/bulkImportExport';
|
||||
import { GlobalSettingOptions } from '../../constant/settings';
|
||||
import { Domain } from '../../support/domain/Domain';
|
||||
import { DatabaseClass } from '../../support/entity/DatabaseClass';
|
||||
import { DatabaseSchemaClass } from '../../support/entity/DatabaseSchemaClass';
|
||||
import { EntityDataClass } from '../../support/entity/EntityDataClass';
|
||||
import { DatabaseServiceClass } from '../../support/entity/service/DatabaseServiceClass';
|
||||
import { TableClass } from '../../support/entity/TableClass';
|
||||
import { Glossary } from '../../support/glossary/Glossary';
|
||||
import { GlossaryTerm } from '../../support/glossary/GlossaryTerm';
|
||||
import { UserClass } from '../../support/user/UserClass';
|
||||
import {
|
||||
createNewPage,
|
||||
getApiContext,
|
||||
@ -53,9 +56,16 @@ test.use({
|
||||
},
|
||||
});
|
||||
|
||||
const user1 = new UserClass();
|
||||
const user2 = new UserClass();
|
||||
const glossary = new Glossary();
|
||||
const glossaryTerm = new GlossaryTerm(glossary);
|
||||
const domain1 = new Domain();
|
||||
const domain2 = new Domain();
|
||||
|
||||
const glossaryDetails = {
|
||||
name: EntityDataClass.glossaryTerm1.data.name,
|
||||
parent: EntityDataClass.glossary1.data.name,
|
||||
name: glossaryTerm.data.name,
|
||||
parent: glossary.data.name,
|
||||
};
|
||||
|
||||
const databaseDetails1 = {
|
||||
@ -104,19 +114,15 @@ const storedProcedureDetails = {
|
||||
};
|
||||
|
||||
test.describe('Bulk Import Export', () => {
|
||||
test.beforeAll('setup pre-test', async ({ browser }, testInfo) => {
|
||||
test.beforeAll('setup pre-test', async ({ browser }) => {
|
||||
const { apiContext, afterAction } = await createNewPage(browser);
|
||||
|
||||
testInfo.setTimeout(90000);
|
||||
await EntityDataClass.preRequisitesForTests(apiContext);
|
||||
await afterAction();
|
||||
});
|
||||
|
||||
test.afterAll('Cleanup', async ({ browser }, testInfo) => {
|
||||
const { apiContext, afterAction } = await createNewPage(browser);
|
||||
|
||||
testInfo.setTimeout(90000);
|
||||
await EntityDataClass.postRequisitesForTests(apiContext);
|
||||
await user1.create(apiContext);
|
||||
await user2.create(apiContext);
|
||||
await glossary.create(apiContext);
|
||||
await glossaryTerm.create(apiContext);
|
||||
await domain1.create(apiContext);
|
||||
await domain2.create(apiContext);
|
||||
await afterAction();
|
||||
});
|
||||
|
||||
@ -176,10 +182,10 @@ test.describe('Bulk Import Export', () => {
|
||||
{
|
||||
...databaseDetails1,
|
||||
owners: [
|
||||
EntityDataClass.user1.responseData?.['displayName'],
|
||||
EntityDataClass.user2.responseData?.['displayName'],
|
||||
user1.responseData?.['displayName'],
|
||||
user2.responseData?.['displayName'],
|
||||
],
|
||||
domains: EntityDataClass.domain1.responseData,
|
||||
domains: domain1.responseData,
|
||||
},
|
||||
page,
|
||||
customPropertyRecord
|
||||
@ -206,10 +212,10 @@ test.describe('Bulk Import Export', () => {
|
||||
{
|
||||
...databaseSchemaDetails1,
|
||||
owners: [
|
||||
EntityDataClass.user1.responseData?.['displayName'],
|
||||
EntityDataClass.user2.responseData?.['displayName'],
|
||||
user1.responseData?.['displayName'],
|
||||
user2.responseData?.['displayName'],
|
||||
],
|
||||
domains: EntityDataClass.domain1.responseData,
|
||||
domains: domain1.responseData,
|
||||
},
|
||||
page
|
||||
);
|
||||
@ -236,10 +242,10 @@ test.describe('Bulk Import Export', () => {
|
||||
{
|
||||
...tableDetails1,
|
||||
owners: [
|
||||
EntityDataClass.user1.responseData?.['displayName'],
|
||||
EntityDataClass.user2.responseData?.['displayName'],
|
||||
user1.responseData?.['displayName'],
|
||||
user2.responseData?.['displayName'],
|
||||
],
|
||||
domains: EntityDataClass.domain1.responseData,
|
||||
domains: domain1.responseData,
|
||||
},
|
||||
page
|
||||
);
|
||||
@ -284,10 +290,10 @@ test.describe('Bulk Import Export', () => {
|
||||
{
|
||||
...storedProcedureDetails,
|
||||
owners: [
|
||||
EntityDataClass.user1.responseData?.['displayName'],
|
||||
EntityDataClass.user2.responseData?.['displayName'],
|
||||
user1.responseData?.['displayName'],
|
||||
user2.responseData?.['displayName'],
|
||||
],
|
||||
domains: EntityDataClass.domain2.responseData,
|
||||
domains: domain2.responseData,
|
||||
},
|
||||
page
|
||||
);
|
||||
@ -317,10 +323,10 @@ test.describe('Bulk Import Export', () => {
|
||||
{
|
||||
...databaseDetails2,
|
||||
owners: [
|
||||
EntityDataClass.user1.responseData?.['displayName'],
|
||||
EntityDataClass.user2.responseData?.['displayName'],
|
||||
user1.responseData?.['displayName'],
|
||||
user2.responseData?.['displayName'],
|
||||
],
|
||||
domains: EntityDataClass.domain2.responseData,
|
||||
domains: domain2.responseData,
|
||||
},
|
||||
page
|
||||
);
|
||||
@ -426,10 +432,10 @@ test.describe('Bulk Import Export', () => {
|
||||
{
|
||||
...databaseSchemaDetails1,
|
||||
owners: [
|
||||
EntityDataClass.user1.responseData?.['displayName'],
|
||||
EntityDataClass.user2.responseData?.['displayName'],
|
||||
user1.responseData?.['displayName'],
|
||||
user2.responseData?.['displayName'],
|
||||
],
|
||||
domains: EntityDataClass.domain1.responseData,
|
||||
domains: domain1.responseData,
|
||||
},
|
||||
page,
|
||||
customPropertyRecord
|
||||
@ -457,10 +463,10 @@ test.describe('Bulk Import Export', () => {
|
||||
{
|
||||
...tableDetails1,
|
||||
owners: [
|
||||
EntityDataClass.user1.responseData?.['displayName'],
|
||||
EntityDataClass.user2.responseData?.['displayName'],
|
||||
user1.responseData?.['displayName'],
|
||||
user2.responseData?.['displayName'],
|
||||
],
|
||||
domains: EntityDataClass.domain1.responseData,
|
||||
domains: domain1.responseData,
|
||||
},
|
||||
page
|
||||
);
|
||||
@ -505,10 +511,10 @@ test.describe('Bulk Import Export', () => {
|
||||
{
|
||||
...databaseSchemaDetails2,
|
||||
owners: [
|
||||
EntityDataClass.user1.responseData?.['displayName'],
|
||||
EntityDataClass.user2.responseData?.['displayName'],
|
||||
user1.responseData?.['displayName'],
|
||||
user2.responseData?.['displayName'],
|
||||
],
|
||||
domains: EntityDataClass.domain1.responseData,
|
||||
domains: domain1.responseData,
|
||||
},
|
||||
page
|
||||
);
|
||||
@ -626,10 +632,10 @@ test.describe('Bulk Import Export', () => {
|
||||
{
|
||||
...tableDetails1,
|
||||
owners: [
|
||||
EntityDataClass.user1.responseData?.['displayName'],
|
||||
EntityDataClass.user2.responseData?.['displayName'],
|
||||
user1.responseData?.['displayName'],
|
||||
user2.responseData?.['displayName'],
|
||||
],
|
||||
domains: EntityDataClass.domain1.responseData,
|
||||
domains: domain1.responseData,
|
||||
},
|
||||
page,
|
||||
customPropertyRecord
|
||||
@ -676,10 +682,10 @@ test.describe('Bulk Import Export', () => {
|
||||
{
|
||||
...tableDetails2,
|
||||
owners: [
|
||||
EntityDataClass.user1.responseData?.['displayName'],
|
||||
EntityDataClass.user2.responseData?.['displayName'],
|
||||
user1.responseData?.['displayName'],
|
||||
user2.responseData?.['displayName'],
|
||||
],
|
||||
domains: EntityDataClass.domain1.responseData,
|
||||
domains: domain1.responseData,
|
||||
},
|
||||
page,
|
||||
customPropertyRecord
|
||||
@ -881,10 +887,10 @@ test.describe('Bulk Import Export', () => {
|
||||
{
|
||||
...databaseDetails1,
|
||||
owners: [
|
||||
EntityDataClass.user1.responseData?.['displayName'],
|
||||
EntityDataClass.user2.responseData?.['displayName'],
|
||||
user1.responseData?.['displayName'],
|
||||
user2.responseData?.['displayName'],
|
||||
],
|
||||
domains: EntityDataClass.domain1.responseData,
|
||||
domains: domain1.responseData,
|
||||
},
|
||||
page,
|
||||
undefined,
|
||||
|
Loading…
x
Reference in New Issue
Block a user