mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-06-27 04:22:05 +00:00
Fix(uI) : Flaky Tag Add, Update and remove for child entity (#21861)
* fixed flaky follow and Tag for Child entity * removed lastrun * removed lastrun * removed config file
This commit is contained in:
parent
1439081caa
commit
7035c9e107
@ -318,6 +318,8 @@ entities.forEach((EntityClass) => {
|
||||
test('Tag Add, Update and Remove for child entities', async ({
|
||||
page,
|
||||
}) => {
|
||||
test.slow(true);
|
||||
|
||||
await page.getByTestId(entity.childrenTabId ?? '').click();
|
||||
|
||||
await entity.tagChildren({
|
||||
@ -326,6 +328,7 @@ entities.forEach((EntityClass) => {
|
||||
tag2: 'PII.None',
|
||||
rowId: entity.childrenSelectorId ?? '',
|
||||
rowSelector,
|
||||
entityEndpoint: entity.endpoint,
|
||||
});
|
||||
});
|
||||
}
|
||||
@ -343,6 +346,7 @@ entities.forEach((EntityClass) => {
|
||||
glossaryTerm2: EntityDataClass.glossaryTerm2.responseData,
|
||||
rowId: entity.childrenSelectorId ?? '',
|
||||
rowSelector,
|
||||
entityEndpoint: entity.endpoint,
|
||||
});
|
||||
});
|
||||
|
||||
@ -368,7 +372,8 @@ entities.forEach((EntityClass) => {
|
||||
await entity.descriptionUpdateChildren(
|
||||
page,
|
||||
entity.childrenSelectorId ?? '',
|
||||
rowSelector
|
||||
rowSelector,
|
||||
entity.endpoint
|
||||
);
|
||||
});
|
||||
}
|
||||
|
@ -136,6 +136,7 @@ entities.forEach((EntityClass) => {
|
||||
tag2: 'PII.None',
|
||||
rowId: entity.childrenSelectorId ?? '',
|
||||
rowSelector,
|
||||
entityEndpoint: entity.endpoint,
|
||||
});
|
||||
});
|
||||
|
||||
@ -161,7 +162,8 @@ entities.forEach((EntityClass) => {
|
||||
await entity.descriptionUpdateChildren(
|
||||
page,
|
||||
entity.childrenSelectorId ?? '',
|
||||
rowSelector
|
||||
rowSelector,
|
||||
entity.endpoint
|
||||
);
|
||||
});
|
||||
}
|
||||
@ -178,6 +180,7 @@ entities.forEach((EntityClass) => {
|
||||
glossaryTerm1: EntityDataClass.glossaryTerm1.responseData,
|
||||
glossaryTerm2: EntityDataClass.glossaryTerm2.responseData,
|
||||
rowId: entity.childrenSelectorId ?? '',
|
||||
entityEndpoint: entity.endpoint,
|
||||
rowSelector:
|
||||
entity.type === 'MlModel' ? 'data-testid' : 'data-row-key',
|
||||
});
|
||||
@ -190,6 +193,8 @@ entities.forEach((EntityClass) => {
|
||||
});
|
||||
|
||||
test(`Follow & Un-follow entity`, async ({ page }) => {
|
||||
test.slow(true);
|
||||
|
||||
const entityName = entity.entityResponseData?.['displayName'];
|
||||
await entity.followUnfollowEntity(page, entityName);
|
||||
});
|
||||
|
@ -151,6 +151,7 @@ entities.forEach((EntityClass) => {
|
||||
tag2: 'PII.None',
|
||||
rowId: entity.childrenSelectorId ?? '',
|
||||
rowSelector,
|
||||
entityEndpoint: entity.endpoint,
|
||||
});
|
||||
});
|
||||
}
|
||||
@ -168,6 +169,7 @@ entities.forEach((EntityClass) => {
|
||||
glossaryTerm2: EntityDataClass.glossaryTerm2.responseData,
|
||||
rowId: entity.childrenSelectorId ?? '',
|
||||
rowSelector,
|
||||
entityEndpoint: entity.endpoint,
|
||||
});
|
||||
});
|
||||
|
||||
@ -193,7 +195,8 @@ entities.forEach((EntityClass) => {
|
||||
await entity.descriptionUpdateChildren(
|
||||
page,
|
||||
entity.childrenSelectorId ?? '',
|
||||
rowSelector
|
||||
rowSelector,
|
||||
entity.endpoint
|
||||
);
|
||||
});
|
||||
}
|
||||
@ -204,6 +207,8 @@ entities.forEach((EntityClass) => {
|
||||
});
|
||||
|
||||
test(`Follow & Un-follow entity`, async ({ page }) => {
|
||||
test.slow(true);
|
||||
|
||||
const entityName = entity.entityResponseData?.['displayName'];
|
||||
await entity.followUnfollowEntity(page, entityName);
|
||||
});
|
||||
|
@ -192,6 +192,8 @@ entities.forEach((EntityClass) => {
|
||||
test(`Follow & Un-follow entity for Database Entity`, async ({
|
||||
page,
|
||||
}) => {
|
||||
test.slow(true);
|
||||
|
||||
const entityName = entity.entityResponseData?.['displayName'];
|
||||
await entity.followUnfollowEntity(page, entityName);
|
||||
});
|
||||
|
@ -270,7 +270,8 @@ export class EntityClass {
|
||||
async descriptionUpdateChildren(
|
||||
page: Page,
|
||||
rowId: string,
|
||||
rowSelector: string
|
||||
rowSelector: string,
|
||||
entityEndpoint: string
|
||||
) {
|
||||
const description =
|
||||
// eslint-disable-next-line max-len
|
||||
@ -280,9 +281,9 @@ export class EntityClass {
|
||||
await updateDescriptionForChildren(
|
||||
page,
|
||||
description,
|
||||
|
||||
rowId,
|
||||
rowSelector
|
||||
rowSelector,
|
||||
entityEndpoint
|
||||
);
|
||||
|
||||
// Update description
|
||||
@ -291,11 +292,18 @@ export class EntityClass {
|
||||
description + ' updated',
|
||||
|
||||
rowId,
|
||||
rowSelector
|
||||
rowSelector,
|
||||
entityEndpoint
|
||||
);
|
||||
|
||||
// Remove description
|
||||
await updateDescriptionForChildren(page, '', rowId, rowSelector);
|
||||
await updateDescriptionForChildren(
|
||||
page,
|
||||
'',
|
||||
rowId,
|
||||
rowSelector,
|
||||
entityEndpoint
|
||||
);
|
||||
}
|
||||
|
||||
async tag(
|
||||
@ -336,32 +344,43 @@ export class EntityClass {
|
||||
tag2,
|
||||
rowId,
|
||||
rowSelector = 'data-row-key',
|
||||
entityEndpoint,
|
||||
}: {
|
||||
page: Page;
|
||||
tag1: string;
|
||||
tag2: string;
|
||||
rowId: string;
|
||||
rowSelector?: string;
|
||||
entityEndpoint: string;
|
||||
}) {
|
||||
await assignTagToChildren({ page, tag: tag1, rowId, rowSelector });
|
||||
await assignTagToChildren({
|
||||
page,
|
||||
tag: tag1,
|
||||
rowId,
|
||||
rowSelector,
|
||||
entityEndpoint,
|
||||
});
|
||||
await assignTagToChildren({
|
||||
page,
|
||||
tag: tag2,
|
||||
rowId,
|
||||
rowSelector,
|
||||
action: 'Edit',
|
||||
entityEndpoint,
|
||||
});
|
||||
await removeTagsFromChildren({
|
||||
page,
|
||||
tags: [tag2],
|
||||
rowId,
|
||||
rowSelector,
|
||||
entityEndpoint,
|
||||
});
|
||||
await removeTagsFromChildren({
|
||||
page,
|
||||
tags: [tag1],
|
||||
rowId,
|
||||
rowSelector,
|
||||
entityEndpoint,
|
||||
});
|
||||
|
||||
await page
|
||||
@ -402,6 +421,7 @@ export class EntityClass {
|
||||
glossaryTerm1,
|
||||
glossaryTerm2,
|
||||
rowId,
|
||||
entityEndpoint,
|
||||
rowSelector = 'data-row-key',
|
||||
}: {
|
||||
page: Page;
|
||||
@ -409,24 +429,29 @@ export class EntityClass {
|
||||
glossaryTerm2: GlossaryTerm['responseData'];
|
||||
rowId: string;
|
||||
rowSelector?: string;
|
||||
entityEndpoint: string;
|
||||
}) {
|
||||
await assignGlossaryTermToChildren({
|
||||
page,
|
||||
glossaryTerm: glossaryTerm1,
|
||||
action: 'Add',
|
||||
rowId,
|
||||
rowSelector,
|
||||
entityEndpoint,
|
||||
});
|
||||
await assignGlossaryTermToChildren({
|
||||
page,
|
||||
glossaryTerm: glossaryTerm2,
|
||||
action: 'Edit',
|
||||
rowId,
|
||||
rowSelector,
|
||||
action: 'Edit',
|
||||
entityEndpoint,
|
||||
});
|
||||
await removeGlossaryTermFromChildren({
|
||||
page,
|
||||
glossaryTerms: [glossaryTerm1, glossaryTerm2],
|
||||
rowId,
|
||||
entityEndpoint,
|
||||
rowSelector,
|
||||
});
|
||||
|
||||
|
@ -409,7 +409,8 @@ export const updateDescriptionForChildren = async (
|
||||
page: Page,
|
||||
description: string,
|
||||
rowId: string,
|
||||
rowSelector: string
|
||||
rowSelector: string,
|
||||
entityEndpoint: string
|
||||
) => {
|
||||
await page
|
||||
.locator(`[${rowSelector}="${rowId}"]`)
|
||||
@ -421,9 +422,15 @@ export const updateDescriptionForChildren = async (
|
||||
await page.locator(descriptionBox).first().click();
|
||||
await page.locator(descriptionBox).first().clear();
|
||||
await page.locator(descriptionBox).first().fill(description);
|
||||
const updateRequest = page.waitForResponse((req) =>
|
||||
['PATCH', 'PUT'].includes(req.request().method())
|
||||
);
|
||||
let updateRequest;
|
||||
if (
|
||||
entityEndpoint === 'tables' ||
|
||||
entityEndpoint === 'dashboard/datamodels'
|
||||
) {
|
||||
updateRequest = page.waitForResponse('/api/v1/columns/name/*');
|
||||
} else {
|
||||
updateRequest = page.waitForResponse(`/api/v1/${entityEndpoint}/*`);
|
||||
}
|
||||
await page.getByTestId('save').click();
|
||||
await updateRequest;
|
||||
|
||||
@ -486,12 +493,14 @@ export const assignTagToChildren = async ({
|
||||
rowId,
|
||||
action = 'Add',
|
||||
rowSelector = 'data-row-key',
|
||||
entityEndpoint,
|
||||
}: {
|
||||
page: Page;
|
||||
tag: string;
|
||||
rowId: string;
|
||||
action?: 'Add' | 'Edit';
|
||||
rowSelector?: string;
|
||||
entityEndpoint: string;
|
||||
}) => {
|
||||
await page
|
||||
.locator(`[${rowSelector}="${rowId}"]`)
|
||||
@ -508,10 +517,15 @@ export const assignTagToChildren = async ({
|
||||
await searchTags;
|
||||
|
||||
await page.getByTestId(`tag-${tag}`).click();
|
||||
|
||||
const putRequest = page.waitForResponse(
|
||||
(response) => response.request().method() === 'PUT'
|
||||
);
|
||||
let patchRequest;
|
||||
if (
|
||||
entityEndpoint === 'tables' ||
|
||||
entityEndpoint === 'dashboard/datamodels'
|
||||
) {
|
||||
patchRequest = page.waitForResponse('/api/v1/columns/name/*');
|
||||
} else {
|
||||
patchRequest = page.waitForResponse(`/api/v1/${entityEndpoint}/*`);
|
||||
}
|
||||
|
||||
await page.waitForSelector(
|
||||
'.ant-select-dropdown [data-testid="saveAssociatedTag"]',
|
||||
@ -522,7 +536,7 @@ export const assignTagToChildren = async ({
|
||||
|
||||
await page.getByTestId('saveAssociatedTag').click();
|
||||
|
||||
await putRequest;
|
||||
await patchRequest;
|
||||
|
||||
await expect(
|
||||
page
|
||||
@ -574,11 +588,13 @@ export const removeTagsFromChildren = async ({
|
||||
rowId,
|
||||
tags,
|
||||
rowSelector = 'data-row-key',
|
||||
entityEndpoint,
|
||||
}: {
|
||||
page: Page;
|
||||
tags: string[];
|
||||
rowId: string;
|
||||
rowSelector?: string;
|
||||
entityEndpoint: string;
|
||||
}) => {
|
||||
for (const tag of tags) {
|
||||
await page
|
||||
@ -593,10 +609,15 @@ export const removeTagsFromChildren = async ({
|
||||
.getByTestId('remove-tags')
|
||||
.click();
|
||||
|
||||
const putTagRequest = page.waitForResponse((response) =>
|
||||
['PUT', 'PATCH'].includes(response.request().method())
|
||||
);
|
||||
|
||||
let patchRequest;
|
||||
if (
|
||||
entityEndpoint === 'tables' ||
|
||||
entityEndpoint === 'dashboard/datamodels'
|
||||
) {
|
||||
patchRequest = page.waitForResponse('/api/v1/columns/name/*');
|
||||
} else {
|
||||
patchRequest = page.waitForResponse(`/api/v1/${entityEndpoint}/*`);
|
||||
}
|
||||
await page.waitForSelector(
|
||||
'.ant-select-dropdown [data-testid="saveAssociatedTag"]',
|
||||
{ state: 'visible' }
|
||||
@ -606,7 +627,7 @@ export const removeTagsFromChildren = async ({
|
||||
|
||||
await page.getByTestId('saveAssociatedTag').click();
|
||||
|
||||
await putTagRequest;
|
||||
await patchRequest;
|
||||
|
||||
await expect(
|
||||
page
|
||||
@ -667,12 +688,14 @@ export const assignGlossaryTermToChildren = async ({
|
||||
action = 'Add',
|
||||
rowId,
|
||||
rowSelector = 'data-row-key',
|
||||
entityEndpoint,
|
||||
}: {
|
||||
page: Page;
|
||||
glossaryTerm: GlossaryTermOption;
|
||||
rowId: string;
|
||||
action?: 'Add' | 'Edit';
|
||||
rowSelector?: string;
|
||||
entityEndpoint: string;
|
||||
}) => {
|
||||
await page
|
||||
.locator(`[${rowSelector}="${rowId}"]`)
|
||||
@ -696,9 +719,20 @@ export const assignGlossaryTermToChildren = async ({
|
||||
{ state: 'visible' }
|
||||
);
|
||||
|
||||
let patchRequest;
|
||||
if (
|
||||
entityEndpoint === 'tables' ||
|
||||
entityEndpoint === 'dashboard/datamodels'
|
||||
) {
|
||||
patchRequest = page.waitForResponse('/api/v1/columns/name/*');
|
||||
} else {
|
||||
patchRequest = page.waitForResponse(`/api/v1/${entityEndpoint}/*`);
|
||||
}
|
||||
|
||||
await expect(page.getByTestId('saveAssociatedTag')).toBeEnabled();
|
||||
|
||||
await page.getByTestId('saveAssociatedTag').click();
|
||||
await patchRequest;
|
||||
|
||||
await expect(page.getByTestId('saveAssociatedTag')).not.toBeVisible();
|
||||
|
||||
@ -757,11 +791,13 @@ export const removeGlossaryTermFromChildren = async ({
|
||||
page,
|
||||
glossaryTerms,
|
||||
rowId,
|
||||
entityEndpoint,
|
||||
rowSelector = 'data-row-key',
|
||||
}: {
|
||||
page: Page;
|
||||
glossaryTerms: GlossaryTermOption[];
|
||||
rowId: string;
|
||||
entityEndpoint: string;
|
||||
rowSelector?: string;
|
||||
}) => {
|
||||
for (const tag of glossaryTerms) {
|
||||
@ -778,9 +814,15 @@ export const removeGlossaryTermFromChildren = async ({
|
||||
.locator('svg')
|
||||
.click();
|
||||
|
||||
const putRequest = page.waitForResponse((response) =>
|
||||
['PUT', 'PATCH'].includes(response.request().method())
|
||||
);
|
||||
let patchRequest;
|
||||
if (
|
||||
entityEndpoint === 'tables' ||
|
||||
entityEndpoint === 'dashboard/datamodels'
|
||||
) {
|
||||
patchRequest = page.waitForResponse('/api/v1/columns/name/*');
|
||||
} else {
|
||||
patchRequest = page.waitForResponse(`/api/v1/${entityEndpoint}/*`);
|
||||
}
|
||||
|
||||
await page.waitForSelector(
|
||||
'.ant-select-dropdown [data-testid="saveAssociatedTag"]',
|
||||
@ -791,7 +833,7 @@ export const removeGlossaryTermFromChildren = async ({
|
||||
|
||||
await page.getByTestId('saveAssociatedTag').click();
|
||||
|
||||
await putRequest;
|
||||
await patchRequest;
|
||||
|
||||
expect(
|
||||
page
|
||||
|
Loading…
x
Reference in New Issue
Block a user