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

Assets filters #14229

Merged
merged 21 commits into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -436,14 +436,8 @@ export const removeAssetsFromDomain = (domainObj) => {
domainObj.assets.forEach((asset, index) => {
interceptURL('GET', '/api/v1/search/query*', 'searchAssets');

cy.get(
`[data-testid="table-data-card_${asset.fullyQualifiedName}"]`
).within(() => {
cy.get('.explore-card-actions').invoke('show');
cy.get('.explore-card-actions').within(() => {
cy.get('[data-testid="delete-tag"]').click();
});
});
cy.get(`[data-testid="manage-button-${asset.fullyQualifiedName}"]`).click();
cy.get('[data-testid="delete-button"]').click();

cy.get("[data-testid='save-button']").click();

Expand All @@ -460,9 +454,13 @@ export const removeAssetsFromDomain = (domainObj) => {

export const addAssetsToDataProduct = (dataProductObj, domainObj) => {
interceptURL('GET', `/api/v1/search/query**`, 'getDataProductAssets');
interceptURL('GET', '/api/v1/dataProducts/**', 'getDataProductDetails');

goToDataProductsTab(domainObj);
cy.get(`[data-testid="explore-card-${dataProductObj.name}"]`).click();
cy.get(
`[data-testid="explore-card-${dataProductObj.name}"] [data-testid="entity-link"]`
).click();
verifyResponseStatusCode('@getDataProductDetails', 200);

cy.get('[data-testid="assets"]').should('be.visible').click();
cy.get('.ant-tabs-tab-active').contains('Assets').should('be.visible');
Expand Down Expand Up @@ -501,7 +499,9 @@ export const addAssetsToDataProduct = (dataProductObj, domainObj) => {

export const removeAssetsFromDataProduct = (dataProductObj, domainObj) => {
goToDataProductsTab(domainObj);
cy.get(`[data-testid="explore-card-${dataProductObj.name}"]`).click();
cy.get(
`[data-testid="explore-card-${dataProductObj.name}"] [data-testid="entity-link"]`
).click();

cy.get('[data-testid="assets"]').should('be.visible').click();
cy.get('.ant-tabs-tab-active').contains('Assets').should('be.visible');
Expand All @@ -510,15 +510,8 @@ export const removeAssetsFromDataProduct = (dataProductObj, domainObj) => {

dataProductObj.assets.forEach((asset, index) => {
interceptURL('GET', '/api/v1/search/query*', 'searchAssets');

cy.get(
`[data-testid="table-data-card_${asset.fullyQualifiedName}"]`
).within(() => {
cy.get('.explore-card-actions').invoke('show');
cy.get('.explore-card-actions').within(() => {
cy.get('[data-testid="delete-tag"]').click();
});
});
cy.get(`[data-testid="manage-button-${asset.fullyQualifiedName}"]`).click();
cy.get('[data-testid="delete-button"]').click();

cy.get("[data-testid='save-button']").click();

Expand Down
113 changes: 98 additions & 15 deletions openmetadata-ui/src/main/resources/ui/cypress/constants/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,15 +305,63 @@ export const NEW_GLOSSARY = {
name: 'Cypress Glossary',
description: 'This is the Cypress Glossary',
reviewer: 'Aaron Johnson',
tag: 'PII.None',
addReviewer: true,
tag: 'PersonalData.Personal',
};
export const NEW_GLOSSARY_1 = {
name: 'Cypress Product%Glossary',
description: 'This is the Product glossary with percentage',
reviewer: 'Brandy Miller',
addReviewer: false,
};
export const CYPRESS_ASSETS_GLOSSARY = {
name: 'Cypress Assets Glossary',
description: 'This is the Assets Cypress Glossary',
reviewer: '',
addReviewer: false,
tag: 'PII.None',
};

const COMMON_ASSETS = [
{
name: 'dim_customer',
fullyQualifiedName: 'sample_data.ecommerce_db.shopify.dim_address',
},
{
name: 'raw_order',
fullyQualifiedName: 'sample_data.ecommerce_db.shopify.raw_order',
},
{
name: 'presto_etl',
fullyQualifiedName: 'sample_airflow.presto_etl',
},
];

export const CYPRESS_ASSETS_GLOSSARY_TERMS = {
term_1: {
name: 'Cypress%PercentTerm',
description: 'This is the Cypress PercentTerm',
synonyms: 'buy,collect,acquire',
fullyQualifiedName: 'Cypress Assets Glossary.Cypress%PercentTerm',
assets: COMMON_ASSETS,
},
term_2: {
name: 'Cypress Space GTerm',
description: 'This is the Cypress Sales',
synonyms: 'give,disposal,deal',
fullyQualifiedName: 'Cypress Assets Glossary.Cypress Space GTerm',
assets: COMMON_ASSETS,
},
term_3: {
name: 'Cypress.Dot.GTerm',
description: 'This is the Cypress with space',
synonyms: 'tea,coffee,water',
fullyQualifiedName: 'Cypress Assets Glossary."Cypress.Dot.GTerm"',
displayFqn: 'Cypress Assets Glossary."Cypress.Dot.GTerm"',
assets: COMMON_ASSETS,
},
};

export const NEW_GLOSSARY_TERMS = {
term_1: {
name: 'CypressPurchase',
Expand All @@ -332,20 +380,7 @@ export const NEW_GLOSSARY_TERMS = {
description: 'This is the Cypress with space',
synonyms: 'tea,coffee,water',
fullyQualifiedName: 'Cypress Glossary.Cypress Space',
assets: [
{
name: 'dim_customer',
fullyQualifiedName: 'sample_data.ecommerce_db.shopify.dim_address',
},
{
name: 'raw_order',
fullyQualifiedName: 'sample_data.ecommerce_db.shopify.raw_order',
},
{
name: 'presto_etl',
fullyQualifiedName: 'sample_airflow.presto_etl',
},
],
assets: COMMON_ASSETS,
},
};
export const GLOSSARY_TERM_WITH_DETAILS = {
Expand Down Expand Up @@ -613,3 +648,51 @@ export const DOMAIN_2 = {
},
],
};

export const DOMAIN_3 = {
name: 'Cypress Space',
updatedName: 'Cypress Space',
updatedDisplayName: 'Cypress Space',
fullyQualifiedName: 'Cypress Space',
description: 'This is the Cypress for testing domain with space creation',
experts: 'Alex Pollard',
owner: 'Alex Pollard',
domainType: 'Source-aligned',
dataProducts: [
{
name: 'Cypress%PercentDP',
description:
'This is the data product description for Cypress DataProduct Assets',
experts: 'Aaron Johnson',
owner: 'Aaron Johnson',
assets: [
{
name: 'forecast_sales_performance',
fullyQualifiedName: 'sample_superset.forecast_sales_performance',
},
{
name: 'eta_predictions',
fullyQualifiedName: 'mlflow_svc.eta_predictions',
},
{
name: 'operations_view',
fullyQualifiedName: 'sample_looker.model.operations_view',
},
],
},
],
assets: [
{
name: 'forecast_sales_performance',
fullyQualifiedName: 'sample_superset.forecast_sales_performance',
},
{
name: 'eta_predictions',
fullyQualifiedName: 'mlflow_svc.eta_predictions',
},
{
name: 'operations_view',
fullyQualifiedName: 'sample_looker.model.operations_view',
},
],
};
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
updateDomainDetails,
verifyDomain,
} from '../../common/DomainUtils';
import { DOMAIN_1, DOMAIN_2 } from '../../constants/constants';
import { DOMAIN_1, DOMAIN_2, DOMAIN_3 } from '../../constants/constants';

describe('Domain page should work properly', () => {
beforeEach(() => {
Expand All @@ -52,6 +52,11 @@ describe('Domain page should work properly', () => {
addAssetsToDomain(DOMAIN_2);
});

it('Add assets to domain having space using asset selection modal should work properly', () => {
createDomain(DOMAIN_3, false);
addAssetsToDomain(DOMAIN_3);
});

it('Create new data product should work properly', () => {
DOMAIN_1.dataProducts.forEach((dataProduct) => {
createDataProducts(dataProduct, DOMAIN_1);
Expand All @@ -72,6 +77,17 @@ describe('Domain page should work properly', () => {
addAssetsToDataProduct(DOMAIN_2.dataProducts[0], DOMAIN_2);
});

it('Add data product assets using asset selection modal with separate domain and dp having space', () => {
DOMAIN_3.dataProducts.forEach((dp) => {
createDataProducts(dp, DOMAIN_3);
cy.get('[data-testid="app-bar-item-domain"]')
.should('be.visible')
.click({ force: true });
});

addAssetsToDataProduct(DOMAIN_3.dataProducts[0], DOMAIN_3);
});

it('Remove data product assets using asset selection modal should work properly', () => {
removeAssetsFromDataProduct(DOMAIN_2.dataProducts[0], DOMAIN_2);
});
Expand All @@ -97,7 +113,7 @@ describe('Domain page should work properly', () => {
});

it('Delete domain flow should work properly', () => {
[DOMAIN_1, DOMAIN_2].forEach((domain) => {
[DOMAIN_1, DOMAIN_2, DOMAIN_3].forEach((domain) => {
deleteDomain(domain);
});
});
Expand Down
Loading
Loading