Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

917 lines
31 KiB
TypeScript
Raw Normal View History

/*
* Copyright 2024 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.
*/
import test, { expect } from '@playwright/test';
import { get } from 'lodash';
import { SidebarItem } from '../../constant/sidebar';
import { DashboardClass } from '../../support/entity/DashboardClass';
import { EntityTypeEndpoint } from '../../support/entity/Entity.interface';
import { TableClass } from '../../support/entity/TableClass';
import { TopicClass } from '../../support/entity/TopicClass';
import { Glossary } from '../../support/glossary/Glossary';
import { GlossaryTerm } from '../../support/glossary/GlossaryTerm';
import { TeamClass } from '../../support/team/TeamClass';
import { UserClass } from '../../support/user/UserClass';
import { performAdminLogin } from '../../utils/admin';
import {
getRandomLastName,
redirectToHomePage,
toastNotification,
Issue #17012: Multi User/Team Ownership (#17013) * Add multiple owners * Multi Ownership * Issue #17012: Multi User/Team Ownership * Issue #17012: Multi User/Team Ownership * Issue #17012: Multi User/Team Ownership - Fix Tests - Part 1 * Issue #17012: Multi User/Team Ownership - Fix Tests - Part 2 * Issue #17012: Multi User/Team Ownership - Fix Tests - Part 3 * Issue #17012: Multi User/Team Ownership - Fix Tests - Part 4 * Issue #17012: Multi User/Team Ownership - Fix Tests - Part 5 * Issue #17012: Multi User/Team Ownership - Fix Tests - Part 6 * Issue #17012: Multi User/Team Ownership - Fix Tests - Part 7 * Issue #17012: Multi User/Team Ownership - Fix Tests - Part 8 * Add Migrations for Owner Thread * update ingestion for multi owner * fix pytests * fixed checkstyle * Add Alert Name to Publishers (#17108) * Add Alert Name to Publishers * Fix Test * Add Bound to Setuptools (#17105) * Minor: fixed testSummaryGraph issue (#17115) * feat: updated multi pipeline ui as per new mock (#17106) * feat: updated multi pipeline ui as per new mock * translation sync * fixed failing unit test * fixed playwright test * fixed viewService click issue * sorted pipeline based on test case length * Added domo federated dataset support (#17061) * fix usernames (#17122) * Doc: Updated Doris & Redshift Docs (#17123) Co-authored-by: Prajwal Pandit <prajwalpandit@Prajwals-MacBook-Air.local> * Fix #12677: Added Synapse Connector - docs and side docs (#17041) * Fix #17098: Fixed case sensitive partition column name in Bigquery (#17104) * Fixed case sensitive partiion col name bigquery * update test * #13876: change placement of comment and close button in task approval workflow (#17044) * change placment of comment and close button in task approval workflow * minor change * playwright test for the close and comment function * supported ref in activityFeedEditor * fix playwright test * added playwright test for data steward * fix the test for the data streward user * fix the close button not showing if task has no suggestions and icon fixes * fix sonar issue * change glossary and add suggestion button to dropdown button * fix the glossary failure due to button change * icon change for add tag and description * fix glossary cypress failure due to button chnages * changes as per comments * MINOR: docs links fix (#17125) * alation link fix * dbt yaml config source link fix * bigquery doc fix * Explore tree feedbacks (#17078) * fix explore design * update switcher icon * show menu when search query exists * fix selection of active service * fix type error * fix tests * fix tests * fix tests * MINOR: Databricks view TableType fix (#17124) * Minor: fixed AUT test (#17128) * Fix #16692: Override Lineage Support for View & Dashboard Lineage (#17064) * #17065: fix the tags not rendering in selector after selection in edit tags task (#17107) * fix the tags not rendering in selector after selection in edit tags taks * added playwright test * minor changes * minor fix * fix the tags not updating in edit and accept tag * fix explore type changes for collate (#17131) * MINOR: changed log level to debug (#17126) * changed log level to debug * fixed type * changed type to optional * Get feed and count data of soft deleted user (#17135) * Doc: Adding OIDC Docs (#17139) Co-authored-by: Prajwal Pandit <prajwalpandit@Prajwals-MacBook-Air.local> * Doc: Updating Profiler Workflow Docs URL (#17140) Co-authored-by: Prajwal Pandit <prajwalpandit@Prajwals-MacBook-Air.local> * fix playwright and cypress (#17138) * Minor: fixed edit modal issue for sql test case (#17132) * Minor: fixed edit modal issue for sql test case * fixed test * Minor: Added whats new content for 1.4.6 release (#17148) * MINOR [GEN-799]: add option to disable manual trigger using scheduleType (#17031) * fix: raise for triggering system app * added scheduleType ScheduledOrManual * minor: remove "service" field from required properties in createAPIEndpoint schema (#17147) * initial commit multi ownership * update glossary and other entities * update owners * fix version pages * fix tests * Update entity_extension to move owner to array (#17200) * fix tests * fix api page errors * fix owner label design * locales * fix owners in elastic search source * fix types * fix tests * fix tests * Updated CustomMetric owner to entityReferenceList. (#17211) * Fix owners field in search mappings * fix search aggregates * fix inherited label * Issue #17012: Multi User/Team Ownership - Fix Tests - Part 9 * Fix QUeries * Fix Mysql Queries * Typo * fix tests * fix tests * fix tests * fix advanced search constants * fix service ingestion tests * fix tests --------- Co-authored-by: mohitdeuex <mohit.y@deuexsolutions.com> Co-authored-by: Onkar Ravgan <onkar.10r@gmail.com> Co-authored-by: Mohit Yadav <105265192+mohityadav766@users.noreply.github.com> Co-authored-by: Ayush Shah <ayush@getcollate.io> Co-authored-by: Shailesh Parmar <shailesh.parmar.webdev@gmail.com> Co-authored-by: k.nakagaki <141020064+nakaken-churadata@users.noreply.github.com> Co-authored-by: Prajwal214 <167504578+Prajwal214@users.noreply.github.com> Co-authored-by: Prajwal Pandit <prajwalpandit@Prajwals-MacBook-Air.local> Co-authored-by: Suman Maharana <sumanmaharana786@gmail.com> Co-authored-by: Ashish Gupta <ashish@getcollate.io> Co-authored-by: harshsoni2024 <64592571+harshsoni2024@users.noreply.github.com> Co-authored-by: Karan Hotchandani <33024356+karanh37@users.noreply.github.com> Co-authored-by: Mayur Singal <39544459+ulixius9@users.noreply.github.com> Co-authored-by: Imri Paran <imri.paran@gmail.com> Co-authored-by: sonika-shah <58761340+sonika-shah@users.noreply.github.com> Co-authored-by: Sachin Chaurasiya <sachinchaurasiyachotey87@gmail.com> Co-authored-by: karanh37 <karanh37@gmail.com> Co-authored-by: Siddhant <86899184+Siddhanttimeline@users.noreply.github.com>
2024-07-29 23:06:39 -07:00
uuid,
} from '../../utils/common';
import {
addMultiOwner,
assignGlossaryTerm,
assignTag,
updateDescription,
} from '../../utils/entity';
import {
addAssetToGlossaryTerm,
addReferences,
addRelatedTerms,
addSynonyms,
approveGlossaryTermTask,
approveTagsTask,
assignTagToGlossaryTerm,
changeTermHierarchyFromModal,
confirmationDragAndDropGlossary,
createDescriptionTaskForGlossary,
createGlossary,
createGlossaryTerms,
createTagTaskForGlossary,
deleteGlossaryOrGlossaryTerm,
dragAndDropTerm,
goToAssetsTab,
renameGlossaryTerm,
selectActiveGlossary,
selectActiveGlossaryTerm,
validateGlossaryTerm,
verifyGlossaryDetails,
verifyGlossaryTermAssets,
} from '../../utils/glossary';
import { sidebarClick } from '../../utils/sidebar';
import { TaskDetails } from '../../utils/task';
import { performUserLogin } from '../../utils/user';
const user1 = new UserClass();
const user2 = new UserClass();
const team = new TeamClass();
test.describe('Glossary tests', () => {
test.beforeAll(async ({ browser }) => {
const { afterAction, apiContext } = await performAdminLogin(browser);
await user2.create(apiContext);
await user1.create(apiContext);
team.data.users = [user2.responseData.id];
await team.create(apiContext);
await afterAction();
});
test('Glossary & terms creation for reviewer as user', async ({
browser,
}) => {
test.slow(true);
const { page, afterAction, apiContext } = await performAdminLogin(browser);
const { page: page1, afterAction: afterActionUser1 } =
await performUserLogin(browser, user1);
const glossary1 = new Glossary();
Issue #17012: Multi User/Team Ownership (#17013) * Add multiple owners * Multi Ownership * Issue #17012: Multi User/Team Ownership * Issue #17012: Multi User/Team Ownership * Issue #17012: Multi User/Team Ownership - Fix Tests - Part 1 * Issue #17012: Multi User/Team Ownership - Fix Tests - Part 2 * Issue #17012: Multi User/Team Ownership - Fix Tests - Part 3 * Issue #17012: Multi User/Team Ownership - Fix Tests - Part 4 * Issue #17012: Multi User/Team Ownership - Fix Tests - Part 5 * Issue #17012: Multi User/Team Ownership - Fix Tests - Part 6 * Issue #17012: Multi User/Team Ownership - Fix Tests - Part 7 * Issue #17012: Multi User/Team Ownership - Fix Tests - Part 8 * Add Migrations for Owner Thread * update ingestion for multi owner * fix pytests * fixed checkstyle * Add Alert Name to Publishers (#17108) * Add Alert Name to Publishers * Fix Test * Add Bound to Setuptools (#17105) * Minor: fixed testSummaryGraph issue (#17115) * feat: updated multi pipeline ui as per new mock (#17106) * feat: updated multi pipeline ui as per new mock * translation sync * fixed failing unit test * fixed playwright test * fixed viewService click issue * sorted pipeline based on test case length * Added domo federated dataset support (#17061) * fix usernames (#17122) * Doc: Updated Doris & Redshift Docs (#17123) Co-authored-by: Prajwal Pandit <prajwalpandit@Prajwals-MacBook-Air.local> * Fix #12677: Added Synapse Connector - docs and side docs (#17041) * Fix #17098: Fixed case sensitive partition column name in Bigquery (#17104) * Fixed case sensitive partiion col name bigquery * update test * #13876: change placement of comment and close button in task approval workflow (#17044) * change placment of comment and close button in task approval workflow * minor change * playwright test for the close and comment function * supported ref in activityFeedEditor * fix playwright test * added playwright test for data steward * fix the test for the data streward user * fix the close button not showing if task has no suggestions and icon fixes * fix sonar issue * change glossary and add suggestion button to dropdown button * fix the glossary failure due to button change * icon change for add tag and description * fix glossary cypress failure due to button chnages * changes as per comments * MINOR: docs links fix (#17125) * alation link fix * dbt yaml config source link fix * bigquery doc fix * Explore tree feedbacks (#17078) * fix explore design * update switcher icon * show menu when search query exists * fix selection of active service * fix type error * fix tests * fix tests * fix tests * MINOR: Databricks view TableType fix (#17124) * Minor: fixed AUT test (#17128) * Fix #16692: Override Lineage Support for View & Dashboard Lineage (#17064) * #17065: fix the tags not rendering in selector after selection in edit tags task (#17107) * fix the tags not rendering in selector after selection in edit tags taks * added playwright test * minor changes * minor fix * fix the tags not updating in edit and accept tag * fix explore type changes for collate (#17131) * MINOR: changed log level to debug (#17126) * changed log level to debug * fixed type * changed type to optional * Get feed and count data of soft deleted user (#17135) * Doc: Adding OIDC Docs (#17139) Co-authored-by: Prajwal Pandit <prajwalpandit@Prajwals-MacBook-Air.local> * Doc: Updating Profiler Workflow Docs URL (#17140) Co-authored-by: Prajwal Pandit <prajwalpandit@Prajwals-MacBook-Air.local> * fix playwright and cypress (#17138) * Minor: fixed edit modal issue for sql test case (#17132) * Minor: fixed edit modal issue for sql test case * fixed test * Minor: Added whats new content for 1.4.6 release (#17148) * MINOR [GEN-799]: add option to disable manual trigger using scheduleType (#17031) * fix: raise for triggering system app * added scheduleType ScheduledOrManual * minor: remove "service" field from required properties in createAPIEndpoint schema (#17147) * initial commit multi ownership * update glossary and other entities * update owners * fix version pages * fix tests * Update entity_extension to move owner to array (#17200) * fix tests * fix api page errors * fix owner label design * locales * fix owners in elastic search source * fix types * fix tests * fix tests * Updated CustomMetric owner to entityReferenceList. (#17211) * Fix owners field in search mappings * fix search aggregates * fix inherited label * Issue #17012: Multi User/Team Ownership - Fix Tests - Part 9 * Fix QUeries * Fix Mysql Queries * Typo * fix tests * fix tests * fix tests * fix advanced search constants * fix service ingestion tests * fix tests --------- Co-authored-by: mohitdeuex <mohit.y@deuexsolutions.com> Co-authored-by: Onkar Ravgan <onkar.10r@gmail.com> Co-authored-by: Mohit Yadav <105265192+mohityadav766@users.noreply.github.com> Co-authored-by: Ayush Shah <ayush@getcollate.io> Co-authored-by: Shailesh Parmar <shailesh.parmar.webdev@gmail.com> Co-authored-by: k.nakagaki <141020064+nakaken-churadata@users.noreply.github.com> Co-authored-by: Prajwal214 <167504578+Prajwal214@users.noreply.github.com> Co-authored-by: Prajwal Pandit <prajwalpandit@Prajwals-MacBook-Air.local> Co-authored-by: Suman Maharana <sumanmaharana786@gmail.com> Co-authored-by: Ashish Gupta <ashish@getcollate.io> Co-authored-by: harshsoni2024 <64592571+harshsoni2024@users.noreply.github.com> Co-authored-by: Karan Hotchandani <33024356+karanh37@users.noreply.github.com> Co-authored-by: Mayur Singal <39544459+ulixius9@users.noreply.github.com> Co-authored-by: Imri Paran <imri.paran@gmail.com> Co-authored-by: sonika-shah <58761340+sonika-shah@users.noreply.github.com> Co-authored-by: Sachin Chaurasiya <sachinchaurasiyachotey87@gmail.com> Co-authored-by: karanh37 <karanh37@gmail.com> Co-authored-by: Siddhant <86899184+Siddhanttimeline@users.noreply.github.com>
2024-07-29 23:06:39 -07:00
glossary1.data.owners = [{ name: 'admin', type: 'user' }];
glossary1.data.mutuallyExclusive = true;
glossary1.data.reviewers = [
{ name: `${user1.data.firstName}${user1.data.lastName}`, type: 'user' },
];
glossary1.data.terms = [new GlossaryTerm(glossary1)];
await test.step('Create Glossary', async () => {
await sidebarClick(page, SidebarItem.GLOSSARY);
await createGlossary(page, glossary1.data, false);
await verifyGlossaryDetails(page, glossary1.data);
});
await test.step('Create Glossary Terms', async () => {
await sidebarClick(page, SidebarItem.GLOSSARY);
await createGlossaryTerms(page, glossary1.data);
});
await test.step('Approve Glossary Term from Glossary Listing', async () => {
await redirectToHomePage(page1);
await sidebarClick(page1, SidebarItem.GLOSSARY);
await selectActiveGlossary(page1, glossary1.data.name);
await approveGlossaryTermTask(page1, glossary1.data.terms[0].data);
await redirectToHomePage(page1);
await sidebarClick(page1, SidebarItem.GLOSSARY);
await selectActiveGlossary(page1, glossary1.data.name);
await validateGlossaryTerm(
page1,
glossary1.data.terms[0].data,
'Approved'
);
await afterActionUser1();
});
await glossary1.delete(apiContext);
await afterAction();
});
test('Glossary & terms creation for reviewer as team', async ({
browser,
}) => {
test.slow(true);
const { page, afterAction, apiContext } = await performAdminLogin(browser);
const { page: page1, afterAction: afterActionUser1 } =
await performUserLogin(browser, user2);
const glossary2 = new Glossary();
Issue #17012: Multi User/Team Ownership (#17013) * Add multiple owners * Multi Ownership * Issue #17012: Multi User/Team Ownership * Issue #17012: Multi User/Team Ownership * Issue #17012: Multi User/Team Ownership - Fix Tests - Part 1 * Issue #17012: Multi User/Team Ownership - Fix Tests - Part 2 * Issue #17012: Multi User/Team Ownership - Fix Tests - Part 3 * Issue #17012: Multi User/Team Ownership - Fix Tests - Part 4 * Issue #17012: Multi User/Team Ownership - Fix Tests - Part 5 * Issue #17012: Multi User/Team Ownership - Fix Tests - Part 6 * Issue #17012: Multi User/Team Ownership - Fix Tests - Part 7 * Issue #17012: Multi User/Team Ownership - Fix Tests - Part 8 * Add Migrations for Owner Thread * update ingestion for multi owner * fix pytests * fixed checkstyle * Add Alert Name to Publishers (#17108) * Add Alert Name to Publishers * Fix Test * Add Bound to Setuptools (#17105) * Minor: fixed testSummaryGraph issue (#17115) * feat: updated multi pipeline ui as per new mock (#17106) * feat: updated multi pipeline ui as per new mock * translation sync * fixed failing unit test * fixed playwright test * fixed viewService click issue * sorted pipeline based on test case length * Added domo federated dataset support (#17061) * fix usernames (#17122) * Doc: Updated Doris & Redshift Docs (#17123) Co-authored-by: Prajwal Pandit <prajwalpandit@Prajwals-MacBook-Air.local> * Fix #12677: Added Synapse Connector - docs and side docs (#17041) * Fix #17098: Fixed case sensitive partition column name in Bigquery (#17104) * Fixed case sensitive partiion col name bigquery * update test * #13876: change placement of comment and close button in task approval workflow (#17044) * change placment of comment and close button in task approval workflow * minor change * playwright test for the close and comment function * supported ref in activityFeedEditor * fix playwright test * added playwright test for data steward * fix the test for the data streward user * fix the close button not showing if task has no suggestions and icon fixes * fix sonar issue * change glossary and add suggestion button to dropdown button * fix the glossary failure due to button change * icon change for add tag and description * fix glossary cypress failure due to button chnages * changes as per comments * MINOR: docs links fix (#17125) * alation link fix * dbt yaml config source link fix * bigquery doc fix * Explore tree feedbacks (#17078) * fix explore design * update switcher icon * show menu when search query exists * fix selection of active service * fix type error * fix tests * fix tests * fix tests * MINOR: Databricks view TableType fix (#17124) * Minor: fixed AUT test (#17128) * Fix #16692: Override Lineage Support for View & Dashboard Lineage (#17064) * #17065: fix the tags not rendering in selector after selection in edit tags task (#17107) * fix the tags not rendering in selector after selection in edit tags taks * added playwright test * minor changes * minor fix * fix the tags not updating in edit and accept tag * fix explore type changes for collate (#17131) * MINOR: changed log level to debug (#17126) * changed log level to debug * fixed type * changed type to optional * Get feed and count data of soft deleted user (#17135) * Doc: Adding OIDC Docs (#17139) Co-authored-by: Prajwal Pandit <prajwalpandit@Prajwals-MacBook-Air.local> * Doc: Updating Profiler Workflow Docs URL (#17140) Co-authored-by: Prajwal Pandit <prajwalpandit@Prajwals-MacBook-Air.local> * fix playwright and cypress (#17138) * Minor: fixed edit modal issue for sql test case (#17132) * Minor: fixed edit modal issue for sql test case * fixed test * Minor: Added whats new content for 1.4.6 release (#17148) * MINOR [GEN-799]: add option to disable manual trigger using scheduleType (#17031) * fix: raise for triggering system app * added scheduleType ScheduledOrManual * minor: remove "service" field from required properties in createAPIEndpoint schema (#17147) * initial commit multi ownership * update glossary and other entities * update owners * fix version pages * fix tests * Update entity_extension to move owner to array (#17200) * fix tests * fix api page errors * fix owner label design * locales * fix owners in elastic search source * fix types * fix tests * fix tests * Updated CustomMetric owner to entityReferenceList. (#17211) * Fix owners field in search mappings * fix search aggregates * fix inherited label * Issue #17012: Multi User/Team Ownership - Fix Tests - Part 9 * Fix QUeries * Fix Mysql Queries * Typo * fix tests * fix tests * fix tests * fix advanced search constants * fix service ingestion tests * fix tests --------- Co-authored-by: mohitdeuex <mohit.y@deuexsolutions.com> Co-authored-by: Onkar Ravgan <onkar.10r@gmail.com> Co-authored-by: Mohit Yadav <105265192+mohityadav766@users.noreply.github.com> Co-authored-by: Ayush Shah <ayush@getcollate.io> Co-authored-by: Shailesh Parmar <shailesh.parmar.webdev@gmail.com> Co-authored-by: k.nakagaki <141020064+nakaken-churadata@users.noreply.github.com> Co-authored-by: Prajwal214 <167504578+Prajwal214@users.noreply.github.com> Co-authored-by: Prajwal Pandit <prajwalpandit@Prajwals-MacBook-Air.local> Co-authored-by: Suman Maharana <sumanmaharana786@gmail.com> Co-authored-by: Ashish Gupta <ashish@getcollate.io> Co-authored-by: harshsoni2024 <64592571+harshsoni2024@users.noreply.github.com> Co-authored-by: Karan Hotchandani <33024356+karanh37@users.noreply.github.com> Co-authored-by: Mayur Singal <39544459+ulixius9@users.noreply.github.com> Co-authored-by: Imri Paran <imri.paran@gmail.com> Co-authored-by: sonika-shah <58761340+sonika-shah@users.noreply.github.com> Co-authored-by: Sachin Chaurasiya <sachinchaurasiyachotey87@gmail.com> Co-authored-by: karanh37 <karanh37@gmail.com> Co-authored-by: Siddhant <86899184+Siddhanttimeline@users.noreply.github.com>
2024-07-29 23:06:39 -07:00
glossary2.data.owners = [{ name: 'admin', type: 'user' }];
glossary2.data.reviewers = [{ name: team.data.displayName, type: 'team' }];
glossary2.data.terms = [new GlossaryTerm(glossary2)];
await test.step('Create Glossary', async () => {
await sidebarClick(page, SidebarItem.GLOSSARY);
await createGlossary(page, glossary2.data, false);
await verifyGlossaryDetails(page, glossary2.data);
});
await test.step('Create Glossary Terms', async () => {
await redirectToHomePage(page);
await sidebarClick(page, SidebarItem.GLOSSARY);
await createGlossaryTerms(page, glossary2.data);
});
await test.step('Approve Glossary Term from Glossary Listing', async () => {
await redirectToHomePage(page1);
await sidebarClick(page1, SidebarItem.GLOSSARY);
await selectActiveGlossary(page1, glossary2.data.name);
await approveGlossaryTermTask(page1, glossary2.data.terms[0].data);
await redirectToHomePage(page1);
await sidebarClick(page1, SidebarItem.GLOSSARY);
await selectActiveGlossary(page1, glossary2.data.name);
await validateGlossaryTerm(
page1,
glossary2.data.terms[0].data,
'Approved'
);
await afterActionUser1();
});
await glossary2.delete(apiContext);
await afterAction();
});
test('Update Glossary and Glossary Term', async ({ browser }) => {
test.slow(true);
const { page, afterAction, apiContext } = await performAdminLogin(browser);
const glossary1 = new Glossary();
const glossaryTerm1 = new GlossaryTerm(glossary1);
const glossaryTerm2 = new GlossaryTerm(glossary1);
glossary1.data.terms = [glossaryTerm1, glossaryTerm2];
const user3 = new UserClass();
const user4 = new UserClass();
await glossary1.create(apiContext);
await glossaryTerm1.create(apiContext);
await glossaryTerm2.create(apiContext);
await user3.create(apiContext);
await user4.create(apiContext);
try {
await test.step('Update Glossary', async () => {
await sidebarClick(page, SidebarItem.GLOSSARY);
await selectActiveGlossary(page, glossary1.data.displayName);
// Update description
await updateDescription(page, 'Demo description to be updated');
// Update Owners
await addMultiOwner({
page,
ownerNames: [user3.getUserName()],
activatorBtnDataTestId: 'add-owner',
resultTestId: 'glossary-right-panel-owner-link',
endpoint: EntityTypeEndpoint.Glossary,
isSelectableInsideForm: false,
type: 'Users',
});
// Update Reviewer
await addMultiOwner({
page,
ownerNames: [user3.getUserName()],
activatorBtnDataTestId: 'Add',
resultTestId: 'glossary-reviewer-name',
endpoint: EntityTypeEndpoint.Glossary,
type: 'Users',
});
await assignTag(page, 'PersonalData.Personal');
});
await test.step('Update Glossary Term', async () => {
await redirectToHomePage(page);
await sidebarClick(page, SidebarItem.GLOSSARY);
await selectActiveGlossary(page, glossary1.data.displayName);
await selectActiveGlossaryTerm(page, glossaryTerm1.data.displayName);
// Update description
await updateDescription(page, 'Demo description to be updated');
// Update Synonyms
await addSynonyms(page, [getRandomLastName(), getRandomLastName()]);
// Update References
const references = [
{ name: getRandomLastName(), url: 'http://example.com' },
{ name: getRandomLastName(), url: 'http://trial.com' },
];
await addReferences(page, references);
// Update Related Terms
await addRelatedTerms(page, [glossaryTerm2]);
// Update Tag
await assignTagToGlossaryTerm(
page,
'PersonalData.Personal',
'Add',
'panel-container'
);
});
} finally {
await glossaryTerm1.delete(apiContext);
await glossaryTerm2.delete(apiContext);
await glossary1.delete(apiContext);
await user3.delete(apiContext);
await user4.delete(apiContext);
await afterAction();
}
});
test('Add and Remove Assets', async ({ browser }) => {
test.slow(true);
const { page, afterAction, apiContext } = await performAdminLogin(browser);
const glossary1 = new Glossary();
const glossaryTerm1 = new GlossaryTerm(glossary1);
const glossaryTerm2 = new GlossaryTerm(glossary1);
glossary1.data.mutuallyExclusive = true;
glossary1.data.terms = [glossaryTerm1, glossaryTerm2];
const glossary2 = new Glossary();
const glossaryTerm3 = new GlossaryTerm(glossary2);
const glossaryTerm4 = new GlossaryTerm(glossary2);
glossary2.data.terms = [glossaryTerm3, glossaryTerm4];
await glossary1.create(apiContext);
await glossary2.create(apiContext);
await glossaryTerm1.create(apiContext);
await glossaryTerm2.create(apiContext);
await glossaryTerm3.create(apiContext);
await glossaryTerm4.create(apiContext);
const dashboardEntity = new DashboardClass();
await dashboardEntity.create(apiContext);
try {
await test.step('Add asset to glossary term using entity', async () => {
await sidebarClick(page, SidebarItem.GLOSSARY);
await selectActiveGlossary(page, glossary2.data.displayName);
await goToAssetsTab(page, glossaryTerm3.data.displayName);
await page.waitForSelector(
'text=Adding a new Asset is easy, just give it a spin!'
);
await dashboardEntity.visitEntityPage(page);
// Dashboard Entity Right Panel
await page.click(
'[data-testid="entity-right-panel"] [data-testid="glossary-container"] [data-testid="add-tag"]'
);
// Select 1st term
await page.click('[data-testid="tag-selector"] #tagsForm_tags');
const glossaryRequest = page.waitForResponse(
`/api/v1/search/query?q=*&index=glossary_term_search_index&from=0&size=25&deleted=false&track_total_hits=true&getHierarchy=true`
);
await page.type(
'[data-testid="tag-selector"] #tagsForm_tags',
glossaryTerm1.data.name
);
await glossaryRequest;
await page.getByText(glossaryTerm1.data.displayName).click();
await page.waitForSelector(
'[data-testid="tag-selector"]:has-text("' +
glossaryTerm1.data.displayName +
'")'
);
// Select 2nd term
await page.click('[data-testid="tag-selector"] #tagsForm_tags');
const glossaryRequest2 = page.waitForResponse(
`/api/v1/search/query?q=*&index=glossary_term_search_index&from=0&size=25&deleted=false&track_total_hits=true&getHierarchy=true`
);
await page.type(
'[data-testid="tag-selector"] #tagsForm_tags',
glossaryTerm2.data.name
);
await glossaryRequest2;
await page.getByText(glossaryTerm2.data.displayName).click();
await page.waitForSelector(
'[data-testid="tag-selector"]:has-text("' +
glossaryTerm2.data.displayName +
'")'
);
const patchRequest = page.waitForResponse(`/api/v1/dashboards/*`);
await expect(page.getByTestId('saveAssociatedTag')).toBeEnabled();
await page.getByTestId('saveAssociatedTag').click();
await patchRequest;
await toastNotification(
page,
/mutually exclusive and can't be assigned together/
);
// Add non mutually exclusive tags
await page.click(
'[data-testid="entity-right-panel"] [data-testid="glossary-container"] [data-testid="add-tag"]'
);
// Select 1st term
await page.click('[data-testid="tag-selector"] #tagsForm_tags');
const glossaryRequest3 = page.waitForResponse(
`/api/v1/search/query?q=*&index=glossary_term_search_index&from=0&size=25&deleted=false&track_total_hits=true&getHierarchy=true`
);
await page.type(
'[data-testid="tag-selector"] #tagsForm_tags',
glossaryTerm3.data.name
);
await glossaryRequest3;
await page.getByText(glossaryTerm3.data.displayName).click();
await page.waitForSelector(
'[data-testid="tag-selector"]:has-text("' +
glossaryTerm3.data.displayName +
'")'
);
// Select 2nd term
await page.click('[data-testid="tag-selector"] #tagsForm_tags');
const glossaryRequest4 = page.waitForResponse(
`/api/v1/search/query?q=*&index=glossary_term_search_index&from=0&size=25&deleted=false&track_total_hits=true&getHierarchy=true`
);
await page.type(
'[data-testid="tag-selector"] #tagsForm_tags',
glossaryTerm4.data.name
);
await glossaryRequest4;
await page.getByText(glossaryTerm4.data.displayName).click();
await page.waitForSelector(
'[data-testid="tag-selector"]:has-text("' +
glossaryTerm4.data.displayName +
'")'
);
const patchRequest2 = page.waitForResponse(`/api/v1/dashboards/*`);
await expect(page.getByTestId('saveAssociatedTag')).toBeEnabled();
await page.getByTestId('saveAssociatedTag').click();
await patchRequest2;
// Check if the terms are present
const glossaryContainer = await page.locator(
'[data-testid="entity-right-panel"] [data-testid="glossary-container"]'
);
const glossaryContainerText = await glossaryContainer.innerText();
expect(glossaryContainerText).toContain(glossaryTerm3.data.displayName);
expect(glossaryContainerText).toContain(glossaryTerm4.data.displayName);
// Check if the icons are present
const icons = await page.locator(
'[data-testid="entity-right-panel"] [data-testid="glossary-container"] [data-testid="glossary-icon"]'
);
expect(await icons.count()).toBe(2);
// Add Glossary to Dashboard Charts
await page.click(
'[data-testid="glossary-tags-0"] > [data-testid="tags-wrapper"] > [data-testid="glossary-container"] > [data-testid="entity-tags"] [data-testid="add-tag"]'
);
await page.click('[data-testid="tag-selector"]');
const glossaryRequest5 = page.waitForResponse(
`/api/v1/search/query?q=*&index=glossary_term_search_index&from=0&size=25&deleted=false&track_total_hits=true&getHierarchy=true`
);
await page.type(
'[data-testid="tag-selector"] #tagsForm_tags',
glossaryTerm3.data.name
);
await glossaryRequest5;
await page
.getByRole('tree')
.getByTestId(`tag-${glossaryTerm3.data.fullyQualifiedName}`)
.click();
await page.waitForSelector(
'[data-testid="tag-selector"]:has-text("' +
glossaryTerm3.data.displayName +
'")'
);
const patchRequest3 = page.waitForResponse(`/api/v1/charts/*`);
await expect(page.getByTestId('saveAssociatedTag')).toBeEnabled();
await page.getByTestId('saveAssociatedTag').click();
await patchRequest3;
// Check if the term is present
const tagSelectorText = await page
.locator(
'[data-testid="glossary-tags-0"] [data-testid="glossary-container"] [data-testid="tags"]'
)
.innerText();
expect(tagSelectorText).toContain(glossaryTerm3.data.displayName);
// Check if the icon is visible
const icon = await page.locator(
'[data-testid="glossary-tags-0"] > [data-testid="tags-wrapper"] > [data-testid="glossary-container"] [data-testid="glossary-icon"]'
);
expect(await icon.isVisible()).toBe(true);
await sidebarClick(page, SidebarItem.GLOSSARY);
await selectActiveGlossary(page, glossary2.data.displayName);
await goToAssetsTab(page, glossaryTerm3.data.displayName, 2);
// Check if the selected asset are present
const assetContainer = await page.locator(
'[data-testid="table-container"] .assets-data-container'
);
const assetContainerText = await assetContainer.innerText();
expect(assetContainerText).toContain(dashboardEntity.entity.name);
expect(assetContainerText).toContain(dashboardEntity.charts.name);
});
} finally {
await glossaryTerm1.delete(apiContext);
await glossaryTerm2.delete(apiContext);
await glossaryTerm3.delete(apiContext);
await glossaryTerm4.delete(apiContext);
await glossary1.delete(apiContext);
await glossary2.delete(apiContext);
await dashboardEntity.delete(apiContext);
await afterAction();
}
});
test('Rename Glossary Term and verify assets', async ({ browser }) => {
test.slow(true);
const { page, afterAction, apiContext } = await performAdminLogin(browser);
const table = new TableClass();
const topic = new TopicClass();
const dashboard = new DashboardClass();
await table.create(apiContext);
await topic.create(apiContext);
await dashboard.create(apiContext);
const glossary1 = new Glossary();
const glossaryTerm1 = new GlossaryTerm(glossary1);
glossary1.data.terms = [glossaryTerm1];
await glossary1.create(apiContext);
await glossaryTerm1.create(apiContext);
const assets = [table, topic, dashboard];
try {
await test.step('Rename Glossary Term', async () => {
const newName = `PW.${uuid()}%${getRandomLastName()}`;
await redirectToHomePage(page);
await sidebarClick(page, SidebarItem.GLOSSARY);
await selectActiveGlossary(page, glossary1.data.displayName);
await goToAssetsTab(page, glossaryTerm1.data.displayName);
await addAssetToGlossaryTerm(page, assets);
await renameGlossaryTerm(page, glossaryTerm1, newName);
await verifyGlossaryTermAssets(
page,
glossary1.data,
glossaryTerm1.data,
assets.length
);
});
await test.step('Rename the same entity again', async () => {
const newName = `PW Space.${uuid()}%${getRandomLastName()}`;
await redirectToHomePage(page);
await sidebarClick(page, SidebarItem.GLOSSARY);
await selectActiveGlossary(page, glossary1.data.displayName);
await goToAssetsTab(
page,
glossaryTerm1.data.displayName,
assets.length
);
await renameGlossaryTerm(page, glossaryTerm1, newName);
await verifyGlossaryTermAssets(
page,
glossary1.data,
glossaryTerm1.data,
assets.length
);
});
} finally {
await table.delete(apiContext);
await topic.delete(apiContext);
await dashboard.delete(apiContext);
await glossaryTerm1.delete(apiContext);
await glossary1.delete(apiContext);
await afterAction();
}
});
test('Drag and Drop Glossary Term', async ({ browser }) => {
const { page, afterAction, apiContext } = await performAdminLogin(browser);
const glossary1 = new Glossary();
const glossaryTerm1 = new GlossaryTerm(glossary1);
const glossaryTerm2 = new GlossaryTerm(glossary1);
glossary1.data.terms = [glossaryTerm1, glossaryTerm2];
try {
await glossary1.create(apiContext);
await glossaryTerm1.create(apiContext);
await glossaryTerm2.create(apiContext);
await sidebarClick(page, SidebarItem.GLOSSARY);
await selectActiveGlossary(page, glossary1.data.displayName);
await test.step('Drag and Drop Glossary Term', async () => {
await dragAndDropTerm(
page,
glossaryTerm1.data.displayName,
glossaryTerm2.data.displayName
);
await confirmationDragAndDropGlossary(
page,
glossaryTerm1.data.name,
glossaryTerm2.data.name
);
await expect(
page.getByRole('cell', {
name: glossaryTerm1.responseData.displayName,
})
).not.toBeVisible();
const termRes = page.waitForResponse('/api/v1/glossaryTerms?*');
// verify the term is moved under the parent term
await page.getByTestId('expand-collapse-all-button').click();
await termRes;
await expect(
page.getByRole('cell', {
name: glossaryTerm1.responseData.displayName,
})
).toBeVisible();
});
await test.step(
'Drag and Drop Glossary Term back at parent level',
async () => {
await redirectToHomePage(page);
await sidebarClick(page, SidebarItem.GLOSSARY);
await selectActiveGlossary(page, glossary1.data.displayName);
await page.getByTestId('expand-collapse-all-button').click();
await dragAndDropTerm(
page,
glossaryTerm1.data.displayName,
'Terms' // Header Cell
);
await confirmationDragAndDropGlossary(
page,
glossaryTerm1.data.name,
glossary1.responseData.displayName,
true
);
// verify the term is moved back at parent level
await expect(
page.getByRole('cell', {
name: glossaryTerm1.responseData.displayName,
})
).toBeVisible();
}
);
} finally {
await glossaryTerm1.delete(apiContext);
await glossaryTerm2.delete(apiContext);
await glossary1.delete(apiContext);
await afterAction();
}
});
test('Change glossary term hierarchy using menu options', async ({
browser,
}) => {
const { page, afterAction, apiContext } = await performAdminLogin(browser);
const glossary1 = new Glossary();
const glossaryTerm1 = new GlossaryTerm(glossary1);
const glossaryTerm2 = new GlossaryTerm(glossary1);
glossary1.data.terms = [glossaryTerm1, glossaryTerm2];
try {
await glossary1.create(apiContext);
await glossaryTerm1.create(apiContext);
await glossaryTerm2.create(apiContext);
await sidebarClick(page, SidebarItem.GLOSSARY);
await selectActiveGlossary(page, glossary1.data.displayName);
await changeTermHierarchyFromModal(
page,
glossaryTerm1.data.displayName,
glossaryTerm2.data.displayName
);
await sidebarClick(page, SidebarItem.GLOSSARY);
await selectActiveGlossary(page, glossary1.data.displayName);
await expect(
page.getByRole('cell', {
name: glossaryTerm1.responseData.displayName,
})
).not.toBeVisible();
const termRes = page.waitForResponse('/api/v1/glossaryTerms?*');
// verify the term is moved under the parent term
await page.getByTestId('expand-collapse-all-button').click();
await termRes;
await expect(
page.getByRole('cell', {
name: glossaryTerm1.responseData.displayName,
})
).toBeVisible();
} finally {
await glossaryTerm1.delete(apiContext);
await glossaryTerm2.delete(apiContext);
await glossary1.delete(apiContext);
await afterAction();
}
});
test('Assign Glossary Term to entity and check assets', async ({
browser,
}) => {
const { page, afterAction, apiContext } = await performAdminLogin(browser);
const table = new TableClass();
const glossary1 = new Glossary();
const glossaryTerm1 = new GlossaryTerm(glossary1);
glossary1.data.terms = [glossaryTerm1];
try {
await table.create(apiContext);
await glossary1.create(apiContext);
await glossaryTerm1.create(apiContext);
await table.visitEntityPage(page);
await assignGlossaryTerm(page, glossaryTerm1.responseData);
await sidebarClick(page, SidebarItem.GLOSSARY);
await selectActiveGlossary(page, glossary1.data.displayName);
await goToAssetsTab(page, glossaryTerm1.data.displayName, 1);
const entityFqn = get(table, 'entityResponseData.fullyQualifiedName');
await expect(
page.getByTestId(`table-data-card_${entityFqn}`)
).toBeVisible();
} finally {
await table.delete(apiContext);
await glossaryTerm1.delete(apiContext);
await glossary1.delete(apiContext);
await afterAction();
}
});
test('Request description task for Glossary', async ({ browser }) => {
const { page, afterAction, apiContext } = await performAdminLogin(browser);
const glossary1 = new Glossary();
const user1 = new UserClass();
try {
await user1.create(apiContext);
await glossary1.create(apiContext);
await sidebarClick(page, SidebarItem.GLOSSARY);
await selectActiveGlossary(page, glossary1.data.displayName);
const value: TaskDetails = {
term: glossary1.data.name,
assignee: user1.responseData.name,
};
await page.getByTestId('request-description').click();
await createDescriptionTaskForGlossary(page, value, glossary1);
const taskResolve = page.waitForResponse('/api/v1/feed/tasks/*/resolve');
await page.click(
'.ant-btn-compact-first-item:has-text("Accept Suggestion")'
);
await taskResolve;
await redirectToHomePage(page);
await sidebarClick(page, SidebarItem.GLOSSARY);
await selectActiveGlossary(page, glossary1.data.displayName);
const viewerContainerText = await page.textContent(
'[data-testid="viewer-container"]'
);
await expect(viewerContainerText).toContain('Updated description');
} finally {
await user1.delete(apiContext);
await glossary1.delete(apiContext);
await afterAction();
}
});
test('Request description task for Glossary Term', async ({ browser }) => {
const { page, afterAction, apiContext } = await performAdminLogin(browser);
const glossary1 = new Glossary();
const user1 = new UserClass();
const glossaryTerm1 = new GlossaryTerm(glossary1);
glossary1.data.terms = [glossaryTerm1];
try {
await user1.create(apiContext);
await glossary1.create(apiContext);
await glossaryTerm1.create(apiContext);
await sidebarClick(page, SidebarItem.GLOSSARY);
await selectActiveGlossary(page, glossary1.data.displayName);
await selectActiveGlossaryTerm(page, glossaryTerm1.data.displayName);
const value: TaskDetails = {
term: glossaryTerm1.data.name,
assignee: user1.responseData.name,
};
await page.getByTestId('request-description').click();
await createDescriptionTaskForGlossary(page, value, glossaryTerm1, false);
const taskResolve = page.waitForResponse('/api/v1/feed/tasks/*/resolve');
await page.click(
'.ant-btn-compact-first-item:has-text("Accept Suggestion")'
);
await taskResolve;
await redirectToHomePage(page);
await sidebarClick(page, SidebarItem.GLOSSARY);
await selectActiveGlossary(page, glossary1.data.displayName);
await selectActiveGlossaryTerm(page, glossaryTerm1.data.displayName);
const viewerContainerText = await page.textContent(
'[data-testid="viewer-container"]'
);
await expect(viewerContainerText).toContain('Updated description');
} finally {
await user1.delete(apiContext);
await glossaryTerm1.delete(apiContext);
await glossary1.delete(apiContext);
await afterAction();
}
});
test('Request tags for Glossary', async ({ browser }) => {
test.slow(true);
const { page, afterAction, apiContext } = await performAdminLogin(browser);
const { page: page1, afterAction: afterActionUser1 } =
await performUserLogin(browser, user2);
const glossary1 = new Glossary();
try {
await glossary1.create(apiContext);
await sidebarClick(page, SidebarItem.GLOSSARY);
await selectActiveGlossary(page, glossary1.data.displayName);
const value: TaskDetails = {
term: glossary1.data.name,
assignee: user2.responseData.name,
tag: 'PersonalData.Personal',
};
await page.getByTestId('request-entity-tags').click();
await createTagTaskForGlossary(page, value, glossary1);
await approveTagsTask(page1, value, glossary1);
} finally {
await glossary1.delete(apiContext);
await afterAction();
}
});
test('Delete Glossary and Glossary Term using Delete Modal', async ({
browser,
}) => {
const { page, afterAction, apiContext } = await performAdminLogin(browser);
const glossary1 = new Glossary();
const glossaryTerm1 = new GlossaryTerm(glossary1);
glossary1.data.terms = [glossaryTerm1];
await glossary1.create(apiContext);
await glossaryTerm1.create(apiContext);
await sidebarClick(page, SidebarItem.GLOSSARY);
await selectActiveGlossary(page, glossary1.data.displayName);
// Delete Glossary Term
await selectActiveGlossaryTerm(page, glossaryTerm1.data.displayName);
await deleteGlossaryOrGlossaryTerm(page, glossaryTerm1.data.name, true);
// Delete Glossary
await deleteGlossaryOrGlossaryTerm(page, glossary1.data.name);
await afterAction();
});
test('Verify Expand All For Nested Glossary Terms', async ({ browser }) => {
const { page, afterAction, apiContext } = await performAdminLogin(browser);
const glossary1 = new Glossary();
const glossaryTerm1 = new GlossaryTerm(glossary1);
await glossary1.create(apiContext);
await glossaryTerm1.create(apiContext);
const glossaryTerm2 = new GlossaryTerm(
glossary1,
glossaryTerm1.responseData.fullyQualifiedName
);
await glossaryTerm2.create(apiContext);
const glossaryTerm3 = new GlossaryTerm(
glossary1,
glossaryTerm2.responseData.fullyQualifiedName
);
await glossaryTerm3.create(apiContext);
try {
await sidebarClick(page, SidebarItem.GLOSSARY);
await selectActiveGlossary(page, glossary1.data.displayName);
await selectActiveGlossaryTerm(page, glossaryTerm1.data.displayName);
await page.getByTestId('terms').click();
await page.getByTestId('expand-collapse-all-button').click();
await expect(
page.getByRole('cell', { name: glossaryTerm2.data.displayName })
).toBeVisible();
await expect(
page.getByRole('cell', { name: glossaryTerm3.data.displayName })
).toBeVisible();
} finally {
await glossaryTerm3.delete(apiContext);
await glossaryTerm2.delete(apiContext);
await glossaryTerm1.delete(apiContext);
await glossary1.delete(apiContext);
await afterAction();
}
});
test.afterAll(async ({ browser }) => {
const { afterAction, apiContext } = await performAdminLogin(browser);
await user1.delete(apiContext);
await user2.delete(apiContext);
await team.delete(apiContext);
await afterAction();
});
});