mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-10-11 00:35:22 +00:00
PLAYWRIGHT: Unskip Classification and SchemaTable playwright test (#22799)
* unskip the schema table test * unskip classification playwright test (cherry picked from commit 3cd9ae913b51996a1a48ccc669d05f94daca0411)
This commit is contained in:
parent
4dc2e77bbc
commit
db5258f359
@ -104,29 +104,27 @@ const crudColumnDisplayName = async (
|
||||
);
|
||||
};
|
||||
|
||||
// will update this tests separately
|
||||
test.fixme(
|
||||
'schema table test',
|
||||
async ({ dataStewardPage, ownerPage, page }) => {
|
||||
const pages = [dataStewardPage, page, ownerPage];
|
||||
const tableUrl =
|
||||
'/table/sample_data.ecommerce_db.shopify.performance_test_table';
|
||||
const columnFqn =
|
||||
'sample_data.ecommerce_db.shopify.performance_test_table.test_col_2000';
|
||||
const columnName = 'test_col_2000';
|
||||
test('schema table test', async ({ dataStewardPage, ownerPage, page }) => {
|
||||
test.slow();
|
||||
|
||||
for (const currentPage of pages) {
|
||||
await currentPage.goto(tableUrl);
|
||||
await currentPage.waitForLoadState('networkidle');
|
||||
await crudColumnDisplayName(
|
||||
currentPage,
|
||||
columnFqn,
|
||||
columnName,
|
||||
'data-row-key'
|
||||
);
|
||||
}
|
||||
const pages = [dataStewardPage, page, ownerPage];
|
||||
const tableUrl =
|
||||
'/table/sample_data.ecommerce_db.shopify.performance_test_table';
|
||||
const columnFqn =
|
||||
'sample_data.ecommerce_db.shopify.performance_test_table.test_col_2000';
|
||||
const columnName = 'test_col_2000';
|
||||
|
||||
for (const currentPage of pages) {
|
||||
await currentPage.goto(tableUrl);
|
||||
await currentPage.waitForLoadState('networkidle');
|
||||
await crudColumnDisplayName(
|
||||
currentPage,
|
||||
columnFqn,
|
||||
columnName,
|
||||
'data-row-key'
|
||||
);
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
test('Schema Table Pagination should work Properly', async ({ page }) => {
|
||||
const tableResponse = page.waitForResponse(`/api/v1/tables?limit=15**`);
|
||||
|
@ -101,7 +101,7 @@ test.beforeEach(async ({ page }) => {
|
||||
await redirectToHomePage(page);
|
||||
});
|
||||
|
||||
test.fixme('Classification Page', async ({ page }) => {
|
||||
test('Classification Page', async ({ page }) => {
|
||||
test.slow();
|
||||
|
||||
await test.step('Should render basic elements on page', async () => {
|
||||
@ -140,13 +140,9 @@ test.fixme('Classification Page', async ({ page }) => {
|
||||
|
||||
await page.click('[data-testid="manage-button"]');
|
||||
|
||||
const fetchTags = page.waitForResponse(
|
||||
`/api/v1/tags?fields=usageCount&parent=${classification.responseData.name}*`
|
||||
);
|
||||
const disabledTag = page.waitForResponse('/api/v1/classifications/*');
|
||||
await page.click('[data-testid="enable-disable-title"]');
|
||||
await disabledTag;
|
||||
await fetchTags;
|
||||
|
||||
await expect(
|
||||
page.locator(
|
||||
@ -158,10 +154,6 @@ test.fixme('Classification Page', async ({ page }) => {
|
||||
page.locator('[data-testid="add-new-tag-button"]')
|
||||
).toBeDisabled();
|
||||
|
||||
await expect(
|
||||
page.locator('[data-testid="no-data-placeholder"]')
|
||||
).toBeVisible();
|
||||
|
||||
// Check if the disabled Classification tag is not visible in the table
|
||||
await table.visitEntityPage(page);
|
||||
|
||||
@ -290,24 +282,15 @@ test.fixme('Classification Page', async ({ page }) => {
|
||||
});
|
||||
|
||||
await test.step('Verify classification term count', async () => {
|
||||
// Navigate back to classifications list
|
||||
await sidebarClick(page, SidebarItem.TAGS);
|
||||
|
||||
// Wait for classifications to load with termCount field
|
||||
const classificationsResponse = page.waitForResponse(
|
||||
(response) =>
|
||||
response.url().includes('/api/v1/classifications') &&
|
||||
response.url().includes('fields=termCount')
|
||||
);
|
||||
await classificationsResponse;
|
||||
|
||||
// Find the classification in the left panel and verify term count
|
||||
const classificationElement = page
|
||||
.locator(`[data-testid="side-panel-classification"]`)
|
||||
.filter({ hasText: NEW_CLASSIFICATION.displayName });
|
||||
|
||||
// Check if term count is displayed as (1) since we created one tag
|
||||
await expect(classificationElement).toContainText('(1)');
|
||||
await expect(classificationElement).toContainText(
|
||||
`${NEW_CLASSIFICATION.displayName}1`
|
||||
);
|
||||
|
||||
// Click on the classification to verify
|
||||
await classificationElement.click();
|
||||
@ -326,7 +309,6 @@ test.fixme('Classification Page', async ({ page }) => {
|
||||
tagName: name,
|
||||
tagFqn,
|
||||
tagDisplayName: displayName,
|
||||
tableId: table.entityResponseData?.['id'],
|
||||
columnNumber: 0,
|
||||
rowName: `${table.entity?.columns[0].name} numeric`,
|
||||
});
|
||||
@ -454,15 +436,11 @@ test.fixme('Classification Page', async ({ page }) => {
|
||||
);
|
||||
|
||||
// Verify term count is now 0 after deleting the tag
|
||||
await sidebarClick(page, SidebarItem.TAGS);
|
||||
|
||||
// Wait for classifications to reload with updated termCount
|
||||
const classificationsResponse = page.waitForResponse(
|
||||
(response) =>
|
||||
response.url().includes('/api/v1/classifications') &&
|
||||
response.url().includes('fields=termCount')
|
||||
);
|
||||
await classificationsResponse;
|
||||
await page.reload();
|
||||
await page.waitForLoadState('networkidle');
|
||||
await page.waitForSelector('[data-testid="side-panel-classification"]', {
|
||||
state: 'visible',
|
||||
});
|
||||
|
||||
// Find the classification and verify term count is 0
|
||||
const classificationElement = page
|
||||
@ -470,7 +448,9 @@ test.fixme('Classification Page', async ({ page }) => {
|
||||
.filter({ hasText: NEW_CLASSIFICATION.displayName });
|
||||
|
||||
// Check if term count is displayed as (0) since we deleted the tag
|
||||
await expect(classificationElement).toContainText('(0)');
|
||||
await expect(classificationElement).toContainText(
|
||||
`${NEW_CLASSIFICATION.displayName}0`
|
||||
);
|
||||
});
|
||||
|
||||
await test.step('Remove classification', async () => {
|
||||
@ -493,7 +473,6 @@ test.fixme('Classification Page', async ({ page }) => {
|
||||
await page.click('[data-testid="confirm-button"]');
|
||||
await deleteClassification;
|
||||
|
||||
await user1.visitPage(page);
|
||||
await page.waitForLoadState('networkidle');
|
||||
|
||||
await expect(
|
||||
@ -560,7 +539,9 @@ test('Verify system classification term counts', async ({ page }) => {
|
||||
response.url().includes('fields=termCount')
|
||||
);
|
||||
|
||||
const getTags = page.waitForResponse('/api/v1/tags*');
|
||||
await sidebarClick(page, SidebarItem.TAGS);
|
||||
await getTags;
|
||||
|
||||
await classificationsResponse;
|
||||
|
||||
|
@ -1299,11 +1299,19 @@ export const updateDisplayNameForEntityChildren = async (
|
||||
await page.click('[data-testid="save-button"]');
|
||||
await updateRequest;
|
||||
|
||||
await expect(
|
||||
page
|
||||
.locator(`[${rowSelector}="${rowId}"]`)
|
||||
.getByTestId('column-display-name')
|
||||
).toHaveText(displayName.newDisplayName);
|
||||
if (displayName.newDisplayName === '') {
|
||||
await expect(
|
||||
page
|
||||
.locator(`[${rowSelector}="${rowId}"]`)
|
||||
.getByTestId('column-display-name')
|
||||
).not.toBeAttached();
|
||||
} else {
|
||||
await expect(
|
||||
page
|
||||
.locator(`[${rowSelector}="${rowId}"]`)
|
||||
.getByTestId('column-display-name')
|
||||
).toHaveText(displayName.newDisplayName);
|
||||
}
|
||||
};
|
||||
|
||||
export const removeDisplayNameForEntityChildren = async (
|
||||
|
@ -282,14 +282,12 @@ export const addTagToTableColumn = async (
|
||||
tagName,
|
||||
tagFqn,
|
||||
tagDisplayName,
|
||||
tableId,
|
||||
columnNumber,
|
||||
rowName,
|
||||
}: {
|
||||
tagName: string;
|
||||
tagFqn: string;
|
||||
tagDisplayName: string;
|
||||
tableId: string;
|
||||
columnNumber: number;
|
||||
rowName: string;
|
||||
}
|
||||
@ -304,11 +302,7 @@ export const addTagToTableColumn = async (
|
||||
page.locator('[data-testid="tag-selector"] > .ant-select-selector')
|
||||
).toContainText(tagDisplayName);
|
||||
|
||||
const saveAssociatedTag = page.waitForResponse(
|
||||
(response) =>
|
||||
response.request().method() === 'PATCH' &&
|
||||
response.url().includes(`/api/v1/tables/${tableId}`)
|
||||
);
|
||||
const saveAssociatedTag = page.waitForResponse(`/api/v1/columns/name/**`);
|
||||
await page.click('[data-testid="saveAssociatedTag"]');
|
||||
await saveAssociatedTag;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user