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:
Ashish Gupta 2025-08-07 10:53:24 +05:30 committed by OpenMetadata Release Bot
parent 4dc2e77bbc
commit db5258f359
4 changed files with 47 additions and 66 deletions

View File

@ -104,29 +104,27 @@ const crudColumnDisplayName = async (
); );
}; };
// will update this tests separately test('schema table test', async ({ dataStewardPage, ownerPage, page }) => {
test.fixme( test.slow();
'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';
for (const currentPage of pages) { const pages = [dataStewardPage, page, ownerPage];
await currentPage.goto(tableUrl); const tableUrl =
await currentPage.waitForLoadState('networkidle'); '/table/sample_data.ecommerce_db.shopify.performance_test_table';
await crudColumnDisplayName( const columnFqn =
currentPage, 'sample_data.ecommerce_db.shopify.performance_test_table.test_col_2000';
columnFqn, const columnName = 'test_col_2000';
columnName,
'data-row-key' 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 }) => { test('Schema Table Pagination should work Properly', async ({ page }) => {
const tableResponse = page.waitForResponse(`/api/v1/tables?limit=15**`); const tableResponse = page.waitForResponse(`/api/v1/tables?limit=15**`);

View File

@ -101,7 +101,7 @@ test.beforeEach(async ({ page }) => {
await redirectToHomePage(page); await redirectToHomePage(page);
}); });
test.fixme('Classification Page', async ({ page }) => { test('Classification Page', async ({ page }) => {
test.slow(); test.slow();
await test.step('Should render basic elements on page', async () => { 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"]'); 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/*'); const disabledTag = page.waitForResponse('/api/v1/classifications/*');
await page.click('[data-testid="enable-disable-title"]'); await page.click('[data-testid="enable-disable-title"]');
await disabledTag; await disabledTag;
await fetchTags;
await expect( await expect(
page.locator( page.locator(
@ -158,10 +154,6 @@ test.fixme('Classification Page', async ({ page }) => {
page.locator('[data-testid="add-new-tag-button"]') page.locator('[data-testid="add-new-tag-button"]')
).toBeDisabled(); ).toBeDisabled();
await expect(
page.locator('[data-testid="no-data-placeholder"]')
).toBeVisible();
// Check if the disabled Classification tag is not visible in the table // Check if the disabled Classification tag is not visible in the table
await table.visitEntityPage(page); await table.visitEntityPage(page);
@ -290,24 +282,15 @@ test.fixme('Classification Page', async ({ page }) => {
}); });
await test.step('Verify classification term count', async () => { 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 // Find the classification in the left panel and verify term count
const classificationElement = page const classificationElement = page
.locator(`[data-testid="side-panel-classification"]`) .locator(`[data-testid="side-panel-classification"]`)
.filter({ hasText: NEW_CLASSIFICATION.displayName }); .filter({ hasText: NEW_CLASSIFICATION.displayName });
// Check if term count is displayed as (1) since we created one tag // 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 // Click on the classification to verify
await classificationElement.click(); await classificationElement.click();
@ -326,7 +309,6 @@ test.fixme('Classification Page', async ({ page }) => {
tagName: name, tagName: name,
tagFqn, tagFqn,
tagDisplayName: displayName, tagDisplayName: displayName,
tableId: table.entityResponseData?.['id'],
columnNumber: 0, columnNumber: 0,
rowName: `${table.entity?.columns[0].name} numeric`, 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 // Verify term count is now 0 after deleting the tag
await sidebarClick(page, SidebarItem.TAGS); await page.reload();
await page.waitForLoadState('networkidle');
// Wait for classifications to reload with updated termCount await page.waitForSelector('[data-testid="side-panel-classification"]', {
const classificationsResponse = page.waitForResponse( state: 'visible',
(response) => });
response.url().includes('/api/v1/classifications') &&
response.url().includes('fields=termCount')
);
await classificationsResponse;
// Find the classification and verify term count is 0 // Find the classification and verify term count is 0
const classificationElement = page const classificationElement = page
@ -470,7 +448,9 @@ test.fixme('Classification Page', async ({ page }) => {
.filter({ hasText: NEW_CLASSIFICATION.displayName }); .filter({ hasText: NEW_CLASSIFICATION.displayName });
// Check if term count is displayed as (0) since we deleted the tag // 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 () => { await test.step('Remove classification', async () => {
@ -493,7 +473,6 @@ test.fixme('Classification Page', async ({ page }) => {
await page.click('[data-testid="confirm-button"]'); await page.click('[data-testid="confirm-button"]');
await deleteClassification; await deleteClassification;
await user1.visitPage(page);
await page.waitForLoadState('networkidle'); await page.waitForLoadState('networkidle');
await expect( await expect(
@ -560,7 +539,9 @@ test('Verify system classification term counts', async ({ page }) => {
response.url().includes('fields=termCount') response.url().includes('fields=termCount')
); );
const getTags = page.waitForResponse('/api/v1/tags*');
await sidebarClick(page, SidebarItem.TAGS); await sidebarClick(page, SidebarItem.TAGS);
await getTags;
await classificationsResponse; await classificationsResponse;

View File

@ -1299,11 +1299,19 @@ export const updateDisplayNameForEntityChildren = async (
await page.click('[data-testid="save-button"]'); await page.click('[data-testid="save-button"]');
await updateRequest; await updateRequest;
await expect( if (displayName.newDisplayName === '') {
page await expect(
.locator(`[${rowSelector}="${rowId}"]`) page
.getByTestId('column-display-name') .locator(`[${rowSelector}="${rowId}"]`)
).toHaveText(displayName.newDisplayName); .getByTestId('column-display-name')
).not.toBeAttached();
} else {
await expect(
page
.locator(`[${rowSelector}="${rowId}"]`)
.getByTestId('column-display-name')
).toHaveText(displayName.newDisplayName);
}
}; };
export const removeDisplayNameForEntityChildren = async ( export const removeDisplayNameForEntityChildren = async (

View File

@ -282,14 +282,12 @@ export const addTagToTableColumn = async (
tagName, tagName,
tagFqn, tagFqn,
tagDisplayName, tagDisplayName,
tableId,
columnNumber, columnNumber,
rowName, rowName,
}: { }: {
tagName: string; tagName: string;
tagFqn: string; tagFqn: string;
tagDisplayName: string; tagDisplayName: string;
tableId: string;
columnNumber: number; columnNumber: number;
rowName: string; rowName: string;
} }
@ -304,11 +302,7 @@ export const addTagToTableColumn = async (
page.locator('[data-testid="tag-selector"] > .ant-select-selector') page.locator('[data-testid="tag-selector"] > .ant-select-selector')
).toContainText(tagDisplayName); ).toContainText(tagDisplayName);
const saveAssociatedTag = page.waitForResponse( const saveAssociatedTag = page.waitForResponse(`/api/v1/columns/name/**`);
(response) =>
response.request().method() === 'PATCH' &&
response.url().includes(`/api/v1/tables/${tableId}`)
);
await page.click('[data-testid="saveAssociatedTag"]'); await page.click('[data-testid="saveAssociatedTag"]');
await saveAssociatedTag; await saveAssociatedTag;