OpenMetadata/openmetadata-ui/src/main/resources/ui/cypress/e2e/Flow/AddAndRemoveTierAndOwner.spec.js

365 lines
13 KiB
JavaScript
Raw Normal View History

/*
* Copyright 2023 Collate.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// eslint-disable-next-line spaced-comment
/// <reference types="Cypress" />
import {
addOwner,
addTier,
descriptionBox,
interceptURL,
removeOwner,
removeTier,
verifyResponseStatusCode,
visitEntityDetailsPage,
} from '../../common/common';
import {
DELETE_TERM,
SEARCH_ENTITY_DASHBOARD,
SEARCH_ENTITY_MLMODEL,
SEARCH_ENTITY_PIPELINE,
SEARCH_ENTITY_STORED_PROCEDURE,
SEARCH_ENTITY_TABLE,
SEARCH_ENTITY_TOPIC,
} from '../../constants/constants';
const ENTITIES = {
table: {
...SEARCH_ENTITY_TABLE.table_5,
schema: 'shopify',
database: 'ecommerce_db',
},
topic: SEARCH_ENTITY_TOPIC.topic_2,
dashboard: SEARCH_ENTITY_DASHBOARD.dashboard_2,
pipeline: SEARCH_ENTITY_PIPELINE.pipeline_2,
mlmodel: SEARCH_ENTITY_MLMODEL.mlmodel_2,
storedProcedure: SEARCH_ENTITY_STORED_PROCEDURE.stored_procedure_2,
};
const glossary = 'GlossaryOwnerTest';
const glossaryTerm = 'GlossaryTermOwnerTest';
const OWNER = 'Amber Green';
const TIER = 'Tier1';
const addRemoveOwner = (ownerName, entity, isGlossaryPage) => {
addOwner(ownerName, entity, isGlossaryPage);
removeOwner(entity, isGlossaryPage);
};
UI - design update for new UI/UX (#12000) * chore(ui): revamp table details page Re-design table details header with schema tab * misc fixes for ui and tests * update * fix edit description * chore(ui): update the app left panel icons * chore(ui): update left panel icon stroke color * fix: explore page layout change * fix: highlight issues * updated right panel for explore page * fix: explore layout changes * separate out header component * added activity feed tab * fix: highlight issue * fix: highlight card for explore page * support all widget fix spacing issue * fix: show reactions * fix: update reactions for tasks tab * fix: make use of appstate to avoid repetitive calls * fix activity feed layout * fix: landing page and explore feedbacks * fix: missing localization * update activityFeedProvider with drawer * fix description v1 component icons * fix: update styles * minor fix on icons and entity table * Revamp Tag UI for TableDetailPage * fix: update css * Remove color in TagV1 component and minor file improvement * added frequantly joint table basic structure * fix: update kpi chart styles * supported request tags in table detail page * fix request description redirect issue * fix: update styles for my data page * added scroll to frequently joint table * removing unnaccessary code * fix: explore page feedbacks * fix: explore feedbacks * fixed signup page issue * chore(ui): only apply the text transform on heading * chore(ui): update table header styling * chore(ui): update table text color and border radius * fix: explore quick filters * update header for topic and dashboard * chore: update table body styling * supported glossary term hierarchy * updating spacing for all the page * chore(ui): update descriptionV1 component styling * chore: update add-chat viewbox * fix: left sidebar console errors * update all the entity headers * chore: update table name to name * update description component * clear console errors * revamp entity topbar manage area * fix: entity popover similar to explore card * updated navbar as per new UI mock * fix: feedbacks * updated announcement style as per mock * fix: explore feedbacks * implemented single box shadow wherever its needed and worked on feedback * worked on feedbacks * update feed tab on activityFeedTab component * updated glossary card, no owner icon * fix glossary hierarchy issue of repeating same glossary * fix: update resizable panel pages * updated navbar, align profiler picture in navbar with other element * fix: remove page layout component * fix: add missing layout in rule pages * fix: jest tests * fix: jest tests * replace old activity feed component with new one * fix: jest unit tests * initial DQ page setup * translation sync * fix: unit tests * supported subtab route for entities pages * fix: feedbacks * fix: update tasks pages * supported api for activity feeds for entity * added tabs component in entity table component * worked on test-suite tab * added quality page path in left bar * added action button for test suite * updated redirect path for data-quality * revert to old re-direction for add-test suite * update activity feed task tab * hide action for activity feed tab * fix: task action issue on descriptionV1 * supported new ui for data modal detail page * fix: feedbacks * fix: add missing localization * fix: breadcrumbs * data quality feedbacks * fix: feedbacks * fix: add missing localization * fix: feedbacks * supported activity feed in container and tags of all entities * update task relates changes * remove inline css for entity tag component * feat: update blue as primary color * feat: update svgs to use new primary color * updated DQ page with feedback, and add quality page flow change * translation-sync * fix assignee for tasks * updated api data for test suite pipeline creation * fix: primary color changes * fix: feedbacks * fix count issues * fix scrolling issue for activity feed * address feedbacks * combine open task with heading buttons * data quality changes * fix close with comment * removed delete functionality * clear CLI error, and changes as per JSON schema * update scroll issue on details page * added new badge, and api integration * chore: update data quality tab page styling * cleanup * fix settings page scroll issue * fix scroll issue on service page * chore: update summary cards * update graph color * DQ test case test as per mock * support edit and suggest * integrated API for status update * translation sync * fix cypress tests * integrated API call for test summary * mydata and following page change in user profile page * fix tag cypress tests * updated success % via api data for test suite * fix user component unit test * integrated API for test summary * updated data quality tab as per new mock * revert commented code fir testcaseForm.tsx * fix cypress tests * change user page activity feed with new ui * chore: fix console errors related to activity feed tab component * chore: update setting button style * chore: fix spacing * added pipeline tab * chore: update the colum profiler table * fix: test indicator styling * fetch test suite details * fix: lineage redesign * fix: missing localization * chore: add support for showing single column profile in page itself * chore: add column dropdown for column profiler * fix cypress for entity tags add and remove * supported more parameter in entity dashboard header * chore: add default tab for data quality * removed unneccessary code, and updated testsuite details page with new style * fixed DQ test * translation sync * fix cypress * added functionality to link test case with logical test suite * chore: remove fixed right from status column in column profile tab * fix: purple color issues * fix the count issue in user profile page and breaking of task page * fix: feedbacks * fix: feedbacks * ui improvements * fix cypress for owner and tier * change announcement card color and deleted old assest to it * remove old activity feed files * fix unit test * fix various cypress * fix cypress failues --------- Co-authored-by: Sachin Chaurasiya <sachinchaurasiyachotey87@gmail.com> Co-authored-by: karanh37 <karanh37@gmail.com> Co-authored-by: Shailesh Parmar <shailesh.parmar.webdev@gmail.com> Co-authored-by: Ashish Gupta <ashish@getcollate.io>
2023-06-21 12:59:20 +05:30
const addRemoveTier = (tier, entity) => {
addTier(tier, entity);
UI - design update for new UI/UX (#12000) * chore(ui): revamp table details page Re-design table details header with schema tab * misc fixes for ui and tests * update * fix edit description * chore(ui): update the app left panel icons * chore(ui): update left panel icon stroke color * fix: explore page layout change * fix: highlight issues * updated right panel for explore page * fix: explore layout changes * separate out header component * added activity feed tab * fix: highlight issue * fix: highlight card for explore page * support all widget fix spacing issue * fix: show reactions * fix: update reactions for tasks tab * fix: make use of appstate to avoid repetitive calls * fix activity feed layout * fix: landing page and explore feedbacks * fix: missing localization * update activityFeedProvider with drawer * fix description v1 component icons * fix: update styles * minor fix on icons and entity table * Revamp Tag UI for TableDetailPage * fix: update css * Remove color in TagV1 component and minor file improvement * added frequantly joint table basic structure * fix: update kpi chart styles * supported request tags in table detail page * fix request description redirect issue * fix: update styles for my data page * added scroll to frequently joint table * removing unnaccessary code * fix: explore page feedbacks * fix: explore feedbacks * fixed signup page issue * chore(ui): only apply the text transform on heading * chore(ui): update table header styling * chore(ui): update table text color and border radius * fix: explore quick filters * update header for topic and dashboard * chore: update table body styling * supported glossary term hierarchy * updating spacing for all the page * chore(ui): update descriptionV1 component styling * chore: update add-chat viewbox * fix: left sidebar console errors * update all the entity headers * chore: update table name to name * update description component * clear console errors * revamp entity topbar manage area * fix: entity popover similar to explore card * updated navbar as per new UI mock * fix: feedbacks * updated announcement style as per mock * fix: explore feedbacks * implemented single box shadow wherever its needed and worked on feedback * worked on feedbacks * update feed tab on activityFeedTab component * updated glossary card, no owner icon * fix glossary hierarchy issue of repeating same glossary * fix: update resizable panel pages * updated navbar, align profiler picture in navbar with other element * fix: remove page layout component * fix: add missing layout in rule pages * fix: jest tests * fix: jest tests * replace old activity feed component with new one * fix: jest unit tests * initial DQ page setup * translation sync * fix: unit tests * supported subtab route for entities pages * fix: feedbacks * fix: update tasks pages * supported api for activity feeds for entity * added tabs component in entity table component * worked on test-suite tab * added quality page path in left bar * added action button for test suite * updated redirect path for data-quality * revert to old re-direction for add-test suite * update activity feed task tab * hide action for activity feed tab * fix: task action issue on descriptionV1 * supported new ui for data modal detail page * fix: feedbacks * fix: add missing localization * fix: breadcrumbs * data quality feedbacks * fix: feedbacks * fix: add missing localization * fix: feedbacks * supported activity feed in container and tags of all entities * update task relates changes * remove inline css for entity tag component * feat: update blue as primary color * feat: update svgs to use new primary color * updated DQ page with feedback, and add quality page flow change * translation-sync * fix assignee for tasks * updated api data for test suite pipeline creation * fix: primary color changes * fix: feedbacks * fix count issues * fix scrolling issue for activity feed * address feedbacks * combine open task with heading buttons * data quality changes * fix close with comment * removed delete functionality * clear CLI error, and changes as per JSON schema * update scroll issue on details page * added new badge, and api integration * chore: update data quality tab page styling * cleanup * fix settings page scroll issue * fix scroll issue on service page * chore: update summary cards * update graph color * DQ test case test as per mock * support edit and suggest * integrated API for status update * translation sync * fix cypress tests * integrated API call for test summary * mydata and following page change in user profile page * fix tag cypress tests * updated success % via api data for test suite * fix user component unit test * integrated API for test summary * updated data quality tab as per new mock * revert commented code fir testcaseForm.tsx * fix cypress tests * change user page activity feed with new ui * chore: fix console errors related to activity feed tab component * chore: update setting button style * chore: fix spacing * added pipeline tab * chore: update the colum profiler table * fix: test indicator styling * fetch test suite details * fix: lineage redesign * fix: missing localization * chore: add support for showing single column profile in page itself * chore: add column dropdown for column profiler * fix cypress for entity tags add and remove * supported more parameter in entity dashboard header * chore: add default tab for data quality * removed unneccessary code, and updated testsuite details page with new style * fixed DQ test * translation sync * fix cypress * added functionality to link test case with logical test suite * chore: remove fixed right from status column in column profile tab * fix: purple color issues * fix the count issue in user profile page and breaking of task page * fix: feedbacks * fix: feedbacks * ui improvements * fix cypress for owner and tier * change announcement card color and deleted old assest to it * remove old activity feed files * fix unit test * fix various cypress * fix cypress failues --------- Co-authored-by: Sachin Chaurasiya <sachinchaurasiyachotey87@gmail.com> Co-authored-by: karanh37 <karanh37@gmail.com> Co-authored-by: Shailesh Parmar <shailesh.parmar.webdev@gmail.com> Co-authored-by: Ashish Gupta <ashish@getcollate.io>
2023-06-21 12:59:20 +05:30
removeTier(entity);
};
describe('Add and Remove Owner', () => {
beforeEach(() => {
interceptURL('GET', '/api/v1/permissions/*/name/*', 'entityPermission');
interceptURL('GET', '/api/v1/feed/count?entityLink=*', 'activityFeed');
interceptURL(
'GET',
'/api/v1/search/query?q=**teamType:Group&from=0&size=15&index=team_search_index',
'getTeams'
);
interceptURL('GET', '/api/v1/users?*', 'getUsers');
cy.login();
});
Object.entries(ENTITIES).map(([key, value]) => {
it(`${key} details page`, () => {
visitEntityDetailsPage(
value.term,
value.serviceName,
value.entity,
undefined,
value.entityType
);
verifyResponseStatusCode('@entityPermission', 200);
verifyResponseStatusCode('@activityFeed', 200);
addRemoveOwner(OWNER, value.entity);
});
});
it('databaseSchema details page', () => {
interceptURL('PATCH', '/api/v1/databaseSchemas/*', 'patchOwner');
interceptURL('GET', '/api/v1/*/name/*', 'schemaDetails');
const value = ENTITIES.table;
visitEntityDetailsPage(value.term, value.serviceName, value.entity);
verifyResponseStatusCode('@entityPermission', 200);
verifyResponseStatusCode('@activityFeed', 200);
cy.get('[data-testid="breadcrumb"]')
.should('be.visible')
.contains(value.schema)
.click();
verifyResponseStatusCode('@entityPermission', 200);
verifyResponseStatusCode('@schemaDetails', 200);
verifyResponseStatusCode('@activityFeed', 200);
addRemoveOwner(OWNER, 'databaseSchemas');
});
it('database details page', () => {
interceptURL('PATCH', '/api/v1/databases/*', 'patchOwner');
interceptURL('GET', '/api/v1/databases/name/*', 'databaseDetails');
const value = ENTITIES.table;
visitEntityDetailsPage(value.term, value.serviceName, value.entity);
verifyResponseStatusCode('@entityPermission', 200);
verifyResponseStatusCode('@activityFeed', 200);
cy.get('[data-testid="breadcrumb"]')
.should('be.visible')
.contains(value.database)
.click();
verifyResponseStatusCode('@entityPermission', 200);
verifyResponseStatusCode('@databaseDetails', 200);
verifyResponseStatusCode('@activityFeed', 200);
addRemoveOwner(OWNER, 'databases');
});
it('service details page', () => {
interceptURL('PATCH', '/api/v1/services/databaseServices/*', 'patchOwner');
interceptURL(
'GET',
'/api/v1/services/databaseServices/name/*',
'serviceDetails'
);
interceptURL(
'GET',
'/api/v1/services/ingestionPipelines/status',
'ingestionPipelines'
);
interceptURL('GET', '/api/v1/databases?service=*', 'databases');
const value = ENTITIES.table;
visitEntityDetailsPage(value.term, value.serviceName, value.entity);
verifyResponseStatusCode('@entityPermission', 200);
verifyResponseStatusCode('@activityFeed', 200);
cy.get('[data-testid="breadcrumb"]')
.should('be.visible')
.contains(value.serviceName)
.click();
verifyResponseStatusCode('@entityPermission', 200);
verifyResponseStatusCode('@ingestionPipelines', 200);
verifyResponseStatusCode('@serviceDetails', 200);
verifyResponseStatusCode('@databases', 200);
addRemoveOwner(OWNER, 'databaseServices');
});
it('Test suite details page', () => {
interceptURL('PATCH', '/api/v1/dataQuality/testSuites/*', 'patchOwner');
interceptURL('GET', '/api/v1/dataQuality/testSuites?*', 'testSuites');
interceptURL(
'GET',
`/api/v1/dataQuality/testSuites/name/*`,
'testSuiteDetails'
);
interceptURL('GET', '/api/v1/dataQuality/testCases?*', 'testCases');
cy.get('[data-testid="app-bar-item-data-quality"]')
.should('be.visible')
.click();
verifyResponseStatusCode('@testSuites', 200);
cy.get('[data-testid="by-test-suites"]').click();
verifyResponseStatusCode('@testSuites', 200);
// Get the first test suite from the table.
cy.get(
'[data-testid="test-suite-table"] .ant-table-tbody > :nth-child(1) > :nth-child(1) > a'
).click();
verifyResponseStatusCode('@entityPermission', 200);
verifyResponseStatusCode('@testSuiteDetails', 200);
verifyResponseStatusCode('@testCases', 200);
addRemoveOwner(OWNER, 'testSuites');
});
it('Teams details page', () => {
interceptURL('PATCH', '/api/v1/teams/*', 'patchOwner');
interceptURL('GET', '/api/v1/permissions/team/name/*', 'teamPermission');
interceptURL(
'GET',
'/api/v1/teams/name/Organization?fields=*',
'getOrganization'
);
cy.get('[data-testid="app-bar-item-settings"]')
.should('be.visible')
.click();
verifyResponseStatusCode('@entityPermission', 200);
verifyResponseStatusCode('@getOrganization', 200);
verifyResponseStatusCode('@teamPermission', 200);
addRemoveOwner(OWNER, 'teams');
});
it('Glossary details page', () => {
interceptURL('PATCH', '/api/v1/glossaries/*', 'patchOwner');
interceptURL('POST', '/api/v1/glossaries', 'createGlossary');
interceptURL('GET', '/api/v1/permissions/glossary/*', 'glossaryPermission');
interceptURL('GET', '/api/v1/glossaries?*', 'getGlossaries');
cy.get('[data-testid="governance"]').should('be.visible').click();
cy.get('[data-testid="app-bar-item-glossary"]').click({
waitForAnimations: true,
force: true,
});
verifyResponseStatusCode('@getGlossaries', 200);
cy.get('[data-testid="add-glossary"]').click();
cy.get('[data-testid="name"]').should('be.visible').type(glossary);
cy.get(descriptionBox).scrollIntoView().should('be.visible').type(glossary);
cy.get('[data-testid="save-glossary"]')
.scrollIntoView()
.should('be.visible')
.click();
verifyResponseStatusCode('@createGlossary', 201);
verifyResponseStatusCode('@getGlossaries', 200);
verifyResponseStatusCode('@glossaryPermission', 200);
addRemoveOwner(OWNER, 'glossaries', true);
});
it('GlossaryTerm details page', () => {
interceptURL('PATCH', '/api/v1/glossaryTerms/*', 'patchOwner');
interceptURL('POST', '/api/v1/glossaryTerms', 'createGlossaryTerm');
interceptURL('GET', '/api/v1/permissions/glossary/*', 'glossaryPermission');
interceptURL(
'GET',
'/api/v1/permissions/glossaryTerm/*',
'glossaryTermPermission'
);
interceptURL('GET', '/api/v1/glossaries?*', 'getGlossaries');
interceptURL('GET', '/api/v1/glossaryTerms?*', 'getGlossaryTerms');
interceptURL(
'GET',
'/api/v1/glossaryTerms/name/*',
'getGlossaryTermDetails'
);
cy.get('[data-testid="governance"]').should('be.visible').click();
cy.get('[data-testid="app-bar-item-glossary"]')
.should('be.visible')
.click({ waitForAnimations: true, force: true });
verifyResponseStatusCode('@getGlossaries', 200);
verifyResponseStatusCode('@glossaryPermission', 200);
interceptURL('GET', '/api/v1/glossaryTerms*', 'getGlossaryTerms');
cy.get('.ant-menu-item').contains(glossary).should('be.visible').click();
verifyResponseStatusCode('@getGlossaryTerms', 200);
cy.get('[data-testid="add-new-tag-button-header"]')
.should('be.visible')
.click();
cy.get('[data-testid="name"]').should('be.visible').type(glossaryTerm);
cy.get(descriptionBox)
.scrollIntoView()
.should('be.visible')
.type(glossaryTerm);
cy.get('[data-testid="save-glossary-term"]')
.scrollIntoView()
.should('be.visible')
.click();
verifyResponseStatusCode('@createGlossaryTerm', 201);
verifyResponseStatusCode('@getGlossaryTerms', 200);
cy.get(`[data-testid="${glossaryTerm}"]`).should('be.visible').click();
verifyResponseStatusCode('@getGlossaryTermDetails', 200);
verifyResponseStatusCode('@glossaryTermPermission', 200);
verifyResponseStatusCode('@getGlossaryTerms', 200);
addRemoveOwner(OWNER, 'glossaryTerms', true);
});
it('Delete glossary and glossaryTerm', () => {
interceptURL('GET', '/api/v1/permissions/glossary/*', 'glossaryPermission');
interceptURL('GET', '/api/v1/glossaries?*', 'getGlossaries');
cy.get('[data-testid="governance"]').should('be.visible').click();
cy.get('[data-testid="app-bar-item-glossary"]')
.should('be.visible')
.click({ waitForAnimations: true, force: true });
verifyResponseStatusCode('@getGlossaries', 200);
verifyResponseStatusCode('@glossaryPermission', 200);
interceptURL('GET', '/api/v1/glossaryTerms*', 'getGlossaryTerms');
cy.get('.ant-menu-item').contains(glossary).should('be.visible').click();
verifyResponseStatusCode('@getGlossaryTerms', 200);
cy.get('[data-testid="manage-button"]').should('be.visible').click();
cy.get('[data-testid="delete-button"]')
.scrollIntoView()
.should('be.visible')
.click();
cy.get('[data-testid="delete-confirmation-modal"]')
.should('exist')
.then(() => {
cy.get('[role="dialog"]').should('be.visible');
cy.get('[data-testid="modal-header"]').should('be.visible');
});
cy.get('[data-testid="modal-header"]')
.should('be.visible')
.should('contain', `Delete ${glossary}`);
cy.get('[data-testid="confirmation-text-input"]')
.should('be.visible')
.type(DELETE_TERM);
interceptURL('DELETE', '/api/v1/glossaries/*', 'getGlossary');
cy.get('[data-testid="confirm-button"]')
.should('be.visible')
.should('not.disabled')
.click();
verifyResponseStatusCode('@getGlossary', 200);
});
});
describe('Add and Remove Tier', () => {
beforeEach(() => {
interceptURL('GET', '/api/v1/permissions/*/name/*', 'entityPermission');
interceptURL('GET', '/api/v1/feed/count?entityLink=*', 'activityFeed');
interceptURL(
'GET',
'/api/v1/search/query?q=**teamType:Group&from=0&size=15&index=team_search_index',
'getTeams'
);
interceptURL('GET', '/api/v1/users?&isBot=false&limit=15', 'getUsers');
cy.login();
});
Object.entries(ENTITIES).map(([key, value]) => {
it(`${key} details page`, () => {
visitEntityDetailsPage(
value.term,
value.serviceName,
value.entity,
undefined,
value.entityType
);
verifyResponseStatusCode('@entityPermission', 200);
verifyResponseStatusCode('@activityFeed', 200);
addRemoveTier(TIER, value.entity);
});
});
it('database details page', () => {
interceptURL('GET', '/api/v1/databases/name/*', 'databaseDetails');
const value = ENTITIES.table;
visitEntityDetailsPage(value.term, value.serviceName, value.entity);
verifyResponseStatusCode('@entityPermission', 200);
verifyResponseStatusCode('@activityFeed', 200);
cy.get('[data-testid="breadcrumb"]')
.should('be.visible')
.contains(value.database)
.click();
verifyResponseStatusCode('@entityPermission', 200);
verifyResponseStatusCode('@databaseDetails', 200);
verifyResponseStatusCode('@activityFeed', 200);
addRemoveTier(TIER, 'databases');
});
});