Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix lineage playwright #17889

Merged
merged 12 commits into from
Sep 30, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import {
connectEdgeBetweenNodes,
deleteEdge,
deleteNode,
editLineage,
performZoomOut,
removeColumnLineage,
setupEntitiesForLineage,
Expand All @@ -52,6 +53,7 @@ const entities = [
MlModelClass,
ContainerClass,
SearchIndexClass,
ApiEndpointClass,
MetricClass,
] as const;

Expand All @@ -72,68 +74,66 @@ test.afterAll('Cleanup', async ({ browser }) => {
for (const EntityClass of entities) {
const defaultEntity = new EntityClass();

test.fixme(
`Lineage creation from ${defaultEntity.getType()} entity`,
async ({ browser }) => {
test.slow(true);

const { page } = await createNewPage(browser);
const { currentEntity, entities, cleanup } =
await setupEntitiesForLineage(page, defaultEntity);

await test.step('Should create lineage for the entity', async () => {
await redirectToHomePage(page);
await currentEntity.visitEntityPage(page);
await visitLineageTab(page);
await verifyColumnLayerInactive(page);
await page.click('[data-testid="edit-lineage"]');
await performZoomOut(page);
for (const entity of entities) {
await connectEdgeBetweenNodes(page, currentEntity, entity);
}

await redirectToHomePage(page);
await currentEntity.visitEntityPage(page);
await visitLineageTab(page);
await page
.locator('.react-flow__controls-fitview')
.dispatchEvent('click');

for (const entity of entities) {
await verifyNodePresent(page, entity);
}
});

await test.step('Should create pipeline between entities', async () => {
await page.click('[data-testid="edit-lineage"]');
await performZoomOut(page);

for (const entity of entities) {
await applyPipelineFromModal(page, currentEntity, entity, pipeline);
}
});

await test.step(
'Remove lineage between nodes for the entity',
async () => {
await redirectToHomePage(page);
await currentEntity.visitEntityPage(page);
await visitLineageTab(page);
await page.click('[data-testid="edit-lineage"]');
await performZoomOut(page);

for (const entity of entities) {
await deleteEdge(page, currentEntity, entity);
}
}
);

await cleanup();
}
);
test(`Lineage creation from ${defaultEntity.getType()} entity`, async ({
browser,
}) => {
test.slow(true);

const { page } = await createNewPage(browser);
const { currentEntity, entities, cleanup } = await setupEntitiesForLineage(
page,
defaultEntity
);

await test.step('Should create lineage for the entity', async () => {
await redirectToHomePage(page);
await currentEntity.visitEntityPage(page);
await visitLineageTab(page);
await verifyColumnLayerInactive(page);
await editLineage(page);
await performZoomOut(page);
for (const entity of entities) {
await connectEdgeBetweenNodes(page, currentEntity, entity);
}

await redirectToHomePage(page);
await currentEntity.visitEntityPage(page);
await visitLineageTab(page);
await page
.locator('.react-flow__controls-fitview')
.dispatchEvent('click');

for (const entity of entities) {
await verifyNodePresent(page, entity);
}
});

await test.step('Should create pipeline between entities', async () => {
await editLineage(page);
await performZoomOut(page);

for (const entity of entities) {
await applyPipelineFromModal(page, currentEntity, entity, pipeline);
}
});

await test.step('Remove lineage between nodes for the entity', async () => {
await redirectToHomePage(page);
await currentEntity.visitEntityPage(page);
await visitLineageTab(page);
await editLineage(page);
await performZoomOut(page);

for (const entity of entities) {
await deleteEdge(page, currentEntity, entity);
}
});

await cleanup();
});
}

test.fixme('Verify column lineage between tables', async ({ browser }) => {
test('Verify column lineage between tables', async ({ browser }) => {
const { page } = await createNewPage(browser);
const { apiContext, afterAction } = await getApiContext(page);
const table1 = new TableClass();
Expand Down Expand Up @@ -171,117 +171,112 @@ test.fixme('Verify column lineage between tables', async ({ browser }) => {
await afterAction();
});

test.fixme(
'Verify column lineage between table and topic',
async ({ browser }) => {
const { page } = await createNewPage(browser);
const { apiContext, afterAction } = await getApiContext(page);
const table = new TableClass();
const topic = new TopicClass();
await table.create(apiContext);
await topic.create(apiContext);

const sourceTableFqn = get(table, 'entityResponseData.fullyQualifiedName');
const sourceCol = `${sourceTableFqn}.${get(
table,
'entityResponseData.columns[0].name'
)}`;
const targetCol = get(
topic,
'entityResponseData.messageSchema.schemaFields[0].children[0].fullyQualifiedName'
);
test('Verify column lineage between table and topic', async ({ browser }) => {
const { page } = await createNewPage(browser);
const { apiContext, afterAction } = await getApiContext(page);
const table = new TableClass();
const topic = new TopicClass();
await table.create(apiContext);
await topic.create(apiContext);

await addPipelineBetweenNodes(page, table, topic);
await activateColumnLayer(page);
const sourceTableFqn = get(table, 'entityResponseData.fullyQualifiedName');
const sourceCol = `${sourceTableFqn}.${get(
table,
'entityResponseData.columns[0].name'
)}`;
const targetCol = get(
topic,
'entityResponseData.messageSchema.schemaFields[0].children[0].fullyQualifiedName'
);

// Add column lineage
await addColumnLineage(page, sourceCol, targetCol);
await page.click('[data-testid="edit-lineage"]');
await addPipelineBetweenNodes(page, table, topic);
await activateColumnLayer(page);

await removeColumnLineage(page, sourceCol, targetCol);
await page.click('[data-testid="edit-lineage"]');
// Add column lineage
await addColumnLineage(page, sourceCol, targetCol);
await page.click('[data-testid="edit-lineage"]');

await deleteNode(page, topic);
await table.delete(apiContext);
await topic.delete(apiContext);
await removeColumnLineage(page, sourceCol, targetCol);
await page.click('[data-testid="edit-lineage"]');

await afterAction();
}
);
await deleteNode(page, topic);
await table.delete(apiContext);
await topic.delete(apiContext);

test.fixme(
'Verify column lineage between topic and api endpoint',
async ({ browser }) => {
const { page } = await createNewPage(browser);
const { apiContext, afterAction } = await getApiContext(page);
const topic = new TopicClass();
const apiEndpoint = new ApiEndpointClass();
await afterAction();
});

await topic.create(apiContext);
await apiEndpoint.create(apiContext);
test('Verify column lineage between topic and api endpoint', async ({
browser,
}) => {
const { page } = await createNewPage(browser);
const { apiContext, afterAction } = await getApiContext(page);
const topic = new TopicClass();
const apiEndpoint = new ApiEndpointClass();

const sourceCol = get(
topic,
'entityResponseData.messageSchema.schemaFields[0].children[0].fullyQualifiedName'
);
await topic.create(apiContext);
await apiEndpoint.create(apiContext);

const targetCol = get(
apiEndpoint,
'entityResponseData.responseSchema.schemaFields[0].children[1].fullyQualifiedName'
);
const sourceCol = get(
topic,
'entityResponseData.messageSchema.schemaFields[0].children[0].fullyQualifiedName'
);

await addPipelineBetweenNodes(page, topic, apiEndpoint);
await activateColumnLayer(page);
const targetCol = get(
apiEndpoint,
'entityResponseData.responseSchema.schemaFields[0].children[1].fullyQualifiedName'
);

// Add column lineage
await addColumnLineage(page, sourceCol, targetCol);
await page.click('[data-testid="edit-lineage"]');
await addPipelineBetweenNodes(page, topic, apiEndpoint);
await activateColumnLayer(page);

await removeColumnLineage(page, sourceCol, targetCol);
await page.click('[data-testid="edit-lineage"]');
// Add column lineage
await addColumnLineage(page, sourceCol, targetCol);
await page.click('[data-testid="edit-lineage"]');

await deleteNode(page, apiEndpoint);
await topic.delete(apiContext);
await apiEndpoint.delete(apiContext);
await removeColumnLineage(page, sourceCol, targetCol);
await page.click('[data-testid="edit-lineage"]');

await afterAction();
}
);
await deleteNode(page, apiEndpoint);
await topic.delete(apiContext);
await apiEndpoint.delete(apiContext);

test.fixme(
'Verify column lineage between table and api endpoint',
async ({ browser }) => {
const { page } = await createNewPage(browser);
const { apiContext, afterAction } = await getApiContext(page);
const table = new TableClass();
const apiEndpoint = new ApiEndpointClass();
await table.create(apiContext);
await apiEndpoint.create(apiContext);

const sourceTableFqn = get(table, 'entityResponseData.fullyQualifiedName');
const sourceCol = `${sourceTableFqn}.${get(
table,
'entityResponseData.columns[0].name'
)}`;
const targetCol = get(
apiEndpoint,
'entityResponseData.responseSchema.schemaFields[0].children[0].fullyQualifiedName'
);
await afterAction();
});

await addPipelineBetweenNodes(page, table, apiEndpoint);
await activateColumnLayer(page);
test('Verify column lineage between table and api endpoint', async ({
browser,
}) => {
const { page } = await createNewPage(browser);
const { apiContext, afterAction } = await getApiContext(page);
const table = new TableClass();
const apiEndpoint = new ApiEndpointClass();
await table.create(apiContext);
await apiEndpoint.create(apiContext);

// Add column lineage
await addColumnLineage(page, sourceCol, targetCol);
await page.click('[data-testid="edit-lineage"]');
const sourceTableFqn = get(table, 'entityResponseData.fullyQualifiedName');
const sourceCol = `${sourceTableFqn}.${get(
table,
'entityResponseData.columns[0].name'
)}`;
const targetCol = get(
apiEndpoint,
'entityResponseData.responseSchema.schemaFields[0].children[0].fullyQualifiedName'
);

await removeColumnLineage(page, sourceCol, targetCol);
await page.click('[data-testid="edit-lineage"]');
await addPipelineBetweenNodes(page, table, apiEndpoint);
await activateColumnLayer(page);

await deleteNode(page, apiEndpoint);
await table.delete(apiContext);
await apiEndpoint.delete(apiContext);
// Add column lineage
await addColumnLineage(page, sourceCol, targetCol);
await page.click('[data-testid="edit-lineage"]');

await afterAction();
}
);
await removeColumnLineage(page, sourceCol, targetCol);
await page.click('[data-testid="edit-lineage"]');

await deleteNode(page, apiEndpoint);
await table.delete(apiContext);
await apiEndpoint.delete(apiContext);

await afterAction();
});
Loading
Loading