mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-22 16:08:13 +00:00
fix tier and tag playwright for Entity.spec (#21633)
* fix playwright * fix tier playwright * fix tier tests * fix tests * fix tag test * refactor code for fqn * minor fix for Glossary.spec --------- Co-authored-by: Pranita Fulsundar <pfulsundar8@gmail.com>
This commit is contained in:
parent
f30eff4dc5
commit
4df290de60
@ -210,7 +210,8 @@ entities.forEach((EntityClass) => {
|
||||
await entity.tier(
|
||||
page,
|
||||
'Tier1',
|
||||
EntityDataClass.tierTag1.data.displayName,
|
||||
EntityDataClass.tierTag1.responseData.displayName,
|
||||
EntityDataClass.tierTag1.responseData.fullyQualifiedName,
|
||||
entity
|
||||
);
|
||||
});
|
||||
@ -232,7 +233,13 @@ entities.forEach((EntityClass) => {
|
||||
test('Tag Add, Update and Remove', async ({ page }) => {
|
||||
test.slow(true);
|
||||
|
||||
await entity.tag(page, 'PersonalData.Personal', 'PII.None', entity);
|
||||
await entity.tag(
|
||||
page,
|
||||
'PersonalData.Personal',
|
||||
EntityDataClass.tag1.responseData.displayName,
|
||||
EntityDataClass.tag1.responseData.fullyQualifiedName,
|
||||
entity
|
||||
);
|
||||
});
|
||||
|
||||
test('Glossary Term Add, Update and Remove', async ({ page }) => {
|
||||
|
@ -279,7 +279,13 @@ test.describe('Glossary tests', () => {
|
||||
type: 'Users',
|
||||
});
|
||||
|
||||
await assignTag(page, 'PersonalData.Personal', 'Add', 'tabs');
|
||||
await assignTag(
|
||||
page,
|
||||
'PersonalData.Personal',
|
||||
'Add',
|
||||
undefined,
|
||||
'tabs'
|
||||
);
|
||||
});
|
||||
|
||||
await test.step('Update Glossary Term', async () => {
|
||||
|
@ -203,18 +203,24 @@ export class EntityClass {
|
||||
}
|
||||
}
|
||||
|
||||
async tier(page: Page, tier1: string, tier2: string, entity?: EntityClass) {
|
||||
async tier(
|
||||
page: Page,
|
||||
tier1: string,
|
||||
tier2: string,
|
||||
tier2Fqn?: string,
|
||||
entity?: EntityClass
|
||||
) {
|
||||
await assignTier(page, tier1, this.endpoint);
|
||||
if (entity) {
|
||||
await assignTier(page, tier2, this.endpoint);
|
||||
if (entity && tier2Fqn) {
|
||||
await checkExploreSearchFilter(
|
||||
page,
|
||||
'Tier',
|
||||
'tier.tagFQN',
|
||||
`Tier.${tier1}`,
|
||||
tier2Fqn,
|
||||
entity
|
||||
);
|
||||
}
|
||||
await assignTier(page, tier2, this.endpoint);
|
||||
await removeTier(page, this.endpoint);
|
||||
}
|
||||
|
||||
@ -226,13 +232,29 @@ export class EntityClass {
|
||||
await updateDescription(page, description);
|
||||
}
|
||||
|
||||
async tag(page: Page, tag1: string, tag2: string, entity?: EntityClass) {
|
||||
async tag(
|
||||
page: Page,
|
||||
tag1: string,
|
||||
tag2: string,
|
||||
tag2Fqn?: string,
|
||||
entity?: EntityClass
|
||||
) {
|
||||
await assignTag(page, tag1);
|
||||
if (entity) {
|
||||
await checkExploreSearchFilter(page, 'Tag', 'tags.tagFQN', tag1, entity);
|
||||
await assignTag(page, tag2, 'Edit', tag2Fqn);
|
||||
if (entity && tag2Fqn) {
|
||||
await checkExploreSearchFilter(
|
||||
page,
|
||||
'Tag',
|
||||
'tags.tagFQN',
|
||||
tag2Fqn,
|
||||
entity
|
||||
);
|
||||
}
|
||||
if (tag2Fqn) {
|
||||
await removeTag(page, [tag2Fqn]);
|
||||
} else {
|
||||
await removeTag(page, [tag2]);
|
||||
}
|
||||
await assignTag(page, tag2, 'Edit');
|
||||
await removeTag(page, [tag2]);
|
||||
await removeTag(page, [tag1]);
|
||||
|
||||
await page
|
||||
|
@ -15,6 +15,7 @@ import { DataProduct } from '../domain/DataProduct';
|
||||
import { Domain } from '../domain/Domain';
|
||||
import { Glossary } from '../glossary/Glossary';
|
||||
import { GlossaryTerm } from '../glossary/GlossaryTerm';
|
||||
import { ClassificationClass } from '../tag/ClassificationClass';
|
||||
import { TagClass } from '../tag/TagClass';
|
||||
import { TeamClass } from '../team/TeamClass';
|
||||
import { UserClass } from '../user/UserClass';
|
||||
@ -55,6 +56,13 @@ export class EntityDataClass {
|
||||
static readonly team2 = new TeamClass();
|
||||
static readonly tierTag1 = new TagClass({ classification: 'Tier' });
|
||||
static readonly tierTag2 = new TagClass({ classification: 'Tier' });
|
||||
static readonly classification1 = new ClassificationClass({
|
||||
provider: 'system',
|
||||
mutuallyExclusive: true,
|
||||
});
|
||||
static readonly tag1 = new TagClass({
|
||||
classification: this.classification1.data.name,
|
||||
});
|
||||
static readonly table1 = new TableClass();
|
||||
static readonly table2 = new TableClass(undefined, 'MaterializedView');
|
||||
static readonly topic1 = new TopicClass();
|
||||
@ -112,6 +120,7 @@ export class EntityDataClass {
|
||||
this.team2.create(apiContext),
|
||||
this.tierTag1.create(apiContext),
|
||||
this.tierTag2.create(apiContext),
|
||||
this.classification1.create(apiContext),
|
||||
]
|
||||
: [];
|
||||
|
||||
@ -199,6 +208,7 @@ export class EntityDataClass {
|
||||
this.dataProduct1.create(apiContext),
|
||||
this.dataProduct2.create(apiContext),
|
||||
this.dataProduct3.create(apiContext),
|
||||
this.tag1.create(apiContext),
|
||||
]);
|
||||
}
|
||||
}
|
||||
@ -224,6 +234,8 @@ export class EntityDataClass {
|
||||
this.team2.delete(apiContext),
|
||||
this.tierTag1.delete(apiContext),
|
||||
this.tierTag2.delete(apiContext),
|
||||
this.classification1.delete(apiContext),
|
||||
this.tag1.delete(apiContext),
|
||||
this.dataProduct1.delete(apiContext),
|
||||
this.dataProduct2.delete(apiContext),
|
||||
this.dataProduct3.delete(apiContext),
|
||||
|
@ -375,6 +375,7 @@ export const assignTag = async (
|
||||
page: Page,
|
||||
tag: string,
|
||||
action: 'Add' | 'Edit' = 'Add',
|
||||
tagFqn?: string,
|
||||
parentId = 'KnowledgePanel.Tags'
|
||||
) => {
|
||||
await page
|
||||
@ -388,7 +389,7 @@ export const assignTag = async (
|
||||
);
|
||||
await page.locator('#tagsForm_tags').fill(tag);
|
||||
await searchTags;
|
||||
await page.getByTestId(`tag-${tag}`).click();
|
||||
await page.getByTestId(`tag-${tagFqn ? `${tagFqn}` : tag}`).click();
|
||||
|
||||
await page.waitForSelector(
|
||||
'.ant-select-dropdown [data-testid="saveAssociatedTag"]',
|
||||
@ -405,7 +406,7 @@ export const assignTag = async (
|
||||
page
|
||||
.getByTestId(parentId)
|
||||
.getByTestId('tags-container')
|
||||
.getByTestId(`tag-${tag}`)
|
||||
.getByTestId(`tag-${tagFqn ? `${tagFqn}` : tag}`)
|
||||
).toBeVisible();
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user