diff --git a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Lineage.spec.ts b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Lineage.spec.ts index 11f75bfb5f73..058784b928c9 100644 --- a/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Lineage.spec.ts +++ b/openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/Lineage.spec.ts @@ -10,7 +10,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import test from '@playwright/test'; +import test, { expect } from '@playwright/test'; import { get } from 'lodash'; import { ApiEndpointClass } from '../../support/entity/ApiEndpointClass'; import { ContainerClass } from '../../support/entity/ContainerClass'; @@ -280,3 +280,85 @@ test('Verify column lineage between table and api endpoint', async ({ await afterAction(); }); + +test('Verify function data in edge drawer', async ({ browser }) => { + const { page } = await createNewPage(browser); + const { apiContext, afterAction } = await getApiContext(page); + const table1 = new TableClass(); + const table2 = new TableClass(); + + try { + await table1.create(apiContext); + await table2.create(apiContext); + const sourceTableFqn = get(table1, 'entityResponseData.fullyQualifiedName'); + const sourceColName = `${sourceTableFqn}.${get( + table1, + 'entityResponseData.columns[0].name' + )}`; + + const targetTableFqn = get(table2, 'entityResponseData.fullyQualifiedName'); + const targetColName = `${targetTableFqn}.${get( + table2, + 'entityResponseData.columns[0].name' + )}`; + + await addPipelineBetweenNodes(page, table1, table2); + await activateColumnLayer(page); + await addColumnLineage(page, sourceColName, targetColName); + + const lineageReq = page.waitForResponse('/api/v1/lineage/getLineage?*'); + await page.reload(); + const lineageRes = await lineageReq; + const jsonRes = await lineageRes.json(); + const edge = jsonRes.edges[0]; + const columnData = edge.columns[0]; + + const newEdge = { + edge: { + fromEntity: { + id: edge.fromEntity.id, + type: edge.fromEntity.type, + }, + toEntity: { + id: edge.toEntity.id, + type: edge.toEntity.type, + }, + lineageDetails: { + columnsLineage: [ + { + fromColumns: [columnData.fromColumns[0]], + function: 'count', + toColumn: columnData.toColumn, + }, + ], + description: 'test', + }, + }, + }; + await apiContext.put(`/api/v1/lineage`, { + data: newEdge, + }); + const lineageReq1 = page.waitForResponse('/api/v1/lineage/getLineage?*'); + await page.reload(); + await lineageReq1; + + await activateColumnLayer(page); + await page + .locator( + `[data-testid="column-edge-${btoa(sourceColName)}-${btoa( + targetColName + )}"]` + ) + .dispatchEvent('click'); + + await page.locator('.edge-info-drawer').isVisible(); + + await expect(await page.locator('[data-testid="Function"]')).toContainText( + 'count' + ); + } finally { + await table1.delete(apiContext); + await table2.delete(apiContext); + await afterAction(); + } +});