mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-30 20:06:19 +00:00
fix flaky lineage cypress (#14878)
This commit is contained in:
parent
1786757e9b
commit
c7e899c55b
@ -16,14 +16,14 @@ export const PIPELINE_SUPPORTED_TYPES = ['Table', 'Topic'];
|
|||||||
|
|
||||||
export const LINEAGE_ITEMS = [
|
export const LINEAGE_ITEMS = [
|
||||||
{
|
{
|
||||||
term: 'fact_sale',
|
term: 'marketing',
|
||||||
displayName: 'fact_sale',
|
displayName: 'marketing',
|
||||||
entity: DATA_ASSETS.tables,
|
entity: DATA_ASSETS.tables,
|
||||||
serviceName: 'sample_data',
|
serviceName: 'sample_data',
|
||||||
entityType: 'Table',
|
entityType: 'Table',
|
||||||
fqn: 'sample_data.ecommerce_db.shopify.fact_sale',
|
fqn: 'sample_data.ecommerce_db.shopify.marketing',
|
||||||
searchIndex: SEARCH_INDEX.tables,
|
searchIndex: SEARCH_INDEX.tables,
|
||||||
columns: ['sample_data.ecommerce_db.shopify.fact_sale.shop_id'],
|
columns: ['sample_data.ecommerce_db.shopify.marketing.ad_id'],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
term: 'fact_session',
|
term: 'fact_session',
|
||||||
@ -61,6 +61,14 @@ export const LINEAGE_ITEMS = [
|
|||||||
fqn: 's3_storage_sample.departments.media',
|
fqn: 's3_storage_sample.departments.media',
|
||||||
searchIndex: SEARCH_INDEX.containers,
|
searchIndex: SEARCH_INDEX.containers,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
term: 'customers',
|
||||||
|
entity: DATA_ASSETS.dashboards,
|
||||||
|
serviceName: 'sample_looker',
|
||||||
|
entityType: 'Dashboard',
|
||||||
|
fqn: 'sample_looker.customers',
|
||||||
|
searchIndex: SEARCH_INDEX.dashboards,
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
export const PIPELINE_ITEMS = [
|
export const PIPELINE_ITEMS = [
|
||||||
|
@ -30,8 +30,10 @@ const dragConnection = (sourceId, targetId) => {
|
|||||||
.click({ force: true }); // Adding force true for handles because it can be hidden behind the node
|
.click({ force: true }); // Adding force true for handles because it can be hidden behind the node
|
||||||
};
|
};
|
||||||
|
|
||||||
const performFitView = () => {
|
const performZoomOut = () => {
|
||||||
cy.get('.react-flow__controls-fitview').click({ force: true });
|
for (let i = 0; i < 7; i++) {
|
||||||
|
cy.get('.react-flow__controls-zoomout').click({ force: true });
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const connectEdgeBetweenNodes = (fromNode, toNode) => {
|
const connectEdgeBetweenNodes = (fromNode, toNode) => {
|
||||||
@ -63,7 +65,6 @@ const connectEdgeBetweenNodes = (fromNode, toNode) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const verifyNodePresent = (node) => {
|
const verifyNodePresent = (node) => {
|
||||||
performFitView();
|
|
||||||
cy.get(`[data-testid="lineage-node-${node.fqn}"]`).should('be.visible');
|
cy.get(`[data-testid="lineage-node-${node.fqn}"]`).should('be.visible');
|
||||||
cy.get(
|
cy.get(
|
||||||
`[data-testid="lineage-node-${node.fqn}"] [data-testid="entity-header-name"]`
|
`[data-testid="lineage-node-${node.fqn}"] [data-testid="entity-header-name"]`
|
||||||
@ -71,7 +72,6 @@ const verifyNodePresent = (node) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const deleteNode = (node) => {
|
const deleteNode = (node) => {
|
||||||
performFitView();
|
|
||||||
interceptURL('DELETE', '/api/v1/lineage/**', 'lineageDeleteApi');
|
interceptURL('DELETE', '/api/v1/lineage/**', 'lineageDeleteApi');
|
||||||
cy.get(`[data-testid="lineage-node-${node.fqn}"]`).click({ force: true });
|
cy.get(`[data-testid="lineage-node-${node.fqn}"]`).click({ force: true });
|
||||||
// Adding force true for handles because it can be hidden behind the node
|
// Adding force true for handles because it can be hidden behind the node
|
||||||
@ -142,6 +142,9 @@ const addPipelineBetweenNodes = (
|
|||||||
|
|
||||||
cy.get('[data-testid="lineage"]').click();
|
cy.get('[data-testid="lineage"]').click();
|
||||||
cy.get('[data-testid="edit-lineage"]').click();
|
cy.get('[data-testid="edit-lineage"]').click();
|
||||||
|
|
||||||
|
performZoomOut();
|
||||||
|
|
||||||
connectEdgeBetweenNodes(sourceEntity, targetEntity);
|
connectEdgeBetweenNodes(sourceEntity, targetEntity);
|
||||||
if (pipelineItem) {
|
if (pipelineItem) {
|
||||||
applyPipelineFromModal(sourceEntity, targetEntity, pipelineItem);
|
applyPipelineFromModal(sourceEntity, targetEntity, pipelineItem);
|
||||||
@ -155,22 +158,21 @@ const addPipelineBetweenNodes = (
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const expandCols = (nodeFqn) => {
|
const expandCols = (nodeFqn, hasShowMore) => {
|
||||||
cy.get(
|
cy.get(
|
||||||
`[data-testid="lineage-node-${nodeFqn}"] [data-testid="expand-cols-btn"]`
|
`[data-testid="lineage-node-${nodeFqn}"] [data-testid="expand-cols-btn"]`
|
||||||
).click({ force: true });
|
).click({ force: true });
|
||||||
cy.get(
|
if (hasShowMore) {
|
||||||
`[data-testid="lineage-node-${nodeFqn}"] [data-testid="show-more-cols-btn"]`
|
cy.get(
|
||||||
).click({ force: true });
|
`[data-testid="lineage-node-${nodeFqn}"] [data-testid="show-more-cols-btn"]`
|
||||||
|
).click({ force: true });
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const addColumnLineage = (fromNode, toNode) => {
|
const addColumnLineage = (fromNode, toNode) => {
|
||||||
interceptURL('PUT', '/api/v1/lineage', 'lineageApi');
|
interceptURL('PUT', '/api/v1/lineage', 'lineageApi');
|
||||||
performFitView();
|
expandCols(fromNode.fqn, false);
|
||||||
expandCols(fromNode.fqn);
|
expandCols(toNode.fqn, true);
|
||||||
performFitView();
|
|
||||||
expandCols(toNode.fqn);
|
|
||||||
performFitView();
|
|
||||||
dragConnection(
|
dragConnection(
|
||||||
`column-${fromNode.columns[0]}`,
|
`column-${fromNode.columns[0]}`,
|
||||||
`column-${toNode.columns[0]}`
|
`column-${toNode.columns[0]}`
|
||||||
@ -198,6 +200,8 @@ describe('Lineage verification', () => {
|
|||||||
cy.get('[data-testid="lineage"]').click();
|
cy.get('[data-testid="lineage"]').click();
|
||||||
cy.get('[data-testid="edit-lineage"]').click();
|
cy.get('[data-testid="edit-lineage"]').click();
|
||||||
|
|
||||||
|
performZoomOut();
|
||||||
|
|
||||||
// Connect the current entity to all others in the array except itself
|
// Connect the current entity to all others in the array except itself
|
||||||
for (let i = 0; i < LINEAGE_ITEMS.length; i++) {
|
for (let i = 0; i < LINEAGE_ITEMS.length; i++) {
|
||||||
if (i !== index) {
|
if (i !== index) {
|
||||||
@ -208,6 +212,8 @@ describe('Lineage verification', () => {
|
|||||||
cy.get('[data-testid="edit-lineage"]').click();
|
cy.get('[data-testid="edit-lineage"]').click();
|
||||||
cy.reload();
|
cy.reload();
|
||||||
|
|
||||||
|
performZoomOut();
|
||||||
|
|
||||||
// Verify Added Nodes
|
// Verify Added Nodes
|
||||||
for (let i = 0; i < LINEAGE_ITEMS.length; i++) {
|
for (let i = 0; i < LINEAGE_ITEMS.length; i++) {
|
||||||
if (i !== index) {
|
if (i !== index) {
|
||||||
@ -228,6 +234,8 @@ describe('Lineage verification', () => {
|
|||||||
cy.get('[data-testid="lineage"]').click();
|
cy.get('[data-testid="lineage"]').click();
|
||||||
cy.get('[data-testid="edit-lineage"]').click();
|
cy.get('[data-testid="edit-lineage"]').click();
|
||||||
|
|
||||||
|
performZoomOut();
|
||||||
|
|
||||||
// Delete Nodes
|
// Delete Nodes
|
||||||
for (let i = 0; i < LINEAGE_ITEMS.length; i++) {
|
for (let i = 0; i < LINEAGE_ITEMS.length; i++) {
|
||||||
if (i !== index) {
|
if (i !== index) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user