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

346 lines
11 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 } from '@playwright/test';
import { isUndefined } from 'lodash';
import { CustomPropertySupportedEntityList } from '../../constant/customProperty';
feat(#10933): API service UI (#17003) * feat(#10933): API service UI * feat: Add support for API collections in multiple languages * feat: add collection page * feat: Add support for multiple languages in endpoint-plural translation * chore: Add 'Beta' tag to API Services card, mark 'REST' service as beta, hide Pipelines tab, and update API Schemas card in settings. * fix: api service version page to show list of collections * feat: add api collect version page * feat: add custom property support for api collections and endpoints * feat: Add API Collection and API Endpoint translations in multiple languages * Refactor proxy configuration to use '/api/' context instead of '/api/v1' * feat: add apiEndpoint page * feat: add APIEndpoint summary component * feat: add APIEndpoint schema component * chore: remove the schema type from APIEndpointSchema component * feat: add version page component for API endpoint * chore: add task support for api collection and api endpoint * chore: remove schema from request and response label * chore: don't show add ingestion button for api services * feat: add search support for api entity * feat: add request and response schema field translations for multiple languages * chore: update icons * refactor: Add null checks in EntityUtils.tsx * feat: show deleted child entities if service is deleted * chore: Update addApiEndpointFollower function in apiEndpointsAPI.ts * feat: Add API collection and endpoint retrieval in EntityPopOverCard.tsx * chore: add api endpoint in data assets widget * feat: Add extra info link in data assets header * chore: Add API endpoint index to DataAssetsWidget test * feat: add api endpoint to explore tree * test: add cypress for apiendpoint and apicollection custom property * test: add playwright test for api service entity * test: add playwright test for api collection entity * test: Add ApiEndpoint playwright test * test: fix api endpoint and api collection test * fix: minor issues * test: add playwright test for creating service from ui and explore page tree * test: add playwright test for api endpoint lineage * feat: Update API collection page to use specific fields for owner, tags, and votes * test: remove api endpoint class from linage spec
2024-07-26 14:31:17 +05:30
import { ApiEndpointClass } from '../../support/entity/ApiEndpointClass';
import { ContainerClass } from '../../support/entity/ContainerClass';
import { DashboardClass } from '../../support/entity/DashboardClass';
import { DashboardDataModelClass } from '../../support/entity/DashboardDataModelClass';
import { EntityDataClass } from '../../support/entity/EntityDataClass';
import { MlModelClass } from '../../support/entity/MlModelClass';
import { PipelineClass } from '../../support/entity/PipelineClass';
import { SearchIndexClass } from '../../support/entity/SearchIndexClass';
import { StoredProcedureClass } from '../../support/entity/StoredProcedureClass';
import { TableClass } from '../../support/entity/TableClass';
import { TopicClass } from '../../support/entity/TopicClass';
import { UserClass } from '../../support/user/UserClass';
import {
assignDomain,
createNewPage,
generateRandomUsername,
getApiContext,
getAuthContext,
getToken,
redirectToHomePage,
removeDomain,
verifyDomainPropagation,
} from '../../utils/common';
import { CustomPropertyTypeByName } from '../../utils/customProperty';
import {
addMultiOwner,
removeOwner,
removeOwnersFromList,
} from '../../utils/entity';
import { visitServiceDetailsPage } from '../../utils/service';
const entities = [
feat(#10933): API service UI (#17003) * feat(#10933): API service UI * feat: Add support for API collections in multiple languages * feat: add collection page * feat: Add support for multiple languages in endpoint-plural translation * chore: Add 'Beta' tag to API Services card, mark 'REST' service as beta, hide Pipelines tab, and update API Schemas card in settings. * fix: api service version page to show list of collections * feat: add api collect version page * feat: add custom property support for api collections and endpoints * feat: Add API Collection and API Endpoint translations in multiple languages * Refactor proxy configuration to use '/api/' context instead of '/api/v1' * feat: add apiEndpoint page * feat: add APIEndpoint summary component * feat: add APIEndpoint schema component * chore: remove the schema type from APIEndpointSchema component * feat: add version page component for API endpoint * chore: add task support for api collection and api endpoint * chore: remove schema from request and response label * chore: don't show add ingestion button for api services * feat: add search support for api entity * feat: add request and response schema field translations for multiple languages * chore: update icons * refactor: Add null checks in EntityUtils.tsx * feat: show deleted child entities if service is deleted * chore: Update addApiEndpointFollower function in apiEndpointsAPI.ts * feat: Add API collection and endpoint retrieval in EntityPopOverCard.tsx * chore: add api endpoint in data assets widget * feat: Add extra info link in data assets header * chore: Add API endpoint index to DataAssetsWidget test * feat: add api endpoint to explore tree * test: add cypress for apiendpoint and apicollection custom property * test: add playwright test for api service entity * test: add playwright test for api collection entity * test: Add ApiEndpoint playwright test * test: fix api endpoint and api collection test * fix: minor issues * test: add playwright test for creating service from ui and explore page tree * test: add playwright test for api endpoint lineage * feat: Update API collection page to use specific fields for owner, tags, and votes * test: remove api endpoint class from linage spec
2024-07-26 14:31:17 +05:30
ApiEndpointClass,
TableClass,
StoredProcedureClass,
DashboardClass,
PipelineClass,
TopicClass,
MlModelClass,
ContainerClass,
SearchIndexClass,
DashboardDataModelClass,
] as const;
// use the admin user to login
test.use({ storageState: 'playwright/.auth/admin.json' });
entities.forEach((EntityClass) => {
const entity = new EntityClass();
const deleteEntity = new EntityClass();
test.describe(entity.getType(), () => {
test.beforeAll('Setup pre-requests', async ({ browser }) => {
const { apiContext, afterAction } = await createNewPage(browser);
await EntityDataClass.preRequisitesForTests(apiContext);
await entity.create(apiContext);
await afterAction();
});
test.beforeEach('Visit entity details page', async ({ page }) => {
await redirectToHomePage(page);
await entity.visitEntityPage(page);
});
test('Domain Add, Update and Remove', async ({ page }) => {
await entity.domain(
page,
EntityDataClass.domain1.responseData,
EntityDataClass.domain2.responseData
);
});
test('Domain Propagation', async ({ page }) => {
const serviceCategory = entity.serviceCategory;
if (serviceCategory) {
await visitServiceDetailsPage(
page,
{
name: entity.service.name,
type: serviceCategory,
},
false
);
await assignDomain(page, EntityDataClass.domain1.responseData);
await verifyDomainPropagation(
page,
EntityDataClass.domain1.responseData,
entity.entityResponseData?.['fullyQualifiedName']
);
await visitServiceDetailsPage(
page,
{
name: entity.service.name,
type: serviceCategory,
},
false
);
await removeDomain(page);
}
});
test('User as Owner Add, Update and Remove', async ({ page }) => {
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
test.slow(true);
const OWNER1 = EntityDataClass.user1.getUserName();
const OWNER2 = EntityDataClass.user2.getUserName();
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
const OWNER3 = EntityDataClass.user3.getUserName();
await entity.owner(page, [OWNER1, OWNER3], [OWNER2]);
});
test('Team as Owner Add, Update and Remove', async ({ page }) => {
const OWNER1 = EntityDataClass.team1.data.displayName;
const OWNER2 = EntityDataClass.team2.data.displayName;
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
await entity.owner(page, [OWNER1], [OWNER2], 'Teams');
});
test('User as Owner with unsorted list', async ({ page }) => {
test.slow(true);
const { afterAction, apiContext } = await getApiContext(page);
const owner1Data = generateRandomUsername('PW_A_');
const owner2Data = generateRandomUsername('PW_B_');
const OWNER1 = new UserClass(owner1Data);
const OWNER2 = new UserClass(owner2Data);
await OWNER1.create(apiContext);
await OWNER2.create(apiContext);
await addMultiOwner({
page,
ownerNames: [OWNER2.getUserName()],
activatorBtnDataTestId: 'edit-owner',
resultTestId: 'data-assets-header',
endpoint: entity.endpoint,
type: 'Users',
});
await addMultiOwner({
page,
ownerNames: [OWNER1.getUserName()],
activatorBtnDataTestId: 'edit-owner',
resultTestId: 'data-assets-header',
endpoint: entity.endpoint,
type: 'Users',
clearAll: false,
});
await removeOwnersFromList({
page,
ownerNames: [OWNER1.getUserName()],
endpoint: entity.endpoint,
dataTestId: 'data-assets-header',
});
await removeOwner({
page,
endpoint: entity.endpoint,
ownerName: OWNER2.getUserName(),
type: 'Users',
dataTestId: 'data-assets-header',
});
await OWNER1.delete(apiContext);
await OWNER2.delete(apiContext);
await afterAction();
});
test('Tier Add, Update and Remove', async ({ page }) => {
await entity.tier(
page,
'Tier1',
EntityDataClass.tierTag1.data.displayName
);
});
test('Update description', async ({ page }) => {
await entity.descriptionUpdate(page);
});
test('Tag Add, Update and Remove', async ({ page }) => {
await entity.tag(page, 'PersonalData.Personal', 'PII.None');
});
test('Glossary Term Add, Update and Remove', async ({ page }) => {
await entity.glossaryTerm(
page,
EntityDataClass.glossaryTerm1.responseData,
EntityDataClass.glossaryTerm2.responseData
);
});
// Run only if entity has children
if (!isUndefined(entity.childrenTabId)) {
test('Tag Add, Update and Remove for child entities', async ({
page,
}) => {
await page.getByTestId(entity.childrenTabId ?? '').click();
await entity.tagChildren({
page: page,
tag1: 'PersonalData.Personal',
tag2: 'PII.None',
rowId: entity.childrenSelectorId ?? '',
rowSelector:
entity.type === 'MlModel' ? 'data-testid' : 'data-row-key',
});
});
}
// Run only if entity has children
if (!isUndefined(entity.childrenTabId)) {
test('Glossary Term Add, Update and Remove for child entities', async ({
page,
}) => {
await page.getByTestId(entity.childrenTabId ?? '').click();
await entity.glossaryTermChildren({
page: page,
glossaryTerm1: EntityDataClass.glossaryTerm1.responseData,
glossaryTerm2: EntityDataClass.glossaryTerm2.responseData,
rowId: entity.childrenSelectorId ?? '',
rowSelector:
entity.type === 'MlModel' ? 'data-testid' : 'data-row-key',
});
});
}
test(`Announcement create & delete`, async ({ page }) => {
await entity.announcement(
page,
entity.entityResponseData?.['fullyQualifiedName']
);
});
test(`Inactive Announcement create & delete`, async ({ page }) => {
await entity.inactiveAnnouncement(page);
});
test(`UpVote & DownVote entity`, async ({ page }) => {
await entity.upVote(page);
await entity.downVote(page);
});
test(`Follow & Un-follow entity`, async ({ page }) => {
const entityName = entity.entityResponseData?.['displayName'];
await entity.followUnfollowEntity(page, entityName);
});
// Create custom property only for supported entities
if (CustomPropertySupportedEntityList.includes(entity.endpoint)) {
const properties = Object.values(CustomPropertyTypeByName);
const titleText = properties.join(', ');
test(`Set & Update ${titleText} Custom Property `, async ({ page }) => {
// increase timeout as it using single test for multiple steps
test.slow(true);
const { apiContext, afterAction } = await getApiContext(page);
await entity.prepareCustomProperty(apiContext);
await test.step(`Set ${titleText} Custom Property`, async () => {
for (const type of properties) {
await entity.updateCustomProperty(
page,
entity.customPropertyValue[type].property,
entity.customPropertyValue[type].value
);
}
});
await test.step(`Update ${titleText} Custom Property`, async () => {
for (const type of properties) {
await entity.updateCustomProperty(
page,
entity.customPropertyValue[type].property,
entity.customPropertyValue[type].newValue
);
}
});
await entity.cleanupCustomProperty(apiContext);
await afterAction();
});
}
test(`Update displayName`, async ({ page }) => {
await entity.renameEntity(page, entity.entity.name);
});
test.afterAll('Cleanup', async ({ browser }) => {
const { apiContext, afterAction } = await createNewPage(browser);
await entity.delete(apiContext);
await EntityDataClass.postRequisitesForTests(apiContext);
await afterAction();
});
});
test(`Delete ${deleteEntity.getType()}`, async ({ page }) => {
// increase timeout as it using single test for multiple steps
test.slow(true);
await redirectToHomePage(page);
// get the token from localStorage
const token = await getToken(page);
// create a new context with the token
const apiContext = await getAuthContext(token);
await deleteEntity.create(apiContext);
await redirectToHomePage(page);
await deleteEntity.visitEntityPage(page);
await test.step('Soft delete', async () => {
await deleteEntity.softDeleteEntity(
page,
deleteEntity.entity.name,
deleteEntity.entityResponseData?.['displayName']
);
});
await test.step('Hard delete', async () => {
await deleteEntity.hardDeleteEntity(
page,
deleteEntity.entity.name,
deleteEntity.entityResponseData?.['displayName']
);
});
});
});