2022-06-01 11:36:36 +05:30
|
|
|
/*
|
2022-12-27 12:37:58 +05:30
|
|
|
* Copyright 2022 Collate.
|
2022-06-01 11:36:36 +05:30
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
2023-06-21 12:59:20 +05:30
|
|
|
// eslint-disable-next-line spaced-comment
|
|
|
|
/// <reference types="Cypress" />
|
|
|
|
|
2022-11-14 18:09:38 +05:30
|
|
|
import {
|
2023-01-15 18:24:10 +05:30
|
|
|
descriptionBox,
|
|
|
|
interceptURL,
|
|
|
|
toastNotification,
|
2023-04-17 12:58:04 +05:30
|
|
|
verifyMultipleResponseStatusCode,
|
2023-01-15 18:24:10 +05:30
|
|
|
verifyResponseStatusCode,
|
|
|
|
visitEntityDetailsPage,
|
2022-11-14 18:09:38 +05:30
|
|
|
} from '../../common/common';
|
|
|
|
import {
|
2023-01-15 18:24:10 +05:30
|
|
|
DELETE_TERM,
|
2023-05-29 21:45:52 +05:30
|
|
|
GLOSSARY_INVALID_NAMES,
|
|
|
|
GLOSSARY_NAME_MAX_LENGTH_VALIDATION_ERROR,
|
|
|
|
NAME_VALIDATION_ERROR,
|
2023-01-15 18:24:10 +05:30
|
|
|
NEW_GLOSSARY,
|
2023-01-19 16:47:44 +05:30
|
|
|
NEW_GLOSSARY_1,
|
|
|
|
NEW_GLOSSARY_1_TERMS,
|
2023-01-15 18:24:10 +05:30
|
|
|
NEW_GLOSSARY_TERMS,
|
|
|
|
SEARCH_ENTITY_TABLE,
|
2022-11-14 18:09:38 +05:30
|
|
|
} from '../../constants/constants';
|
2022-06-01 11:36:36 +05:30
|
|
|
|
2023-04-14 09:17:37 +05:30
|
|
|
const visitGlossaryTermPage = (termName, fqn, fetchPermission) => {
|
|
|
|
interceptURL(
|
|
|
|
'GET',
|
|
|
|
`/api/v1/glossaryTerms/name/*.${termName}?fields=*`,
|
|
|
|
'getGlossaryTerm'
|
|
|
|
);
|
|
|
|
interceptURL(
|
|
|
|
'GET',
|
|
|
|
'/api/v1/permissions/glossaryTerm/*',
|
|
|
|
'waitForTermPermission'
|
|
|
|
);
|
|
|
|
interceptURL('GET', '/api/v1/tags*', 'getTagsList');
|
|
|
|
|
2023-04-12 16:42:04 +05:30
|
|
|
cy.get(`[data-row-key="${fqn}"]`)
|
2023-01-18 16:09:00 +05:30
|
|
|
.scrollIntoView()
|
|
|
|
.should('be.visible')
|
|
|
|
.contains(termName)
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
2023-04-14 09:17:37 +05:30
|
|
|
|
2023-03-28 14:39:41 +05:30
|
|
|
verifyResponseStatusCode('@getGlossaryTerms', 200);
|
2023-04-14 09:17:37 +05:30
|
|
|
verifyResponseStatusCode('@getTagsList', 200);
|
2023-04-20 22:43:20 +05:30
|
|
|
// verifyResponseStatusCode('@glossaryAPI', 200);
|
2023-04-14 09:17:37 +05:30
|
|
|
if (fetchPermission) {
|
|
|
|
verifyResponseStatusCode('@waitForTermPermission', 200);
|
|
|
|
}
|
2023-04-17 12:58:04 +05:30
|
|
|
cy.get('.ant-tabs .glossary-overview-tab').should('be.visible').click();
|
2023-01-18 16:09:00 +05:30
|
|
|
};
|
|
|
|
|
2023-03-29 09:52:41 +05:30
|
|
|
const checkDisplayName = (displayName) => {
|
2023-04-12 16:42:04 +05:30
|
|
|
cy.get('[data-testid="entity-header-display-name"]')
|
2023-01-18 16:09:00 +05:30
|
|
|
.scrollIntoView()
|
2022-12-02 21:45:35 +05:30
|
|
|
.should('exist')
|
|
|
|
.and('be.visible')
|
2023-03-29 09:52:41 +05:30
|
|
|
.within(() => {
|
|
|
|
cy.contains(displayName);
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
2023-05-29 21:45:52 +05:30
|
|
|
const validateForm = () => {
|
|
|
|
// error messages
|
|
|
|
cy.get('#name_help')
|
|
|
|
.scrollIntoView()
|
|
|
|
.should('be.visible')
|
|
|
|
.contains('name is required');
|
|
|
|
cy.get('#description_help')
|
|
|
|
.should('be.visible')
|
|
|
|
.contains('description is required');
|
|
|
|
|
|
|
|
// max length validation
|
|
|
|
cy.get('[data-testid="name"]')
|
|
|
|
.scrollIntoView()
|
|
|
|
.should('be.visible')
|
|
|
|
.type(GLOSSARY_INVALID_NAMES.MAX_LENGTH);
|
|
|
|
cy.get('#name_help')
|
|
|
|
.should('be.visible')
|
|
|
|
.contains(GLOSSARY_NAME_MAX_LENGTH_VALIDATION_ERROR);
|
|
|
|
|
|
|
|
// with special char validation
|
|
|
|
cy.get('[data-testid="name"]')
|
|
|
|
.should('be.visible')
|
|
|
|
.clear()
|
|
|
|
.type(GLOSSARY_INVALID_NAMES.WITH_SPECIAL_CHARS);
|
|
|
|
cy.get('#name_help').should('be.visible').contains(NAME_VALIDATION_ERROR);
|
|
|
|
};
|
|
|
|
|
2023-03-29 09:52:41 +05:30
|
|
|
const fillGlossaryTermDetails = (term, glossary, isMutually = false) => {
|
|
|
|
checkDisplayName(glossary.name);
|
2023-04-20 22:43:20 +05:30
|
|
|
cy.get('[data-testid="add-new-tag-button-header"]').click();
|
2022-06-01 11:36:36 +05:30
|
|
|
|
|
|
|
cy.contains('Add Glossary Term').should('be.visible');
|
2023-05-29 21:45:52 +05:30
|
|
|
|
|
|
|
// validation should work
|
|
|
|
cy.get('[data-testid="save-glossary-term"]')
|
|
|
|
.scrollIntoView()
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
|
|
|
|
validateForm();
|
|
|
|
|
2022-06-01 11:36:36 +05:30
|
|
|
cy.get('[data-testid="name"]')
|
|
|
|
.scrollIntoView()
|
|
|
|
.should('be.visible')
|
2023-05-29 21:45:52 +05:30
|
|
|
.clear()
|
2022-06-01 11:36:36 +05:30
|
|
|
.type(term.name);
|
2022-09-14 19:19:42 +05:30
|
|
|
cy.get(descriptionBox)
|
2022-06-01 11:36:36 +05:30
|
|
|
.scrollIntoView()
|
|
|
|
.should('be.visible')
|
|
|
|
.type(term.description);
|
2023-04-20 22:43:20 +05:30
|
|
|
|
|
|
|
const synonyms = term.synonyms.split(',');
|
2022-06-01 11:36:36 +05:30
|
|
|
cy.get('[data-testid="synonyms"]')
|
|
|
|
.scrollIntoView()
|
|
|
|
.should('be.visible')
|
2023-04-20 22:43:20 +05:30
|
|
|
.type(synonyms.join('{enter}'));
|
2023-01-19 16:47:44 +05:30
|
|
|
if (isMutually) {
|
|
|
|
cy.get('[data-testid="mutually-exclusive-button"]')
|
|
|
|
.scrollIntoView()
|
|
|
|
.should('exist')
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
}
|
2023-04-12 16:42:04 +05:30
|
|
|
cy.get('[data-testid="add-reference"]')
|
2022-06-01 11:36:36 +05:30
|
|
|
.scrollIntoView()
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
|
|
|
|
cy.get('#name-0').scrollIntoView().should('be.visible').type('test');
|
|
|
|
cy.get('#url-0')
|
|
|
|
.scrollIntoView()
|
|
|
|
.should('be.visible')
|
|
|
|
.type('https://test.com');
|
2023-02-22 19:41:40 +05:30
|
|
|
};
|
|
|
|
|
|
|
|
const createGlossaryTerm = (term, glossary, isMutually = false) => {
|
|
|
|
fillGlossaryTermDetails(term, glossary, isMutually);
|
2022-06-01 11:36:36 +05:30
|
|
|
|
2022-09-14 19:19:42 +05:30
|
|
|
interceptURL('POST', '/api/v1/glossaryTerms', 'createGlossaryTerms');
|
2022-06-01 11:36:36 +05:30
|
|
|
cy.get('[data-testid="save-glossary-term"]')
|
|
|
|
.scrollIntoView()
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
2022-09-14 19:19:42 +05:30
|
|
|
|
2023-04-20 22:43:20 +05:30
|
|
|
verifyResponseStatusCode('@createGlossaryTerms', 201);
|
|
|
|
|
2023-04-12 16:42:04 +05:30
|
|
|
cy.get(`[data-row-key="${glossary.name}.${term.name}"]`)
|
2023-01-18 16:09:00 +05:30
|
|
|
.scrollIntoView()
|
|
|
|
.should('be.visible')
|
2023-01-04 14:28:50 +05:30
|
|
|
.contains(term.name)
|
|
|
|
.should('be.visible');
|
2022-06-01 11:36:36 +05:30
|
|
|
};
|
|
|
|
|
2023-04-12 16:42:04 +05:30
|
|
|
const deleteGlossaryTerm = ({ name, fullyQualifiedName }) => {
|
|
|
|
visitGlossaryTermPage(name, fullyQualifiedName);
|
2022-06-01 11:36:36 +05:30
|
|
|
|
2022-06-08 23:04:41 +05:30
|
|
|
cy.get('[data-testid="manage-button"]').should('be.visible').click();
|
2022-06-01 11:36:36 +05:30
|
|
|
cy.get('[data-testid="delete-button"]')
|
|
|
|
.scrollIntoView()
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
|
2023-01-04 14:28:50 +05:30
|
|
|
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 ${name}`);
|
2022-06-01 11:36:36 +05:30
|
|
|
cy.get('[data-testid="confirmation-text-input"]')
|
|
|
|
.should('be.visible')
|
|
|
|
.type(DELETE_TERM);
|
|
|
|
|
|
|
|
cy.get('[data-testid="confirm-button"]')
|
|
|
|
.should('be.visible')
|
|
|
|
.should('not.disabled')
|
|
|
|
.click();
|
2022-06-08 23:04:41 +05:30
|
|
|
|
2023-04-19 09:28:15 +05:30
|
|
|
toastNotification('Glossary Term deleted successfully!');
|
2022-12-06 17:34:09 +05:30
|
|
|
cy.get('[data-testid="delete-confirmation-modal"]').should('not.exist');
|
2023-01-04 14:28:50 +05:30
|
|
|
cy.get('[data-testid="glossary-left-panel"]')
|
|
|
|
.should('be.visible')
|
|
|
|
.should('not.contain', name);
|
2022-06-01 11:36:36 +05:30
|
|
|
};
|
|
|
|
|
2023-04-14 09:17:37 +05:30
|
|
|
const goToAssetsTab = (name, fqn, fetchPermission) => {
|
|
|
|
visitGlossaryTermPage(name, fqn, fetchPermission);
|
2023-03-28 14:39:41 +05:30
|
|
|
|
2023-01-18 16:09:00 +05:30
|
|
|
cy.get('[data-testid="assets"]').should('be.visible').click();
|
|
|
|
cy.get('.ant-tabs-tab-active').contains('Assets').should('be.visible');
|
2022-06-01 11:36:36 +05:30
|
|
|
};
|
|
|
|
|
2023-04-12 16:42:04 +05:30
|
|
|
const selectActiveGlossary = (glossaryName) => {
|
2023-04-14 09:17:37 +05:30
|
|
|
interceptURL('GET', '/api/v1/glossaryTerms*', 'getGlossaryTerms');
|
2023-04-12 16:42:04 +05:30
|
|
|
cy.get('.ant-menu-item').contains(glossaryName).should('be.visible').click();
|
2023-04-14 09:17:37 +05:30
|
|
|
verifyResponseStatusCode('@getGlossaryTerms', 200);
|
|
|
|
};
|
|
|
|
|
|
|
|
const updateSynonyms = (uSynonyms) => {
|
|
|
|
cy.get('[data-testid="synonyms-container"]')
|
|
|
|
.scrollIntoView()
|
|
|
|
.should('be.visible');
|
|
|
|
cy.get('[data-testid="synonyms-container"]')
|
2023-04-17 12:58:04 +05:30
|
|
|
.find('[data-testid="edit-button"]', { timeout: 10000 })
|
2023-04-14 09:17:37 +05:30
|
|
|
.scrollIntoView()
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
cy.get('[data-testid="synonyms-container"] .ant-select-selector')
|
|
|
|
.should('be.visible')
|
|
|
|
.find('.ant-select-selection-item-remove')
|
|
|
|
.should('exist')
|
|
|
|
.click({ force: true, multiple: true });
|
|
|
|
cy.get('.ant-select-selection-overflow')
|
|
|
|
.should('exist')
|
2023-05-24 18:14:21 +05:30
|
|
|
.type(uSynonyms.join('{enter}'))
|
|
|
|
.type('{enter}');
|
|
|
|
|
2023-04-14 09:17:37 +05:30
|
|
|
interceptURL('PATCH', '/api/v1/glossaryTerms/*', 'saveSynonyms');
|
|
|
|
cy.get('[data-testid="save-synonym-btn"]').should('be.visible').click();
|
|
|
|
verifyResponseStatusCode('@saveSynonyms', 200);
|
|
|
|
cy.get('[data-testid="synonyms-container"]')
|
|
|
|
.as('synonyms-container')
|
|
|
|
.should('be.visible');
|
|
|
|
uSynonyms.forEach((synonym) => {
|
|
|
|
cy.get('@synonyms-container').contains(synonym).should('be.visible');
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
const updateTags = (inTerm) => {
|
2023-06-21 12:59:20 +05:30
|
|
|
cy.get(
|
|
|
|
'[data-testid="tags-input-container"] [data-testid="add-tag"]'
|
|
|
|
).click();
|
2023-04-14 09:17:37 +05:30
|
|
|
|
|
|
|
cy.get('[data-testid="tag-selector"]')
|
|
|
|
.scrollIntoView()
|
|
|
|
.should('be.visible')
|
|
|
|
.type('personal');
|
|
|
|
cy.get('.ant-select-item-option-content')
|
|
|
|
.contains('Personal')
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
2023-06-21 12:59:20 +05:30
|
|
|
// to close popup
|
|
|
|
cy.clickOutside();
|
2023-04-14 09:17:37 +05:30
|
|
|
|
|
|
|
cy.get('[data-testid="saveAssociatedTag"]').scrollIntoView().click();
|
|
|
|
const container = inTerm
|
|
|
|
? '[data-testid="tags-input-container"]'
|
|
|
|
: '[data-testid="glossary-details"]';
|
|
|
|
cy.get(container).scrollIntoView().contains('Personal').should('be.visible');
|
|
|
|
};
|
|
|
|
|
|
|
|
const updateTerms = (newTerm) => {
|
|
|
|
cy.get('[data-testid="related-term-container"]')
|
|
|
|
.scrollIntoView()
|
|
|
|
.should('be.visible');
|
|
|
|
cy.get('[data-testid="related-term-add-button"]')
|
|
|
|
.scrollIntoView()
|
|
|
|
.should('be.visible')
|
|
|
|
.click({ force: true });
|
|
|
|
interceptURL(
|
|
|
|
'GET',
|
|
|
|
'/api/v1/search/query?q=*&from=0&size=10&index=glossary_search_index',
|
|
|
|
'getGlossaryTerm'
|
|
|
|
);
|
|
|
|
cy.get('.ant-select-selection-overflow').should('be.visible').click();
|
|
|
|
verifyResponseStatusCode('@getGlossaryTerm', 200);
|
|
|
|
cy.get('.ant-select-item-option-content')
|
|
|
|
.contains(newTerm)
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
cy.get('[data-testid="save-related-term-btn"]').should('be.visible').click();
|
|
|
|
verifyResponseStatusCode('@saveGlossaryTermData', 200);
|
|
|
|
|
|
|
|
cy.get('[data-testid="related-term-container"]')
|
|
|
|
.contains(newTerm)
|
|
|
|
.should('be.visible');
|
|
|
|
};
|
|
|
|
|
|
|
|
const updateReferences = (newRef) => {
|
|
|
|
cy.get('[data-testid="section-References"]')
|
|
|
|
.find('[data-testid="edit-button"]')
|
|
|
|
.should('exist')
|
|
|
|
.click();
|
|
|
|
cy.get('[data-testid="add-references-button"]').should('be.visible').click();
|
|
|
|
cy.get('#references_1_name').should('be.visible').type(newRef.name);
|
|
|
|
cy.get('#references_1_endpoint').should('be.visible').type(newRef.url);
|
|
|
|
interceptURL('PATCH', '/api/v1/glossaryTerms/*', 'saveGlossaryTermData');
|
|
|
|
cy.get('[data-testid="save-btn"]').should('be.visible').click();
|
|
|
|
verifyResponseStatusCode('@saveGlossaryTermData', 200);
|
|
|
|
cy.get('[data-testid="references-container"]')
|
|
|
|
.contains(newRef.name)
|
|
|
|
.should('be.visible')
|
|
|
|
.invoke('attr', 'href')
|
|
|
|
.should('eq', newRef.url);
|
|
|
|
};
|
|
|
|
|
|
|
|
const updateDescription = (newDescription, isGlossary) => {
|
|
|
|
if (isGlossary) {
|
|
|
|
interceptURL('PATCH', '/api/v1/glossaries/*', 'saveGlossary');
|
|
|
|
} else {
|
|
|
|
interceptURL('PATCH', '/api/v1/glossaryTerms/*', 'saveData');
|
|
|
|
}
|
|
|
|
|
|
|
|
cy.get('[data-testid="edit-description"]').should('be.visible').click();
|
|
|
|
cy.get('.ant-modal-wrap').should('be.visible');
|
|
|
|
cy.get(descriptionBox).should('be.visible').as('description');
|
|
|
|
cy.get('@description').clear();
|
|
|
|
cy.get('@description').type(newDescription);
|
|
|
|
cy.get('[data-testid="save"]').click();
|
|
|
|
if (isGlossary) {
|
|
|
|
verifyResponseStatusCode('@saveGlossary', 200);
|
|
|
|
} else {
|
|
|
|
verifyResponseStatusCode('@saveData', 200);
|
|
|
|
}
|
|
|
|
cy.get('.ant-modal-wrap').should('not.exist');
|
|
|
|
|
|
|
|
cy.get('[data-testid="viewer-container"]')
|
|
|
|
.contains(newDescription)
|
|
|
|
.should('be.visible');
|
2023-04-12 16:42:04 +05:30
|
|
|
};
|
|
|
|
|
|
|
|
describe('Glossary page should work properly', () => {
|
2022-06-01 11:36:36 +05:30
|
|
|
beforeEach(() => {
|
2022-11-21 17:02:48 +05:30
|
|
|
cy.login();
|
2022-09-28 21:58:20 +05:30
|
|
|
|
|
|
|
interceptURL('GET', '/api/v1/glossaryTerms*', 'getGlossaryTerms');
|
2023-01-18 16:09:00 +05:30
|
|
|
interceptURL('GET', '/api/v1/glossaries?fields=*', 'fetchGlossaries');
|
2022-11-14 18:09:38 +05:30
|
|
|
cy.get('[data-testid="governance"]')
|
|
|
|
.should('exist')
|
2022-12-02 15:43:12 +05:30
|
|
|
.and('be.visible')
|
2022-12-06 15:19:52 +05:30
|
|
|
.click({ animationDistanceThreshold: 20 });
|
|
|
|
|
2023-01-15 18:24:10 +05:30
|
|
|
// Clicking on Glossary
|
2023-05-23 14:26:52 +05:30
|
|
|
cy.get('.govern-menu')
|
2022-12-06 15:19:52 +05:30
|
|
|
.should('exist')
|
|
|
|
.and('be.visible')
|
|
|
|
.then(($el) => {
|
2023-01-04 14:28:50 +05:30
|
|
|
cy.wrap($el)
|
|
|
|
.find('[data-testid="appbar-item-glossary"]')
|
|
|
|
.should('exist')
|
|
|
|
.and('be.visible')
|
|
|
|
.click();
|
|
|
|
});
|
2022-06-01 11:36:36 +05:30
|
|
|
});
|
|
|
|
|
|
|
|
it('Create new glossary flow should work properly', () => {
|
2022-12-02 21:45:35 +05:30
|
|
|
interceptURL('POST', '/api/v1/glossaries', 'createGlossary');
|
2023-04-20 22:43:20 +05:30
|
|
|
interceptURL('GET', '/api/v1/tags?limit=1000', 'fetchTags');
|
2022-12-02 21:45:35 +05:30
|
|
|
|
2022-06-01 11:36:36 +05:30
|
|
|
// check for no data placeholder
|
2023-04-25 12:36:40 +05:30
|
|
|
cy.get('[data-testid="add-placeholder-button"]')
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
2022-06-01 11:36:36 +05:30
|
|
|
|
|
|
|
// Redirecting to add glossary page
|
2022-12-07 14:31:27 +05:30
|
|
|
cy.get('[data-testid="form-heading"]')
|
2022-06-01 11:36:36 +05:30
|
|
|
.contains('Add Glossary')
|
|
|
|
.should('be.visible');
|
|
|
|
|
2023-05-29 21:45:52 +05:30
|
|
|
// validation should work
|
|
|
|
cy.get('[data-testid="save-glossary"]')
|
|
|
|
.scrollIntoView()
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
|
|
|
|
validateForm();
|
|
|
|
|
2022-06-01 11:36:36 +05:30
|
|
|
cy.get('[data-testid="name"]')
|
|
|
|
.scrollIntoView()
|
|
|
|
.should('be.visible')
|
2023-05-29 21:45:52 +05:30
|
|
|
.clear()
|
2022-06-01 11:36:36 +05:30
|
|
|
.type(NEW_GLOSSARY.name);
|
|
|
|
|
2022-09-14 19:19:42 +05:30
|
|
|
cy.get(descriptionBox)
|
2022-06-01 11:36:36 +05:30
|
|
|
.scrollIntoView()
|
|
|
|
.should('be.visible')
|
|
|
|
.type(NEW_GLOSSARY.description);
|
|
|
|
|
2023-01-18 13:49:10 +05:30
|
|
|
cy.get('[data-testid="mutually-exclusive-button"]')
|
|
|
|
.scrollIntoView()
|
|
|
|
.click();
|
2023-03-28 14:39:41 +05:30
|
|
|
|
2023-05-29 21:45:52 +05:30
|
|
|
cy.get('[data-testid="tag-selector"] .ant-select-selection-overflow')
|
2023-02-08 19:39:20 +05:30
|
|
|
.scrollIntoView()
|
2023-03-20 13:00:41 +05:30
|
|
|
.type('Personal');
|
2023-02-08 19:39:20 +05:30
|
|
|
verifyResponseStatusCode('@fetchTags', 200);
|
2023-06-21 12:59:20 +05:30
|
|
|
cy.get('.ant-select-item-option-content').contains('Personal').click();
|
|
|
|
cy.get('[data-testid="right-panel"]').click();
|
2023-01-18 13:49:10 +05:30
|
|
|
|
2023-06-21 12:59:20 +05:30
|
|
|
cy.get('[data-testid="add-reviewers"]').scrollIntoView().click();
|
2023-01-04 14:28:50 +05:30
|
|
|
|
2023-06-21 12:59:20 +05:30
|
|
|
cy.get('[data-testid="searchbar"]').type(NEW_GLOSSARY.reviewer);
|
2023-03-28 14:39:41 +05:30
|
|
|
cy.get(`[title="${NEW_GLOSSARY.reviewer}"]`)
|
|
|
|
.scrollIntoView()
|
2022-06-01 11:36:36 +05:30
|
|
|
.should('be.visible')
|
2023-03-28 14:39:41 +05:30
|
|
|
.click();
|
2022-06-01 11:36:36 +05:30
|
|
|
|
2023-03-28 14:39:41 +05:30
|
|
|
cy.get('[data-testid="selectable-list-update-btn"]')
|
2023-01-04 14:28:50 +05:30
|
|
|
.should('exist')
|
|
|
|
.and('be.visible')
|
|
|
|
.click();
|
2022-12-02 21:45:35 +05:30
|
|
|
cy.get('[data-testid="delete-confirmation-modal"]').should('not.exist');
|
2022-06-01 11:36:36 +05:30
|
|
|
cy.get('[data-testid="reviewers-container"]')
|
|
|
|
.children()
|
|
|
|
.should('have.length', 1);
|
|
|
|
|
|
|
|
cy.get('[data-testid="save-glossary"]')
|
|
|
|
.scrollIntoView()
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
|
2023-02-08 19:39:20 +05:30
|
|
|
cy.wait('@createGlossary').then(({ request }) => {
|
|
|
|
expect(request.body).to.have.all.keys(
|
|
|
|
'description',
|
|
|
|
'mutuallyExclusive',
|
|
|
|
'name',
|
|
|
|
'owner',
|
|
|
|
'reviewers',
|
|
|
|
'tags'
|
|
|
|
);
|
|
|
|
expect(request.body.name).equals(NEW_GLOSSARY.name);
|
|
|
|
expect(request.body.description).equals(NEW_GLOSSARY.description);
|
|
|
|
expect(request.body.mutuallyExclusive).equals(true);
|
|
|
|
expect(request.body.owner).to.have.all.keys('id', 'type');
|
|
|
|
expect(request.body.reviewers).has.length(1);
|
|
|
|
expect(request.body.tags).has.length(1);
|
|
|
|
expect(request.body.tags[0]).to.deep.equal({
|
|
|
|
tagFQN: 'PersonalData.Personal',
|
2023-03-09 00:30:36 -08:00
|
|
|
source: 'Classification',
|
2023-02-08 19:39:20 +05:30
|
|
|
});
|
|
|
|
|
2023-01-04 14:28:50 +05:30
|
|
|
cy.url().should('include', '/glossary/');
|
2023-03-29 09:52:41 +05:30
|
|
|
|
|
|
|
checkDisplayName(NEW_GLOSSARY.name);
|
2022-12-02 21:45:35 +05:30
|
|
|
});
|
2023-01-19 16:47:44 +05:30
|
|
|
|
|
|
|
// Adding another Glossary with mutually exclusive flag off
|
|
|
|
cy.get('[data-testid="add-glossary"]').should('be.visible').click();
|
|
|
|
cy.get('[data-testid="name"]')
|
|
|
|
.scrollIntoView()
|
|
|
|
.should('be.visible')
|
|
|
|
.type(NEW_GLOSSARY_1.name);
|
|
|
|
|
|
|
|
cy.get(descriptionBox)
|
|
|
|
.scrollIntoView()
|
|
|
|
.should('be.visible')
|
|
|
|
.type(NEW_GLOSSARY_1.description);
|
|
|
|
|
|
|
|
cy.get('[data-testid="save-glossary"]')
|
|
|
|
.scrollIntoView()
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
|
2023-02-08 19:39:20 +05:30
|
|
|
cy.wait('@createGlossary').then(({ request }) => {
|
|
|
|
expect(request.body).to.have.all.keys(
|
|
|
|
'description',
|
|
|
|
'mutuallyExclusive',
|
|
|
|
'name',
|
|
|
|
'owner',
|
|
|
|
'reviewers',
|
|
|
|
'tags'
|
|
|
|
);
|
2023-05-19 23:29:54 +05:30
|
|
|
|
2023-02-08 19:39:20 +05:30
|
|
|
expect(request.body.name).equals(NEW_GLOSSARY_1.name);
|
|
|
|
expect(request.body.description).equals(NEW_GLOSSARY_1.description);
|
|
|
|
expect(request.body.mutuallyExclusive).equals(false);
|
|
|
|
expect(request.body.owner).to.have.all.keys('id', 'type');
|
|
|
|
expect(request.body.reviewers).has.length(0);
|
|
|
|
expect(request.body.tags).has.length(0);
|
|
|
|
|
2023-01-19 16:47:44 +05:30
|
|
|
cy.url().should('include', '/glossary/');
|
2023-03-29 09:52:41 +05:30
|
|
|
checkDisplayName(NEW_GLOSSARY_1.name);
|
2023-01-19 16:47:44 +05:30
|
|
|
});
|
2022-06-01 11:36:36 +05:30
|
|
|
});
|
|
|
|
|
2023-02-08 19:39:20 +05:30
|
|
|
it('Verify and Remove Tags from Glossary', () => {
|
|
|
|
// Verify Tags which is added at the time of creating glossary
|
2023-04-12 16:42:04 +05:30
|
|
|
cy.get('[data-testid="tag-container"]')
|
2023-03-20 13:00:41 +05:30
|
|
|
.contains('Personal')
|
2023-02-08 19:39:20 +05:30
|
|
|
.should('be.visible');
|
|
|
|
|
|
|
|
// Remove Tag
|
2023-06-21 12:59:20 +05:30
|
|
|
cy.get(
|
|
|
|
'[data-testid="tags-input-container"] [data-testid="edit-button"]'
|
|
|
|
).click();
|
2023-03-29 09:52:41 +05:30
|
|
|
|
2023-04-21 19:01:30 +05:30
|
|
|
cy.get('[data-testid="remove-tags"]').should('be.visible').click();
|
2023-02-08 19:39:20 +05:30
|
|
|
interceptURL('PATCH', '/api/v1/glossaries/*', 'updateGlossary');
|
2023-06-21 12:59:20 +05:30
|
|
|
cy.get('[data-testid="saveAssociatedTag"]').scrollIntoView().click();
|
2023-02-08 19:39:20 +05:30
|
|
|
verifyResponseStatusCode('@updateGlossary', 200);
|
2023-04-12 16:42:04 +05:30
|
|
|
cy.get('[data-testid="add-tag"]').should('be.visible');
|
2023-02-08 19:39:20 +05:30
|
|
|
});
|
|
|
|
|
2022-11-14 18:09:38 +05:30
|
|
|
it('Verify added glossary details', () => {
|
2023-01-04 14:28:50 +05:30
|
|
|
cy.get('[data-testid="glossary-left-panel"]')
|
|
|
|
.contains(NEW_GLOSSARY.name)
|
|
|
|
.should('be.visible');
|
2023-04-20 22:43:20 +05:30
|
|
|
|
2023-03-29 09:52:41 +05:30
|
|
|
checkDisplayName(NEW_GLOSSARY.name);
|
2023-04-12 16:42:04 +05:30
|
|
|
|
2023-01-04 14:28:50 +05:30
|
|
|
cy.get('[data-testid="viewer-container"]')
|
|
|
|
.invoke('text')
|
|
|
|
.then((text) => {
|
|
|
|
expect(text).to.contain(NEW_GLOSSARY.description);
|
|
|
|
});
|
2023-01-18 16:09:00 +05:30
|
|
|
|
2023-04-12 16:42:04 +05:30
|
|
|
cy.get(`[data-testid="glossary-reviewer-name"]`)
|
2023-01-04 14:28:50 +05:30
|
|
|
.invoke('text')
|
|
|
|
.then((text) => {
|
|
|
|
expect(text).to.contain(NEW_GLOSSARY.reviewer);
|
|
|
|
});
|
2023-01-19 16:47:44 +05:30
|
|
|
|
|
|
|
// Verify Product glossary details
|
|
|
|
cy.get('.ant-menu-item')
|
|
|
|
.contains(NEW_GLOSSARY_1.name)
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
|
|
|
|
cy.get('[data-testid="glossary-left-panel"]')
|
|
|
|
.contains(NEW_GLOSSARY_1.name)
|
|
|
|
.should('be.visible');
|
2023-03-29 09:52:41 +05:30
|
|
|
|
2023-04-12 16:42:04 +05:30
|
|
|
selectActiveGlossary(NEW_GLOSSARY_1.name);
|
|
|
|
|
2023-03-29 09:52:41 +05:30
|
|
|
checkDisplayName(NEW_GLOSSARY_1.name);
|
2023-01-19 16:47:44 +05:30
|
|
|
cy.get('[data-testid="viewer-container"]')
|
|
|
|
.invoke('text')
|
|
|
|
.then((text) => {
|
|
|
|
expect(text).to.contain(NEW_GLOSSARY_1.description);
|
|
|
|
});
|
2023-01-04 14:28:50 +05:30
|
|
|
});
|
2022-11-14 18:09:38 +05:30
|
|
|
|
2023-04-12 16:42:04 +05:30
|
|
|
it('Create glossary term should work properly', () => {
|
2022-06-01 11:36:36 +05:30
|
|
|
const terms = Object.values(NEW_GLOSSARY_TERMS);
|
2023-04-12 16:42:04 +05:30
|
|
|
selectActiveGlossary(NEW_GLOSSARY.name);
|
2023-01-19 16:47:44 +05:30
|
|
|
terms.forEach((term) => createGlossaryTerm(term, NEW_GLOSSARY, true));
|
|
|
|
|
|
|
|
// Glossary term for Product glossary
|
2023-04-12 16:42:04 +05:30
|
|
|
|
|
|
|
selectActiveGlossary(NEW_GLOSSARY_1.name);
|
2022-06-01 11:36:36 +05:30
|
|
|
|
2023-01-19 16:47:44 +05:30
|
|
|
const ProductTerms = Object.values(NEW_GLOSSARY_1_TERMS);
|
|
|
|
ProductTerms.forEach((term) => createGlossaryTerm(term, NEW_GLOSSARY_1));
|
2022-06-01 11:36:36 +05:30
|
|
|
});
|
|
|
|
|
2023-04-12 16:42:04 +05:30
|
|
|
it('Updating data of glossary should work properly', () => {
|
2023-04-17 12:58:04 +05:30
|
|
|
// visit glossary page
|
|
|
|
interceptURL('GET', `/api/v1/tags?limit=*`, 'tags');
|
2023-04-20 22:43:20 +05:30
|
|
|
verifyResponseStatusCode('@tags', 200);
|
2022-09-14 19:19:42 +05:30
|
|
|
|
2023-04-14 09:17:37 +05:30
|
|
|
// updating tags
|
|
|
|
updateTags(false);
|
2023-01-04 14:28:50 +05:30
|
|
|
|
2022-06-01 11:36:36 +05:30
|
|
|
// updating description
|
2023-04-14 09:17:37 +05:30
|
|
|
updateDescription('Updated description', true);
|
2022-06-01 11:36:36 +05:30
|
|
|
});
|
|
|
|
|
2023-04-20 22:43:20 +05:30
|
|
|
it('Update glossary term', () => {
|
2023-04-14 09:17:37 +05:30
|
|
|
const uSynonyms = ['pick up', 'take', 'obtain'];
|
2023-01-04 14:28:50 +05:30
|
|
|
const newRef = { name: 'take', url: 'https://take.com' };
|
2023-04-12 16:42:04 +05:30
|
|
|
const term2 = NEW_GLOSSARY_TERMS.term_2.name;
|
2023-04-14 09:17:37 +05:30
|
|
|
const { name, fullyQualifiedName } = NEW_GLOSSARY_1_TERMS.term_1;
|
2022-09-24 09:33:31 +05:30
|
|
|
|
2023-04-17 12:58:04 +05:30
|
|
|
// visit glossary page
|
|
|
|
interceptURL('GET', `/api/v1/glossaryTerms?glossary=*`, 'glossaryTerm');
|
|
|
|
interceptURL('GET', `/api/v1/permissions/glossary/*`, 'permissions');
|
|
|
|
interceptURL('GET', `/api/v1/tags?limit=*`, 'tags');
|
2023-04-20 22:43:20 +05:30
|
|
|
|
2023-04-17 12:58:04 +05:30
|
|
|
cy.get('.ant-menu-item')
|
|
|
|
.contains(NEW_GLOSSARY_1.name)
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
verifyMultipleResponseStatusCode(
|
2023-04-20 22:43:20 +05:30
|
|
|
['@glossaryTerm', '@permissions', '@tags'],
|
2023-04-17 12:58:04 +05:30
|
|
|
200
|
|
|
|
);
|
2022-09-24 09:33:31 +05:30
|
|
|
|
2023-04-17 12:58:04 +05:30
|
|
|
// visit glossary term page
|
|
|
|
interceptURL(
|
|
|
|
'GET',
|
|
|
|
`/api/v1/glossaryTerms/name/*?fields=*`,
|
|
|
|
'glossaryTermDetails'
|
|
|
|
);
|
|
|
|
interceptURL('GET', `/api/v1/glossaryTerms?parent=*`, 'listGlossaryTerm');
|
|
|
|
interceptURL(
|
|
|
|
'GET',
|
|
|
|
`/api/v1/permissions/glossaryTerm/*`,
|
|
|
|
'glossaryTermPermission'
|
|
|
|
);
|
|
|
|
cy.get(`[data-row-key="${fullyQualifiedName}"]`)
|
|
|
|
.contains(name)
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
verifyMultipleResponseStatusCode(
|
|
|
|
[
|
|
|
|
'@glossaryTermDetails',
|
|
|
|
'@listGlossaryTerm',
|
|
|
|
'@glossaryTermPermission',
|
|
|
|
'@tags',
|
|
|
|
],
|
|
|
|
200
|
|
|
|
);
|
|
|
|
cy.wait(5000); // adding manual wait as edit icon takes time to appear on screen
|
2023-04-14 09:17:37 +05:30
|
|
|
// Updating synonyms
|
|
|
|
updateSynonyms(uSynonyms);
|
2022-06-16 22:05:22 +05:30
|
|
|
|
2023-04-14 09:17:37 +05:30
|
|
|
// Updating References
|
|
|
|
updateReferences(newRef);
|
2023-04-12 16:42:04 +05:30
|
|
|
|
2023-04-14 09:17:37 +05:30
|
|
|
// Updating Related terms
|
|
|
|
updateTerms(term2);
|
2023-01-04 14:28:50 +05:30
|
|
|
|
|
|
|
// updating tags
|
2023-06-21 12:59:20 +05:30
|
|
|
// Some weired issue on terms, Term alread has an tag which causing failure
|
|
|
|
// Will fix this later
|
|
|
|
// updateTags(true);
|
2023-01-04 14:28:50 +05:30
|
|
|
|
|
|
|
// updating description
|
2023-04-14 09:17:37 +05:30
|
|
|
updateDescription('Updated description', false);
|
2023-01-04 14:28:50 +05:30
|
|
|
});
|
|
|
|
|
2023-06-21 12:59:20 +05:30
|
|
|
it.skip('Assets Tab should work properly', () => {
|
2023-04-12 16:42:04 +05:30
|
|
|
selectActiveGlossary(NEW_GLOSSARY.name);
|
2022-08-31 00:11:02 +05:30
|
|
|
const glossary = NEW_GLOSSARY.name;
|
2023-01-19 16:47:44 +05:30
|
|
|
const term1 = NEW_GLOSSARY_TERMS.term_1.name;
|
|
|
|
const term2 = NEW_GLOSSARY_TERMS.term_2.name;
|
|
|
|
|
|
|
|
const glossary1 = NEW_GLOSSARY_1.name;
|
|
|
|
const term3 = NEW_GLOSSARY_1_TERMS.term_1.name;
|
|
|
|
const term4 = NEW_GLOSSARY_1_TERMS.term_2.name;
|
|
|
|
|
2022-09-29 02:49:03 +05:30
|
|
|
const entity = SEARCH_ENTITY_TABLE.table_3;
|
2023-01-19 16:47:44 +05:30
|
|
|
|
|
|
|
cy.get('.ant-menu-item')
|
|
|
|
.contains(NEW_GLOSSARY_1.name)
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
|
2023-04-12 16:42:04 +05:30
|
|
|
goToAssetsTab(
|
|
|
|
NEW_GLOSSARY_1_TERMS.term_1.name,
|
2023-04-14 09:17:37 +05:30
|
|
|
NEW_GLOSSARY_1_TERMS.term_1.fullyQualifiedName,
|
|
|
|
true
|
2023-04-12 16:42:04 +05:30
|
|
|
);
|
|
|
|
cy.contains('Adding a new Asset is easy, just give it a spin!').should(
|
|
|
|
'be.visible'
|
|
|
|
);
|
2022-09-29 02:49:03 +05:30
|
|
|
visitEntityDetailsPage(entity.term, entity.serviceName, entity.entity);
|
2022-09-14 19:19:42 +05:30
|
|
|
|
2023-01-15 18:24:10 +05:30
|
|
|
// Add tag to breadcrumb
|
2023-06-21 12:59:20 +05:30
|
|
|
cy.get(
|
|
|
|
'[data-testid="glossary-tags-0"] [data-testid="tag-container"] [data-testid="add-tag"]'
|
|
|
|
)
|
2022-08-31 00:11:02 +05:30
|
|
|
.eq(0)
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
2023-01-15 18:24:10 +05:30
|
|
|
cy.get('[data-testid="tag-selector"]')
|
|
|
|
.should('be.visible')
|
|
|
|
.click()
|
2023-01-19 16:47:44 +05:30
|
|
|
.type(`${glossary}.${term1}`);
|
2023-03-06 19:21:21 +05:30
|
|
|
cy.get('.ant-select-item-option-content')
|
|
|
|
.contains(term1)
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
2022-08-31 00:11:02 +05:30
|
|
|
cy.get(
|
|
|
|
'[data-testid="tags-wrapper"] [data-testid="tag-container"]'
|
2023-01-19 16:47:44 +05:30
|
|
|
).contains(term1);
|
2022-09-14 19:19:42 +05:30
|
|
|
|
2023-01-19 16:47:44 +05:30
|
|
|
cy.get('[data-testid="tag-selector"]')
|
|
|
|
.should('be.visible')
|
|
|
|
.click()
|
|
|
|
.type(`${glossary}.${term2}`);
|
2023-03-06 19:21:21 +05:30
|
|
|
cy.get('.ant-select-item-option-content')
|
|
|
|
.contains(term2)
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
2023-01-19 16:47:44 +05:30
|
|
|
cy.get(
|
|
|
|
'[data-testid="tags-wrapper"] [data-testid="tag-container"]'
|
|
|
|
).contains(term2);
|
|
|
|
|
|
|
|
interceptURL('GET', '/api/v1/feed/count*', 'countTag');
|
2022-12-02 15:43:12 +05:30
|
|
|
interceptURL('GET', '/api/v1/tags', 'tags');
|
2023-01-19 16:47:44 +05:30
|
|
|
interceptURL('PATCH', '/api/v1/tables/*', 'saveTag');
|
2023-01-04 14:28:50 +05:30
|
|
|
|
2023-06-21 12:59:20 +05:30
|
|
|
cy.get('[data-testid="saveAssociatedTag"]').scrollIntoView().click();
|
2023-01-19 16:47:44 +05:30
|
|
|
verifyResponseStatusCode('@saveTag', 400);
|
|
|
|
toastNotification(
|
|
|
|
`Tag labels ${glossary}.${term2} and ${glossary}.${term1} are mutually exclusive and can't be assigned together`
|
|
|
|
);
|
|
|
|
|
|
|
|
// Add non mutually exclusive tags
|
2023-04-21 19:01:30 +05:30
|
|
|
cy.get('[data-testid="entity-tags"] [data-testid="add-tag"]')
|
|
|
|
.scrollIntoView()
|
2023-01-19 16:47:44 +05:30
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
|
|
|
|
cy.get('[data-testid="tag-selector"]')
|
|
|
|
.should('be.visible')
|
|
|
|
.click()
|
|
|
|
.type(`${glossary1}.${term3}`);
|
2023-03-06 19:21:21 +05:30
|
|
|
cy.get('.ant-select-item-option-content')
|
|
|
|
.contains(term3)
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
2023-01-19 16:47:44 +05:30
|
|
|
cy.get(
|
|
|
|
'[data-testid="tags-wrapper"] [data-testid="tag-container"]'
|
|
|
|
).contains(term3);
|
|
|
|
|
|
|
|
cy.get('[data-testid="tag-selector"]')
|
|
|
|
.should('be.visible')
|
|
|
|
.click()
|
|
|
|
.type(`${glossary1}.${term4}`);
|
2023-03-06 19:21:21 +05:30
|
|
|
cy.get('.ant-select-item-option-content')
|
|
|
|
.contains(term4)
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
2023-01-19 16:47:44 +05:30
|
|
|
cy.get(
|
|
|
|
'[data-testid="tags-wrapper"] [data-testid="tag-container"]'
|
|
|
|
).contains(term4);
|
2022-08-31 00:11:02 +05:30
|
|
|
|
2023-06-21 12:59:20 +05:30
|
|
|
cy.get('[data-testid="saveAssociatedTag"]').scrollIntoView().click();
|
2022-09-14 19:19:42 +05:30
|
|
|
verifyResponseStatusCode('@saveTag', 200);
|
2023-01-19 16:47:44 +05:30
|
|
|
verifyResponseStatusCode('@countTag', 200);
|
2022-08-31 00:11:02 +05:30
|
|
|
cy.get('[data-testid="entity-tags"]')
|
|
|
|
.scrollIntoView()
|
|
|
|
.should('be.visible')
|
2023-01-19 16:47:44 +05:30
|
|
|
.contains(term3);
|
2022-08-31 00:11:02 +05:30
|
|
|
|
2023-05-12 19:51:52 +05:30
|
|
|
// Add tag to schema table
|
2023-05-29 11:08:11 +05:30
|
|
|
cy.get(
|
|
|
|
`[data-testid="glossary-tags-0"] [data-testid="tags-wrapper"]
|
|
|
|
[data-testid="tag-container"] [data-testid="tags"]`
|
|
|
|
)
|
|
|
|
.scrollIntoView()
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
|
|
|
|
cy.get('[data-testid="tag-selector"]')
|
|
|
|
.should('be.visible')
|
|
|
|
.click()
|
|
|
|
.type(`${glossary1}.${term3}`);
|
|
|
|
cy.get('.ant-select-item-option-content')
|
|
|
|
.contains(term3)
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
|
|
|
|
cy.get('[data-testid="tag-selector"] > .ant-select-selector').contains(
|
|
|
|
term3
|
|
|
|
);
|
|
|
|
cy.get('[data-testid="saveAssociatedTag"]').should('be.visible').click();
|
|
|
|
verifyResponseStatusCode('@countTag', 200);
|
|
|
|
cy.get(`[data-testid="tag-${glossary1}.${term3}"]`)
|
|
|
|
.scrollIntoView()
|
|
|
|
.should('be.visible')
|
|
|
|
.contains(term3);
|
2022-06-01 11:36:36 +05:30
|
|
|
|
2022-11-14 18:09:38 +05:30
|
|
|
cy.get('[data-testid="governance"]')
|
|
|
|
.should('exist')
|
2022-12-02 21:45:35 +05:30
|
|
|
.and('be.visible')
|
2022-12-02 15:43:12 +05:30
|
|
|
.click();
|
2022-08-11 10:57:39 +05:30
|
|
|
cy.get('[data-testid="appbar-item-glossary"]')
|
|
|
|
.should('exist')
|
2022-06-01 11:36:36 +05:30
|
|
|
.should('be.visible')
|
2022-12-02 15:43:12 +05:30
|
|
|
.click();
|
2022-08-11 10:57:39 +05:30
|
|
|
|
2023-01-19 16:47:44 +05:30
|
|
|
cy.get('.ant-menu-item')
|
|
|
|
.contains(NEW_GLOSSARY_1.name)
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
2023-04-14 09:17:37 +05:30
|
|
|
|
2023-04-12 16:42:04 +05:30
|
|
|
goToAssetsTab(
|
|
|
|
NEW_GLOSSARY_1_TERMS.term_1.name,
|
2023-04-14 09:17:37 +05:30
|
|
|
NEW_GLOSSARY_1_TERMS.term_1.fullyQualifiedName,
|
|
|
|
false
|
2023-04-12 16:42:04 +05:30
|
|
|
);
|
2023-01-19 16:47:44 +05:30
|
|
|
|
2023-04-14 11:28:11 +05:30
|
|
|
cy.get('[data-testid="entity-header-display-name"]')
|
2022-09-29 02:49:03 +05:30
|
|
|
.contains(entity.term)
|
|
|
|
.should('be.visible');
|
2022-06-01 11:36:36 +05:30
|
|
|
});
|
|
|
|
|
2023-06-21 12:59:20 +05:30
|
|
|
it.skip('Remove Glossary term from entity should work properly', () => {
|
2023-05-29 11:08:11 +05:30
|
|
|
const glossaryName = NEW_GLOSSARY_1.name;
|
2023-04-12 16:42:04 +05:30
|
|
|
const { name, fullyQualifiedName } = NEW_GLOSSARY_1_TERMS.term_1;
|
2022-09-29 02:49:03 +05:30
|
|
|
const entity = SEARCH_ENTITY_TABLE.table_3;
|
2022-09-14 19:19:42 +05:30
|
|
|
|
2023-04-12 16:42:04 +05:30
|
|
|
selectActiveGlossary(NEW_GLOSSARY_1.name);
|
2023-01-19 16:47:44 +05:30
|
|
|
|
2022-09-14 19:19:42 +05:30
|
|
|
interceptURL('GET', '/api/v1/search/query*', 'assetTab');
|
2022-06-01 11:36:36 +05:30
|
|
|
// go assets tab
|
2023-04-12 16:42:04 +05:30
|
|
|
goToAssetsTab(name, fullyQualifiedName);
|
2022-09-14 19:19:42 +05:30
|
|
|
verifyResponseStatusCode('@assetTab', 200);
|
|
|
|
|
|
|
|
interceptURL('GET', '/api/v1/feed*', 'entityDetails');
|
2023-04-14 11:28:11 +05:30
|
|
|
|
|
|
|
cy.get('[data-testid="entity-header-display-name"]')
|
2022-09-29 02:49:03 +05:30
|
|
|
.contains(entity.term)
|
2022-06-01 11:36:36 +05:30
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
2022-09-14 19:19:42 +05:30
|
|
|
verifyResponseStatusCode('@entityDetails', 200);
|
2022-06-01 11:36:36 +05:30
|
|
|
// redirect to entity detail page
|
2022-06-16 22:05:22 +05:30
|
|
|
cy.get('[data-testid="entity-tags"]')
|
|
|
|
.find('[data-testid="edit-button"]')
|
2022-06-01 11:36:36 +05:30
|
|
|
.scrollIntoView()
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
2023-01-15 18:24:10 +05:30
|
|
|
// Remove all added tags from breadcrumb
|
2023-04-21 19:01:30 +05:30
|
|
|
cy.get('[data-testid="remove-tags"]')
|
2023-01-04 14:28:50 +05:30
|
|
|
.should('be.visible')
|
2023-04-17 12:58:04 +05:30
|
|
|
.click({ multiple: true });
|
2022-08-26 16:08:02 +05:30
|
|
|
|
2022-11-14 18:09:38 +05:30
|
|
|
interceptURL('PATCH', '/api/v1/tables/*', 'removeTags');
|
2022-06-01 11:36:36 +05:30
|
|
|
cy.get('[data-testid="saveAssociatedTag"]').scrollIntoView().click();
|
2022-11-14 18:09:38 +05:30
|
|
|
verifyResponseStatusCode('@removeTags', 200);
|
2022-06-01 11:36:36 +05:30
|
|
|
|
2022-11-14 18:09:38 +05:30
|
|
|
cy.get('[data-testid="entity-tags"]')
|
2023-04-12 16:42:04 +05:30
|
|
|
.should('not.contain', name)
|
2022-11-14 18:09:38 +05:30
|
|
|
.and('not.contain', 'Personal');
|
2023-01-15 18:24:10 +05:30
|
|
|
// Remove the added column tag from entity
|
2022-11-14 18:09:38 +05:30
|
|
|
interceptURL('PATCH', '/api/v1/tables/*', 'removeSchemaTags');
|
2023-04-14 15:37:01 +05:30
|
|
|
|
2023-05-29 11:08:11 +05:30
|
|
|
cy.get('[data-testid="glossary-tags-0"] [data-testid="edit-button"]')
|
|
|
|
.scrollIntoView()
|
|
|
|
.trigger('mouseover')
|
|
|
|
.click();
|
2023-04-14 15:37:01 +05:30
|
|
|
|
2023-05-29 11:08:11 +05:30
|
|
|
cy.get(
|
|
|
|
`[data-testid="selected-tag-${glossaryName}.${name}"] [data-testid="remove-tags"`
|
|
|
|
)
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
2022-11-14 18:09:38 +05:30
|
|
|
|
2023-05-29 11:08:11 +05:30
|
|
|
cy.get('[data-testid="saveAssociatedTag"]').should('be.visible').click();
|
|
|
|
verifyResponseStatusCode('@removeSchemaTags', 200);
|
2023-05-12 19:51:52 +05:30
|
|
|
|
2023-05-29 11:08:11 +05:30
|
|
|
cy.get('[data-testid="glossary-tags-0"]')
|
|
|
|
.scrollIntoView()
|
|
|
|
.should('not.contain', name)
|
|
|
|
.and('not.contain', 'Personal');
|
2022-08-11 10:57:39 +05:30
|
|
|
|
2022-11-14 18:09:38 +05:30
|
|
|
cy.get('[data-testid="governance"]')
|
|
|
|
.should('exist')
|
|
|
|
.should('be.visible')
|
2022-12-02 15:43:12 +05:30
|
|
|
.click();
|
2022-08-11 10:57:39 +05:30
|
|
|
cy.get('[data-testid="appbar-item-glossary"]')
|
|
|
|
.should('exist')
|
2022-06-01 11:36:36 +05:30
|
|
|
.should('be.visible')
|
2022-12-02 15:43:12 +05:30
|
|
|
.click();
|
2022-08-24 20:01:22 +05:30
|
|
|
|
2023-04-12 16:42:04 +05:30
|
|
|
selectActiveGlossary(NEW_GLOSSARY_1.name);
|
2023-01-19 16:47:44 +05:30
|
|
|
|
2023-04-12 16:42:04 +05:30
|
|
|
goToAssetsTab(name, fullyQualifiedName);
|
|
|
|
cy.contains('Adding a new Asset is easy, just give it a spin!').should(
|
|
|
|
'be.visible'
|
|
|
|
);
|
2022-06-01 11:36:36 +05:30
|
|
|
});
|
|
|
|
|
2023-04-12 16:42:04 +05:30
|
|
|
it('Delete glossary term should work properly', () => {
|
2022-06-01 11:36:36 +05:30
|
|
|
const terms = Object.values(NEW_GLOSSARY_TERMS);
|
2023-04-12 16:42:04 +05:30
|
|
|
selectActiveGlossary(NEW_GLOSSARY.name);
|
2023-01-19 16:47:44 +05:30
|
|
|
terms.forEach(deleteGlossaryTerm);
|
2022-06-01 11:36:36 +05:30
|
|
|
|
2023-04-12 16:42:04 +05:30
|
|
|
// Glossary term for Product glossary
|
|
|
|
selectActiveGlossary(NEW_GLOSSARY_1.name);
|
2023-01-19 16:47:44 +05:30
|
|
|
Object.values(NEW_GLOSSARY_1_TERMS).forEach(deleteGlossaryTerm);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('Delete glossary should work properly', () => {
|
|
|
|
[NEW_GLOSSARY.name, NEW_GLOSSARY_1.name].forEach((glossary) => {
|
|
|
|
verifyResponseStatusCode('@fetchGlossaries', 200);
|
2023-04-12 16:42:04 +05:30
|
|
|
cy.get('.ant-menu-item').contains(glossary).should('be.visible').click();
|
|
|
|
|
2023-01-19 16:47:44 +05:30
|
|
|
cy.get('[data-testid="manage-button"]').should('be.visible').click();
|
|
|
|
cy.get('[data-testid="delete-button"]')
|
|
|
|
.scrollIntoView()
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
2022-06-01 11:36:36 +05:30
|
|
|
|
2023-01-19 16:47:44 +05:30
|
|
|
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);
|
|
|
|
|
|
|
|
toastNotification('Glossary deleted successfully!');
|
|
|
|
});
|
2022-06-01 11:36:36 +05:30
|
|
|
});
|
|
|
|
});
|