mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2026-01-06 04:26:57 +00:00
added playwright test for nested columns suggestions (#22378)
* supported playwright test for nested columns suggestions * added test code around it
This commit is contained in:
parent
a53b294d5f
commit
118cde6a60
@ -550,8 +550,8 @@ test.describe('Bulk Edit Entity', () => {
|
||||
await page.click('[type="button"] >> text="Next"', { force: true });
|
||||
|
||||
await validateImportStatus(page, {
|
||||
passed: '7',
|
||||
processed: '7',
|
||||
passed: '9',
|
||||
processed: '9',
|
||||
failed: '0',
|
||||
});
|
||||
|
||||
|
||||
@ -867,8 +867,8 @@ test.describe('Bulk Import Export', () => {
|
||||
await page.getByRole('button', { name: 'Next' }).click();
|
||||
|
||||
await validateImportStatus(page, {
|
||||
passed: '9',
|
||||
processed: '9',
|
||||
passed: '11',
|
||||
processed: '11',
|
||||
failed: '0',
|
||||
});
|
||||
|
||||
@ -881,6 +881,8 @@ test.describe('Bulk Import Export', () => {
|
||||
'Entity updated',
|
||||
'Entity updated',
|
||||
'Entity updated',
|
||||
'Entity updated',
|
||||
'Entity updated',
|
||||
];
|
||||
|
||||
await expect(page.locator('.rdg-cell-details')).toHaveText(rowStatus);
|
||||
|
||||
@ -88,7 +88,7 @@ test.describe('Description Suggestions Table Entity', () => {
|
||||
// All Column Suggestions Card should be visible
|
||||
await expect(
|
||||
page.getByTestId('suggested-SuggestDescription-card')
|
||||
).toHaveCount(6);
|
||||
).toHaveCount(8);
|
||||
|
||||
// Close the suggestions
|
||||
await page.getByTestId('close-suggestion').click();
|
||||
@ -116,7 +116,13 @@ test.describe('Description Suggestions Table Entity', () => {
|
||||
|
||||
await singleResolveResponse;
|
||||
|
||||
await expect(page.locator('.ant-badge [title="5"]')).toBeVisible();
|
||||
await page.reload();
|
||||
await page.waitForLoadState('networkidle');
|
||||
await page.waitForSelector('[data-testid="loader"]', {
|
||||
state: 'detached',
|
||||
});
|
||||
|
||||
await expect(page.locator('.ant-badge [title="7"]')).toBeVisible();
|
||||
|
||||
await expect(
|
||||
page.locator(
|
||||
@ -125,6 +131,43 @@ test.describe('Description Suggestions Table Entity', () => {
|
||||
).toContainText('this is suggested data description');
|
||||
});
|
||||
|
||||
await test.step('Accept Nested Suggestion', async () => {
|
||||
const allAvatarSuggestion = page
|
||||
.getByTestId('asset-description-container')
|
||||
.getByTestId('profile-avatar');
|
||||
|
||||
// Click the first avatar
|
||||
await allAvatarSuggestion.nth(0).click();
|
||||
|
||||
const singleResolveResponse = page.waitForResponse(
|
||||
'/api/v1/suggestions/*/accept'
|
||||
);
|
||||
|
||||
await page
|
||||
.locator(
|
||||
`[data-row-key*=${table.columnsName[5]}] [data-testid="accept-suggestion"]`
|
||||
)
|
||||
.click();
|
||||
|
||||
await singleResolveResponse;
|
||||
|
||||
await page.reload();
|
||||
await page.waitForLoadState('networkidle');
|
||||
await page.waitForSelector('[data-testid="loader"]', {
|
||||
state: 'detached',
|
||||
});
|
||||
|
||||
await expect(page.locator('.ant-badge .ant-badge-count')).toContainText(
|
||||
'6'
|
||||
);
|
||||
|
||||
await expect(
|
||||
page.locator(
|
||||
`[data-row-key*=${table.columnsName[5]}] [data-testid="description"]`
|
||||
)
|
||||
).toContainText('this is suggested data description');
|
||||
});
|
||||
|
||||
await test.step('Reject Single Suggestion', async () => {
|
||||
const allAvatarSuggestion = page
|
||||
.getByTestId('asset-description-container')
|
||||
@ -145,7 +188,7 @@ test.describe('Description Suggestions Table Entity', () => {
|
||||
|
||||
await singleResolveResponse;
|
||||
|
||||
await expect(page.locator('.ant-badge [title="4"]')).toBeVisible();
|
||||
await expect(page.locator('.ant-badge [title="5"]')).toBeVisible();
|
||||
|
||||
await expect(
|
||||
page.locator(
|
||||
|
||||
@ -84,7 +84,7 @@ test.describe('Tags Suggestions Table Entity', () => {
|
||||
// All Column Suggestions Card should be visible
|
||||
await expect(
|
||||
page.getByTestId('suggested-SuggestTagLabel-card')
|
||||
).toHaveCount(6);
|
||||
).toHaveCount(8);
|
||||
|
||||
// Close the suggestions
|
||||
await page.getByTestId('close-suggestion').click();
|
||||
|
||||
@ -60,6 +60,8 @@ export class TableClass extends EntityClass {
|
||||
`name${uuid()}`,
|
||||
`first_name${uuid()}`,
|
||||
`last_name${uuid()}`,
|
||||
`address${uuid()}`,
|
||||
`mail${uuid()}`,
|
||||
`email${uuid()}`,
|
||||
];
|
||||
entityLinkColumnsName = [
|
||||
@ -68,7 +70,9 @@ export class TableClass extends EntityClass {
|
||||
this.columnsName[2],
|
||||
`${this.columnsName[2]}.${this.columnsName[3]}`,
|
||||
`${this.columnsName[2]}.${this.columnsName[4]}`,
|
||||
this.columnsName[5],
|
||||
`${this.columnsName[2]}.${this.columnsName[4]}.${this.columnsName[5]}`,
|
||||
`${this.columnsName[2]}.${this.columnsName[4]}.${this.columnsName[6]}`,
|
||||
this.columnsName[7],
|
||||
];
|
||||
|
||||
children = [
|
||||
@ -106,11 +110,27 @@ export class TableClass extends EntityClass {
|
||||
dataType: 'ARRAY',
|
||||
dataLength: 100,
|
||||
dataTypeDisplay: 'array<struct<type:string,provider:array<int>>>',
|
||||
children: [
|
||||
{
|
||||
name: this.columnsName[5],
|
||||
dataType: 'STRUCT',
|
||||
dataLength: 100,
|
||||
dataTypeDisplay:
|
||||
'struct<username:varchar(32),name:varchar(32),sex:char(1),address:varchar(128),mail:varchar(64),birthdate:varchar(16)>',
|
||||
description: 'First name of the staff member.',
|
||||
},
|
||||
{
|
||||
name: this.columnsName[6],
|
||||
dataType: 'ARRAY',
|
||||
dataLength: 100,
|
||||
dataTypeDisplay: 'array<struct<type:string,provider:array<int>>>',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: this.columnsName[5],
|
||||
name: this.columnsName[7],
|
||||
dataType: 'VARCHAR',
|
||||
dataLength: 100,
|
||||
dataTypeDisplay: 'varchar',
|
||||
|
||||
@ -52,7 +52,7 @@ export const validateViewPermissions = async (
|
||||
|
||||
await expect(
|
||||
page.locator('[data-testid="edit-displayName-button"]')
|
||||
).toHaveCount(permission?.editDisplayName ? 6 : 0);
|
||||
).toHaveCount(permission?.editDisplayName ? 8 : 0);
|
||||
|
||||
// check edit owner permission
|
||||
await expect(page.locator('[data-testid="edit-owner"]')).not.toBeVisible();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user