mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-09-01 21:23:10 +00:00
cypress: updated tagsAddRemove spec as per upgrade test (#13083)
This commit is contained in:
parent
478837fa85
commit
a41326ea1e
@ -19,6 +19,7 @@ export const TAGS_ADD_REMOVE_ENTITIES = [
|
|||||||
serviceName: 'sample_data',
|
serviceName: 'sample_data',
|
||||||
fieldName: 'SKU',
|
fieldName: 'SKU',
|
||||||
tags: ['PersonalData.Personal', 'PII.Sensitive'],
|
tags: ['PersonalData.Personal', 'PII.Sensitive'],
|
||||||
|
permissionApi: '/api/v1/permissions/*/name/*',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
term: 'address_book',
|
term: 'address_book',
|
||||||
@ -27,6 +28,7 @@ export const TAGS_ADD_REMOVE_ENTITIES = [
|
|||||||
serviceName: 'sample_kafka',
|
serviceName: 'sample_kafka',
|
||||||
fieldName: 'AddressBook',
|
fieldName: 'AddressBook',
|
||||||
tags: ['PersonalData.Personal', 'PII.Sensitive'],
|
tags: ['PersonalData.Personal', 'PII.Sensitive'],
|
||||||
|
permissionApi: '/api/v1/permissions/*/name/*',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
term: 'deck.gl Demo',
|
term: 'deck.gl Demo',
|
||||||
@ -36,6 +38,7 @@ export const TAGS_ADD_REMOVE_ENTITIES = [
|
|||||||
serviceName: 'sample_superset',
|
serviceName: 'sample_superset',
|
||||||
fieldName: 'e3cfd274-44f8-4bf3-b75d-d40cf88869ba',
|
fieldName: 'e3cfd274-44f8-4bf3-b75d-d40cf88869ba',
|
||||||
tags: ['PersonalData.Personal', 'PII.Sensitive'],
|
tags: ['PersonalData.Personal', 'PII.Sensitive'],
|
||||||
|
permissionApi: '/api/v1/permissions/*/*',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
term: 'dim_address_etl',
|
term: 'dim_address_etl',
|
||||||
@ -44,6 +47,7 @@ export const TAGS_ADD_REMOVE_ENTITIES = [
|
|||||||
serviceName: 'sample_airflow',
|
serviceName: 'sample_airflow',
|
||||||
fieldName: 'dim_address_task',
|
fieldName: 'dim_address_task',
|
||||||
tags: ['PersonalData.Personal', 'PII.Sensitive'],
|
tags: ['PersonalData.Personal', 'PII.Sensitive'],
|
||||||
|
permissionApi: '/api/v1/permissions/*/*',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
term: 'eta_predictions',
|
term: 'eta_predictions',
|
||||||
@ -52,5 +56,6 @@ export const TAGS_ADD_REMOVE_ENTITIES = [
|
|||||||
serviceName: 'mlflow_svc',
|
serviceName: 'mlflow_svc',
|
||||||
fieldName: 'sales',
|
fieldName: 'sales',
|
||||||
tags: ['PersonalData.Personal', 'PII.Sensitive'],
|
tags: ['PersonalData.Personal', 'PII.Sensitive'],
|
||||||
|
permissionApi: '/api/v1/permissions/*/*',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
@ -55,8 +55,8 @@ const DATABASE_AND_SCHEMA = {
|
|||||||
|
|
||||||
export const ENTITIES_DISPLAY_NAME = {
|
export const ENTITIES_DISPLAY_NAME = {
|
||||||
table: {
|
table: {
|
||||||
name: 'dim(shop)',
|
name: 'dim.shop',
|
||||||
oldDisplayName: 'dim(shop)',
|
oldDisplayName: 'dim.shop',
|
||||||
displayName: 'Dim Shop Test',
|
displayName: 'Dim Shop Test',
|
||||||
entity: MYDATA_SUMMARY_OPTIONS.tables,
|
entity: MYDATA_SUMMARY_OPTIONS.tables,
|
||||||
serviceName: DB_SERVICE,
|
serviceName: DB_SERVICE,
|
||||||
|
@ -49,42 +49,47 @@ const ID = {
|
|||||||
teams: {
|
teams: {
|
||||||
testid: '[data-menu-id*="teams"]',
|
testid: '[data-menu-id*="teams"]',
|
||||||
button: 'add-team',
|
button: 'add-team',
|
||||||
|
api: '/api/v1/teams/name/Organization?*',
|
||||||
},
|
},
|
||||||
users: {
|
users: {
|
||||||
testid: '[data-menu-id*="users"]',
|
testid: '[data-menu-id*="users"]',
|
||||||
button: 'add-user',
|
button: 'add-user',
|
||||||
|
api: '/api/v1/users?fields=*isBot=false*',
|
||||||
},
|
},
|
||||||
admins: {
|
admins: {
|
||||||
testid: '[data-menu-id*="admins"]',
|
testid: '[data-menu-id*="admins"]',
|
||||||
button: 'add-user',
|
button: 'add-user',
|
||||||
},
|
api: '/api/v1/users?fields=*isAdmin=true*',
|
||||||
roles: {
|
|
||||||
testid: '[data-menu-id*="roles"]',
|
|
||||||
button: 'add-role',
|
|
||||||
},
|
|
||||||
policies: {
|
|
||||||
testid: '[data-menu-id*="policies"]',
|
|
||||||
button: 'add-policy',
|
|
||||||
},
|
},
|
||||||
databases: {
|
databases: {
|
||||||
testid: '[data-menu-id*="databases"]',
|
testid: '[data-menu-id*="databases"]',
|
||||||
button: 'add-service-button',
|
button: 'add-service-button',
|
||||||
|
api: '/api/v1/services/databaseServices?*',
|
||||||
},
|
},
|
||||||
messaging: {
|
messaging: {
|
||||||
testid: '[data-menu-id*="messaging"]',
|
testid: '[data-menu-id*="messaging"]',
|
||||||
button: 'add-service-button',
|
button: 'add-service-button',
|
||||||
|
api: '/api/v1/services/messagingServices?*',
|
||||||
},
|
},
|
||||||
dashboard: {
|
dashboard: {
|
||||||
testid: '[data-menu-id*="services.dashboards"]',
|
testid: '[data-menu-id*="services.dashboards"]',
|
||||||
button: 'add-service-button',
|
button: 'add-service-button',
|
||||||
|
api: '/api/v1/services/dashboardServices?*',
|
||||||
},
|
},
|
||||||
pipelines: {
|
pipelines: {
|
||||||
testid: '[data-menu-id*="services.pipelines"]',
|
testid: '[data-menu-id*="services.pipelines"]',
|
||||||
button: 'add-service-button',
|
button: 'add-service-button',
|
||||||
|
api: '/api/v1/services/pipelineServices?*',
|
||||||
},
|
},
|
||||||
mlmodels: {
|
mlmodels: {
|
||||||
testid: '[data-menu-id*="services.mlModels"]',
|
testid: '[data-menu-id*="services.mlModels"]',
|
||||||
button: 'add-service-button',
|
button: 'add-service-button',
|
||||||
|
api: '/api/v1/services/mlmodelServices?*',
|
||||||
|
},
|
||||||
|
storage: {
|
||||||
|
testid: '[data-menu-id*="services.storages"]',
|
||||||
|
button: 'add-service-button',
|
||||||
|
api: '/api/v1/services/storageServices?*',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
const PERMISSIONS = {
|
const PERMISSIONS = {
|
||||||
@ -273,7 +278,15 @@ describe('DataConsumer Edit policy should work properly', () => {
|
|||||||
// Navigate to settings
|
// Navigate to settings
|
||||||
cy.get(NAVBAR_DETAILS.settings.testid).should('be.visible').click();
|
cy.get(NAVBAR_DETAILS.settings.testid).should('be.visible').click();
|
||||||
Object.values(ID).forEach((id) => {
|
Object.values(ID).forEach((id) => {
|
||||||
|
if (id?.api) {
|
||||||
|
interceptURL('GET', id.api, 'getTabDetails');
|
||||||
|
}
|
||||||
|
|
||||||
cy.get(id.testid).should('be.visible').click();
|
cy.get(id.testid).should('be.visible').click();
|
||||||
|
if (id?.api) {
|
||||||
|
verifyResponseStatusCode('@getTabDetails', 200);
|
||||||
|
}
|
||||||
|
|
||||||
cy.get(`[data-testid="${id.button}"]`).should('not.be.exist');
|
cy.get(`[data-testid="${id.button}"]`).should('not.be.exist');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -84,8 +84,10 @@ describe('Check if tags addition and removal flow working properly from tables',
|
|||||||
cy.login();
|
cy.login();
|
||||||
});
|
});
|
||||||
|
|
||||||
TAGS_ADD_REMOVE_ENTITIES.map((entityDetails) =>
|
TAGS_ADD_REMOVE_ENTITIES.map((entityDetails) => {
|
||||||
it(`Adding and removing tags to the ${entityDetails.entity} entity should work properly`, () => {
|
it(`Adding & removing tags to the ${entityDetails.entity} entity`, () => {
|
||||||
|
interceptURL('GET', entityDetails.permissionApi, 'getEntityPermission');
|
||||||
|
|
||||||
interceptURL(
|
interceptURL(
|
||||||
'GET',
|
'GET',
|
||||||
`/api/v1/${entityDetails.entity}/name/*?fields=*`,
|
`/api/v1/${entityDetails.entity}/name/*?fields=*`,
|
||||||
@ -103,6 +105,7 @@ describe('Check if tags addition and removal flow working properly from tables',
|
|||||||
entityDetails.entity
|
entityDetails.entity
|
||||||
);
|
);
|
||||||
verifyResponseStatusCode('@getEntityDetail', 200);
|
verifyResponseStatusCode('@getEntityDetail', 200);
|
||||||
|
verifyResponseStatusCode('@getEntityPermission', 200);
|
||||||
|
|
||||||
cy.get(
|
cy.get(
|
||||||
'[data-testid="entity-right-panel"] [data-testid="tags-container"]'
|
'[data-testid="entity-right-panel"] [data-testid="tags-container"]'
|
||||||
@ -127,6 +130,44 @@ describe('Check if tags addition and removal flow working properly from tables',
|
|||||||
checkTags(entityDetails.tags[0], true);
|
checkTags(entityDetails.tags[0], true);
|
||||||
|
|
||||||
removeTags(true);
|
removeTags(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it(`Adding & removing tags to the ${entityDetails.entity} entity schema table`, () => {
|
||||||
|
interceptURL(
|
||||||
|
'GET',
|
||||||
|
`/api/v1/${entityDetails.entity}/name/*?fields=*`,
|
||||||
|
'getEntityDetail'
|
||||||
|
);
|
||||||
|
interceptURL('GET', entityDetails.permissionApi, 'getEntityPermission');
|
||||||
|
interceptURL('PATCH', `/api/v1/${entityDetails.entity}/*`, 'tagsChange');
|
||||||
|
interceptURL(
|
||||||
|
'PATCH',
|
||||||
|
`/api/v1/${entityDetails.insideEntity ?? entityDetails.entity}/*`,
|
||||||
|
'tagsChange'
|
||||||
|
);
|
||||||
|
if (entityDetails.insideEntity) {
|
||||||
|
interceptURL(
|
||||||
|
'GET',
|
||||||
|
`/api/v1/${entityDetails.insideEntity}/*`,
|
||||||
|
'getInsideColumn'
|
||||||
|
);
|
||||||
|
interceptURL(
|
||||||
|
'GET',
|
||||||
|
`/api/v1/permissions/chart/*`,
|
||||||
|
'getInsideColumnPermission'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
visitEntityDetailsPage(
|
||||||
|
entityDetails.term,
|
||||||
|
entityDetails.serviceName,
|
||||||
|
entityDetails.entity
|
||||||
|
);
|
||||||
|
verifyResponseStatusCode('@getEntityDetail', 200);
|
||||||
|
verifyResponseStatusCode('@getEntityPermission', 200);
|
||||||
|
if (entityDetails.insideEntity) {
|
||||||
|
verifyResponseStatusCode('@getInsideColumn', 200);
|
||||||
|
verifyResponseStatusCode('@getInsideColumnPermission', 200);
|
||||||
|
}
|
||||||
|
|
||||||
if (entityDetails.entity === 'mlmodels') {
|
if (entityDetails.entity === 'mlmodels') {
|
||||||
cy.get(
|
cy.get(
|
||||||
@ -165,6 +206,6 @@ describe('Check if tags addition and removal flow working properly from tables',
|
|||||||
entityDetails.tags.map((tag) => checkTags(tag));
|
entityDetails.tags.map((tag) => checkTags(tag));
|
||||||
|
|
||||||
removeTags(false, entityDetails.separate);
|
removeTags(false, entityDetails.separate);
|
||||||
})
|
});
|
||||||
);
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user