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