2024-01-08 15:23:39 +05:30
|
|
|
/*
|
|
|
|
* Copyright 2023 Collate.
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
Add entityReferences and entityReferenceList as custom properties (#15448)
* Add entityReferences and entityReferenceList as custom properties
* ui: allow to add custom properties for all available property types.
* make entity type as an array
* Fix label typo and import order in AddCustomProperty component
* Remove unnecessary property types with format
* Refactor CustomPropertyTable.tsx to handle array config and enum config
* Add entity reference options and update custom property form
* Add EntityReference and EntityReferenceList as a custom property
* add validation for date format
* Add date and dateTime input support to PropertyValue component
* Fix import order and add search functionality to type dropdown
* Fix custom property cypress tests
* add input for number, email, timestamp, timeInterval, duration, time, sqlQuery,
* add input support for entityReference and entityReferenceList
* Add placeholders for email, timestamp, start time, end time, and duration inputs
* Refactor PropertyValue component to use destructuring for timeInterval object
* Add minWidth style to PropertyValue component and include SQL query editor
* Add entityReference and entityReferenceList as a generic types and not reference to the existing types
* Remove services from entity reference types list
* handle property values for different property type
* Update ExtensionTable to handle object values in CustomPropertyTable
* Add entity reference list rendering and styling
* Fix file paths in complexTypes.json
* Add regex constant for UNIX timestamp in milliseconds and update language files
* Refactor custom property configuration and add new options
* Fix import order and update property value handling
* add unit tests for different input types for different property type
* add unit test for different property type values
* fix cypress tests
* add cypress test for CRUD for different types
* add cypress test for entity ref and entity ref list property type
* add cypress tests for all the 11 entities which support custom properties
* fix cypress test for createCustomPropertyForEntity
* Add new interfaces and types for CustomPropertyTable
* add cypress test for custom property to create via APIs for entities
* add cypress tests for string,integer, markdown, number, duration, email
* add cypress test for enum property for all entities
* add cypress test for sqlQuery, timestamp and timeInterval property
* fix cypress test for sqlQuery input
* fix flaky cypress test for sqlQuery input
* address comments
* Refactor import statements and update ENTITY_PATH enum
* Update import statement in CustomProperty.ts
* change TimeInterval to Time Interval
---------
Co-authored-by: Sachin Chaurasiya <sachinchaurasiyachotey87@gmail.com>
2024-03-25 22:32:44 -07:00
|
|
|
import ContainerClass from '../../common/Entities/ContainerClass';
|
|
|
|
import DashboardDataModelClass from '../../common/Entities/DataModelClass';
|
2024-02-01 19:27:34 +05:30
|
|
|
import EntityClass from '../../common/Entities/EntityClass';
|
Add entityReferences and entityReferenceList as custom properties (#15448)
* Add entityReferences and entityReferenceList as custom properties
* ui: allow to add custom properties for all available property types.
* make entity type as an array
* Fix label typo and import order in AddCustomProperty component
* Remove unnecessary property types with format
* Refactor CustomPropertyTable.tsx to handle array config and enum config
* Add entity reference options and update custom property form
* Add EntityReference and EntityReferenceList as a custom property
* add validation for date format
* Add date and dateTime input support to PropertyValue component
* Fix import order and add search functionality to type dropdown
* Fix custom property cypress tests
* add input for number, email, timestamp, timeInterval, duration, time, sqlQuery,
* add input support for entityReference and entityReferenceList
* Add placeholders for email, timestamp, start time, end time, and duration inputs
* Refactor PropertyValue component to use destructuring for timeInterval object
* Add minWidth style to PropertyValue component and include SQL query editor
* Add entityReference and entityReferenceList as a generic types and not reference to the existing types
* Remove services from entity reference types list
* handle property values for different property type
* Update ExtensionTable to handle object values in CustomPropertyTable
* Add entity reference list rendering and styling
* Fix file paths in complexTypes.json
* Add regex constant for UNIX timestamp in milliseconds and update language files
* Refactor custom property configuration and add new options
* Fix import order and update property value handling
* add unit tests for different input types for different property type
* add unit test for different property type values
* fix cypress tests
* add cypress test for CRUD for different types
* add cypress test for entity ref and entity ref list property type
* add cypress tests for all the 11 entities which support custom properties
* fix cypress test for createCustomPropertyForEntity
* Add new interfaces and types for CustomPropertyTable
* add cypress test for custom property to create via APIs for entities
* add cypress tests for string,integer, markdown, number, duration, email
* add cypress test for enum property for all entities
* add cypress test for sqlQuery, timestamp and timeInterval property
* fix cypress test for sqlQuery input
* fix flaky cypress test for sqlQuery input
* address comments
* Refactor import statements and update ENTITY_PATH enum
* Update import statement in CustomProperty.ts
* change TimeInterval to Time Interval
---------
Co-authored-by: Sachin Chaurasiya <sachinchaurasiyachotey87@gmail.com>
2024-03-25 22:32:44 -07:00
|
|
|
import MlModelClass from '../../common/Entities/MlModelClass';
|
|
|
|
import PipelineClass from '../../common/Entities/PipelineClass';
|
|
|
|
import SearchIndexClass from '../../common/Entities/SearchIndexClass';
|
|
|
|
import TopicClass from '../../common/Entities/TopicClass';
|
2024-01-08 15:23:39 +05:30
|
|
|
import { CustomPropertySupportedEntityList } from '../../constants/CustomProperty.constant';
|
|
|
|
import DashboardClass from './../../common/Entities/DashboardClass';
|
Add entityReferences and entityReferenceList as custom properties (#15448)
* Add entityReferences and entityReferenceList as custom properties
* ui: allow to add custom properties for all available property types.
* make entity type as an array
* Fix label typo and import order in AddCustomProperty component
* Remove unnecessary property types with format
* Refactor CustomPropertyTable.tsx to handle array config and enum config
* Add entity reference options and update custom property form
* Add EntityReference and EntityReferenceList as a custom property
* add validation for date format
* Add date and dateTime input support to PropertyValue component
* Fix import order and add search functionality to type dropdown
* Fix custom property cypress tests
* add input for number, email, timestamp, timeInterval, duration, time, sqlQuery,
* add input support for entityReference and entityReferenceList
* Add placeholders for email, timestamp, start time, end time, and duration inputs
* Refactor PropertyValue component to use destructuring for timeInterval object
* Add minWidth style to PropertyValue component and include SQL query editor
* Add entityReference and entityReferenceList as a generic types and not reference to the existing types
* Remove services from entity reference types list
* handle property values for different property type
* Update ExtensionTable to handle object values in CustomPropertyTable
* Add entity reference list rendering and styling
* Fix file paths in complexTypes.json
* Add regex constant for UNIX timestamp in milliseconds and update language files
* Refactor custom property configuration and add new options
* Fix import order and update property value handling
* add unit tests for different input types for different property type
* add unit test for different property type values
* fix cypress tests
* add cypress test for CRUD for different types
* add cypress test for entity ref and entity ref list property type
* add cypress tests for all the 11 entities which support custom properties
* fix cypress test for createCustomPropertyForEntity
* Add new interfaces and types for CustomPropertyTable
* add cypress test for custom property to create via APIs for entities
* add cypress tests for string,integer, markdown, number, duration, email
* add cypress test for enum property for all entities
* add cypress test for sqlQuery, timestamp and timeInterval property
* fix cypress test for sqlQuery input
* fix flaky cypress test for sqlQuery input
* address comments
* Refactor import statements and update ENTITY_PATH enum
* Update import statement in CustomProperty.ts
* change TimeInterval to Time Interval
---------
Co-authored-by: Sachin Chaurasiya <sachinchaurasiyachotey87@gmail.com>
2024-03-25 22:32:44 -07:00
|
|
|
import { CustomPropertyTypeByName } from './../../common/Utils/CustomProperty';
|
2024-01-08 15:23:39 +05:30
|
|
|
|
|
|
|
// Run tests over all entities except Database, Schema, Table and Store Procedure
|
|
|
|
// Those tests are covered in cypress/new-tests/Database.spec.js
|
|
|
|
const entities = [
|
|
|
|
new DashboardClass(),
|
|
|
|
new PipelineClass(),
|
|
|
|
new TopicClass(),
|
|
|
|
new MlModelClass(),
|
|
|
|
new ContainerClass(),
|
|
|
|
new SearchIndexClass(),
|
|
|
|
new DashboardDataModelClass(),
|
|
|
|
] as const;
|
|
|
|
|
|
|
|
const OWNER1 = 'Aaron Johnson';
|
|
|
|
const OWNER2 = 'Cynthia Meyer';
|
|
|
|
|
|
|
|
const TEAM_OWNER_1 = 'Marketplace';
|
|
|
|
const TEAM_OWNER_2 = 'DevOps';
|
|
|
|
|
2024-02-17 12:06:59 +05:30
|
|
|
describe('Entity detail page', { tags: 'DataAssets' }, () => {
|
2024-02-01 19:27:34 +05:30
|
|
|
before(() => {
|
|
|
|
cy.login();
|
2024-01-08 15:23:39 +05:30
|
|
|
|
2024-02-01 19:27:34 +05:30
|
|
|
EntityClass.preRequisitesForTests();
|
|
|
|
});
|
2024-01-08 15:23:39 +05:30
|
|
|
|
2024-02-01 19:27:34 +05:30
|
|
|
after(() => {
|
|
|
|
cy.login();
|
2024-01-08 15:23:39 +05:30
|
|
|
|
2024-02-01 19:27:34 +05:30
|
|
|
EntityClass.postRequisitesForTests();
|
|
|
|
});
|
|
|
|
entities.forEach((entity) => {
|
|
|
|
describe(`${entity.getName()} page`, () => {
|
|
|
|
before(() => {
|
|
|
|
cy.login();
|
2024-01-08 15:23:39 +05:30
|
|
|
|
2024-02-01 19:27:34 +05:30
|
|
|
entity.prepareForTests();
|
|
|
|
});
|
2024-01-08 15:23:39 +05:30
|
|
|
|
2024-02-01 19:27:34 +05:30
|
|
|
after(() => {
|
|
|
|
cy.login();
|
2024-01-08 15:23:39 +05:30
|
|
|
|
2024-02-01 19:27:34 +05:30
|
|
|
entity.cleanup();
|
|
|
|
});
|
2024-01-08 15:23:39 +05:30
|
|
|
|
2024-02-01 19:27:34 +05:30
|
|
|
beforeEach(() => {
|
|
|
|
cy.login();
|
|
|
|
entity.visitEntity();
|
|
|
|
});
|
2024-01-08 15:23:39 +05:30
|
|
|
|
2024-02-01 19:27:34 +05:30
|
|
|
it(`Domain assign, update & delete`, () => {
|
|
|
|
entity.assignDomain();
|
|
|
|
entity.updateDomain();
|
|
|
|
entity.removeDomain();
|
|
|
|
});
|
2024-01-08 15:23:39 +05:30
|
|
|
|
2024-02-01 19:27:34 +05:30
|
|
|
it(`User as Owner assign, update & delete`, () => {
|
|
|
|
entity.userOwnerFlow(OWNER1, OWNER2);
|
|
|
|
});
|
2024-01-08 15:23:39 +05:30
|
|
|
|
2024-02-01 19:27:34 +05:30
|
|
|
it(`Team as Owner assign, update & delete`, () => {
|
|
|
|
entity.teamOwnerFlow(TEAM_OWNER_1, TEAM_OWNER_2);
|
|
|
|
});
|
2024-01-08 15:23:39 +05:30
|
|
|
|
2024-02-01 19:27:34 +05:30
|
|
|
it(`Tier assign, update & delete`, () => {
|
|
|
|
entity.tierFlow('Tier1', 'Tier5');
|
|
|
|
});
|
2024-01-08 15:23:39 +05:30
|
|
|
|
2024-02-01 19:27:34 +05:30
|
|
|
it(`Update description`, () => {
|
|
|
|
entity.updateDescription();
|
|
|
|
});
|
2024-01-08 15:23:39 +05:30
|
|
|
|
2024-02-01 19:27:34 +05:30
|
|
|
it(`Tags assign, update & delete`, () => {
|
|
|
|
entity.assignTags();
|
|
|
|
entity.updateTags();
|
|
|
|
entity.removeTags();
|
|
|
|
});
|
2024-01-08 15:23:39 +05:30
|
|
|
|
2024-02-01 19:27:34 +05:30
|
|
|
it(`GlossaryTerm assign, update & delete`, () => {
|
|
|
|
entity.assignGlossary();
|
|
|
|
entity.updateGlossary();
|
|
|
|
entity.removeGlossary();
|
|
|
|
});
|
2024-01-08 15:23:39 +05:30
|
|
|
|
2024-04-30 15:19:57 +05:30
|
|
|
it(`Announcement create & delete`, () => {
|
2024-02-01 19:27:34 +05:30
|
|
|
entity.createAnnouncement();
|
2024-04-30 15:19:57 +05:30
|
|
|
/**
|
|
|
|
* Todo: Fix the flakiness issue with the Activity feed changes and enable this test
|
|
|
|
*/
|
|
|
|
// entity.replyAnnouncement();
|
2024-02-01 19:27:34 +05:30
|
|
|
entity.removeAnnouncement();
|
|
|
|
});
|
2024-01-08 15:23:39 +05:30
|
|
|
|
2024-04-30 15:19:57 +05:30
|
|
|
it(`Inactive Announcement create & delete`, () => {
|
2024-02-01 19:27:34 +05:30
|
|
|
entity.createInactiveAnnouncement();
|
|
|
|
entity.removeInactiveAnnouncement();
|
2024-01-08 15:23:39 +05:30
|
|
|
});
|
|
|
|
|
2024-02-01 19:27:34 +05:30
|
|
|
it(`UpVote & DownVote entity`, () => {
|
|
|
|
entity.upVote();
|
|
|
|
entity.downVote();
|
2024-01-08 15:23:39 +05:30
|
|
|
});
|
|
|
|
|
2024-02-01 19:27:34 +05:30
|
|
|
// Create custom property only for supported entities
|
|
|
|
if (CustomPropertySupportedEntityList.includes(entity.endPoint)) {
|
Add entityReferences and entityReferenceList as custom properties (#15448)
* Add entityReferences and entityReferenceList as custom properties
* ui: allow to add custom properties for all available property types.
* make entity type as an array
* Fix label typo and import order in AddCustomProperty component
* Remove unnecessary property types with format
* Refactor CustomPropertyTable.tsx to handle array config and enum config
* Add entity reference options and update custom property form
* Add EntityReference and EntityReferenceList as a custom property
* add validation for date format
* Add date and dateTime input support to PropertyValue component
* Fix import order and add search functionality to type dropdown
* Fix custom property cypress tests
* add input for number, email, timestamp, timeInterval, duration, time, sqlQuery,
* add input support for entityReference and entityReferenceList
* Add placeholders for email, timestamp, start time, end time, and duration inputs
* Refactor PropertyValue component to use destructuring for timeInterval object
* Add minWidth style to PropertyValue component and include SQL query editor
* Add entityReference and entityReferenceList as a generic types and not reference to the existing types
* Remove services from entity reference types list
* handle property values for different property type
* Update ExtensionTable to handle object values in CustomPropertyTable
* Add entity reference list rendering and styling
* Fix file paths in complexTypes.json
* Add regex constant for UNIX timestamp in milliseconds and update language files
* Refactor custom property configuration and add new options
* Fix import order and update property value handling
* add unit tests for different input types for different property type
* add unit test for different property type values
* fix cypress tests
* add cypress test for CRUD for different types
* add cypress test for entity ref and entity ref list property type
* add cypress tests for all the 11 entities which support custom properties
* fix cypress test for createCustomPropertyForEntity
* Add new interfaces and types for CustomPropertyTable
* add cypress test for custom property to create via APIs for entities
* add cypress tests for string,integer, markdown, number, duration, email
* add cypress test for enum property for all entities
* add cypress test for sqlQuery, timestamp and timeInterval property
* fix cypress test for sqlQuery input
* fix flaky cypress test for sqlQuery input
* address comments
* Refactor import statements and update ENTITY_PATH enum
* Update import statement in CustomProperty.ts
* change TimeInterval to Time Interval
---------
Co-authored-by: Sachin Chaurasiya <sachinchaurasiyachotey87@gmail.com>
2024-03-25 22:32:44 -07:00
|
|
|
const properties = Object.values(CustomPropertyTypeByName).join(', ');
|
2024-02-01 19:27:34 +05:30
|
|
|
|
|
|
|
it(`Set ${properties} Custom Property `, () => {
|
Add entityReferences and entityReferenceList as custom properties (#15448)
* Add entityReferences and entityReferenceList as custom properties
* ui: allow to add custom properties for all available property types.
* make entity type as an array
* Fix label typo and import order in AddCustomProperty component
* Remove unnecessary property types with format
* Refactor CustomPropertyTable.tsx to handle array config and enum config
* Add entity reference options and update custom property form
* Add EntityReference and EntityReferenceList as a custom property
* add validation for date format
* Add date and dateTime input support to PropertyValue component
* Fix import order and add search functionality to type dropdown
* Fix custom property cypress tests
* add input for number, email, timestamp, timeInterval, duration, time, sqlQuery,
* add input support for entityReference and entityReferenceList
* Add placeholders for email, timestamp, start time, end time, and duration inputs
* Refactor PropertyValue component to use destructuring for timeInterval object
* Add minWidth style to PropertyValue component and include SQL query editor
* Add entityReference and entityReferenceList as a generic types and not reference to the existing types
* Remove services from entity reference types list
* handle property values for different property type
* Update ExtensionTable to handle object values in CustomPropertyTable
* Add entity reference list rendering and styling
* Fix file paths in complexTypes.json
* Add regex constant for UNIX timestamp in milliseconds and update language files
* Refactor custom property configuration and add new options
* Fix import order and update property value handling
* add unit tests for different input types for different property type
* add unit test for different property type values
* fix cypress tests
* add cypress test for CRUD for different types
* add cypress test for entity ref and entity ref list property type
* add cypress tests for all the 11 entities which support custom properties
* fix cypress test for createCustomPropertyForEntity
* Add new interfaces and types for CustomPropertyTable
* add cypress test for custom property to create via APIs for entities
* add cypress tests for string,integer, markdown, number, duration, email
* add cypress test for enum property for all entities
* add cypress test for sqlQuery, timestamp and timeInterval property
* fix cypress test for sqlQuery input
* fix flaky cypress test for sqlQuery input
* address comments
* Refactor import statements and update ENTITY_PATH enum
* Update import statement in CustomProperty.ts
* change TimeInterval to Time Interval
---------
Co-authored-by: Sachin Chaurasiya <sachinchaurasiyachotey87@gmail.com>
2024-03-25 22:32:44 -07:00
|
|
|
Object.values(CustomPropertyTypeByName).forEach((type) => {
|
2024-02-01 19:27:34 +05:30
|
|
|
entity.setCustomProperty(
|
|
|
|
entity.customPropertyValue[type].property,
|
|
|
|
entity.customPropertyValue[type].value
|
|
|
|
);
|
|
|
|
});
|
|
|
|
});
|
2024-01-16 16:38:40 +05:30
|
|
|
|
2024-02-01 19:27:34 +05:30
|
|
|
it(`Update ${properties} Custom Property`, () => {
|
Add entityReferences and entityReferenceList as custom properties (#15448)
* Add entityReferences and entityReferenceList as custom properties
* ui: allow to add custom properties for all available property types.
* make entity type as an array
* Fix label typo and import order in AddCustomProperty component
* Remove unnecessary property types with format
* Refactor CustomPropertyTable.tsx to handle array config and enum config
* Add entity reference options and update custom property form
* Add EntityReference and EntityReferenceList as a custom property
* add validation for date format
* Add date and dateTime input support to PropertyValue component
* Fix import order and add search functionality to type dropdown
* Fix custom property cypress tests
* add input for number, email, timestamp, timeInterval, duration, time, sqlQuery,
* add input support for entityReference and entityReferenceList
* Add placeholders for email, timestamp, start time, end time, and duration inputs
* Refactor PropertyValue component to use destructuring for timeInterval object
* Add minWidth style to PropertyValue component and include SQL query editor
* Add entityReference and entityReferenceList as a generic types and not reference to the existing types
* Remove services from entity reference types list
* handle property values for different property type
* Update ExtensionTable to handle object values in CustomPropertyTable
* Add entity reference list rendering and styling
* Fix file paths in complexTypes.json
* Add regex constant for UNIX timestamp in milliseconds and update language files
* Refactor custom property configuration and add new options
* Fix import order and update property value handling
* add unit tests for different input types for different property type
* add unit test for different property type values
* fix cypress tests
* add cypress test for CRUD for different types
* add cypress test for entity ref and entity ref list property type
* add cypress tests for all the 11 entities which support custom properties
* fix cypress test for createCustomPropertyForEntity
* Add new interfaces and types for CustomPropertyTable
* add cypress test for custom property to create via APIs for entities
* add cypress tests for string,integer, markdown, number, duration, email
* add cypress test for enum property for all entities
* add cypress test for sqlQuery, timestamp and timeInterval property
* fix cypress test for sqlQuery input
* fix flaky cypress test for sqlQuery input
* address comments
* Refactor import statements and update ENTITY_PATH enum
* Update import statement in CustomProperty.ts
* change TimeInterval to Time Interval
---------
Co-authored-by: Sachin Chaurasiya <sachinchaurasiyachotey87@gmail.com>
2024-03-25 22:32:44 -07:00
|
|
|
Object.values(CustomPropertyTypeByName).forEach((type) => {
|
2024-02-01 19:27:34 +05:30
|
|
|
entity.updateCustomProperty(
|
|
|
|
entity.customPropertyValue[type].property,
|
|
|
|
entity.customPropertyValue[type].newValue
|
|
|
|
);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
2024-01-08 15:23:39 +05:30
|
|
|
|
2024-02-01 19:27:34 +05:30
|
|
|
it(`Update displayName`, () => {
|
|
|
|
entity.renameEntity();
|
|
|
|
});
|
2024-01-08 15:23:39 +05:30
|
|
|
|
2024-02-01 19:27:34 +05:30
|
|
|
it(`follow unfollow entity`, () => {
|
|
|
|
entity.followUnfollowEntity();
|
|
|
|
});
|
|
|
|
|
|
|
|
it(`Soft delete`, () => {
|
|
|
|
entity.softDeleteEntity();
|
|
|
|
});
|
|
|
|
|
|
|
|
it(`Hard delete`, () => {
|
|
|
|
entity.hardDeleteEntity();
|
|
|
|
});
|
2024-01-08 15:23:39 +05:30
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|