From 7ddd8d7938c6332a57ff61a0b0505c5cf9e5e41f Mon Sep 17 00:00:00 2001 From: Shailesh Parmar Date: Tue, 2 Jul 2024 12:15:08 +0530 Subject: [PATCH] Minor: remove cypress test which is migrated in playwright (#16880) * Minor: remove cypress test which is migrated in playwright * removed linage cypress --- .../cypress/common/Entities/ContainerClass.ts | 60 -- .../cypress/common/Entities/DashboardClass.ts | 78 --- .../common/Entities/DashboardServiceClass.ts | 64 --- .../cypress/common/Entities/DataModelClass.ts | 89 --- .../cypress/common/Entities/DatabaseClass.ts | 142 ----- .../common/Entities/DatabaseSchemaClass.ts | 104 ---- .../common/Entities/DatabaseServiceClass.ts | 71 --- .../ui/cypress/common/Entities/EntityClass.ts | 520 ------------------ .../common/Entities/MessagingServiceClass.ts | 68 --- .../cypress/common/Entities/MlModelClass.ts | 56 -- .../common/Entities/MlModelServiceClass.ts | 68 --- .../cypress/common/Entities/PipelineClass.ts | 56 -- .../common/Entities/PipelineServiceClass.ts | 71 --- .../common/Entities/SearchIndexClass.ts | 60 -- .../common/Entities/SearchServiceClass.ts | 67 --- .../common/Entities/StorageServiceClass.ts | 71 --- .../common/Entities/StoredProcedureClass.ts | 87 --- .../ui/cypress/common/Entities/TableClass.ts | 72 --- .../ui/cypress/common/Entities/TopicClass.ts | 56 -- .../ui/cypress/e2e/Flow/Lineage.spec.ts | 414 -------------- .../ui/cypress/e2e/Pages/Database.spec.ts | 155 ------ .../ui/cypress/e2e/Pages/Entity.spec.ts | 170 ------ .../ui/cypress/e2e/Pages/Services.spec.ts | 130 ----- 23 files changed, 2729 deletions(-) delete mode 100644 openmetadata-ui/src/main/resources/ui/cypress/common/Entities/ContainerClass.ts delete mode 100644 openmetadata-ui/src/main/resources/ui/cypress/common/Entities/DashboardClass.ts delete mode 100644 openmetadata-ui/src/main/resources/ui/cypress/common/Entities/DashboardServiceClass.ts delete mode 100644 openmetadata-ui/src/main/resources/ui/cypress/common/Entities/DataModelClass.ts delete mode 100644 openmetadata-ui/src/main/resources/ui/cypress/common/Entities/DatabaseClass.ts delete mode 100644 openmetadata-ui/src/main/resources/ui/cypress/common/Entities/DatabaseSchemaClass.ts delete mode 100644 openmetadata-ui/src/main/resources/ui/cypress/common/Entities/DatabaseServiceClass.ts delete mode 100644 openmetadata-ui/src/main/resources/ui/cypress/common/Entities/EntityClass.ts delete mode 100644 openmetadata-ui/src/main/resources/ui/cypress/common/Entities/MessagingServiceClass.ts delete mode 100644 openmetadata-ui/src/main/resources/ui/cypress/common/Entities/MlModelClass.ts delete mode 100644 openmetadata-ui/src/main/resources/ui/cypress/common/Entities/MlModelServiceClass.ts delete mode 100644 openmetadata-ui/src/main/resources/ui/cypress/common/Entities/PipelineClass.ts delete mode 100644 openmetadata-ui/src/main/resources/ui/cypress/common/Entities/PipelineServiceClass.ts delete mode 100644 openmetadata-ui/src/main/resources/ui/cypress/common/Entities/SearchIndexClass.ts delete mode 100644 openmetadata-ui/src/main/resources/ui/cypress/common/Entities/SearchServiceClass.ts delete mode 100644 openmetadata-ui/src/main/resources/ui/cypress/common/Entities/StorageServiceClass.ts delete mode 100644 openmetadata-ui/src/main/resources/ui/cypress/common/Entities/StoredProcedureClass.ts delete mode 100644 openmetadata-ui/src/main/resources/ui/cypress/common/Entities/TableClass.ts delete mode 100644 openmetadata-ui/src/main/resources/ui/cypress/common/Entities/TopicClass.ts delete mode 100644 openmetadata-ui/src/main/resources/ui/cypress/e2e/Flow/Lineage.spec.ts delete mode 100644 openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Database.spec.ts delete mode 100644 openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Entity.spec.ts delete mode 100644 openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Services.spec.ts diff --git a/openmetadata-ui/src/main/resources/ui/cypress/common/Entities/ContainerClass.ts b/openmetadata-ui/src/main/resources/ui/cypress/common/Entities/ContainerClass.ts deleted file mode 100644 index 6805fd5427f..00000000000 --- a/openmetadata-ui/src/main/resources/ui/cypress/common/Entities/ContainerClass.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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. - */ -import { EntityType } from '../../constants/Entity.interface'; -import { STORAGE_SERVICE } from '../../constants/EntityConstant'; -import { createSingleLevelEntity } from '../EntityUtils'; -import { visitEntityDetailsPage } from '../Utils/Entity'; -import { getToken } from '../Utils/LocalStorage'; -import EntityClass from './EntityClass'; - -class ContainerClass extends EntityClass { - containerName: string; - - constructor() { - const containerName = `cypress-container-${Date.now()}`; - super(containerName, STORAGE_SERVICE.entity, EntityType.Container); - - this.containerName = containerName; - this.name = 'Container'; - } - - visitEntity() { - visitEntityDetailsPage({ - term: this.containerName, - serviceName: STORAGE_SERVICE.service.name, - entity: this.endPoint, - }); - } - - followUnfollowEntity() { - // Skiping this since not working from backend - } - - // Creation - - createEntity() { - // Handle creation here - - cy.getAllLocalStorage().then((data) => { - const token = getToken(data); - - createSingleLevelEntity({ - token, - ...STORAGE_SERVICE, - entity: [{ ...STORAGE_SERVICE.entity, name: this.containerName }], - }); - }); - } -} - -export default ContainerClass; diff --git a/openmetadata-ui/src/main/resources/ui/cypress/common/Entities/DashboardClass.ts b/openmetadata-ui/src/main/resources/ui/cypress/common/Entities/DashboardClass.ts deleted file mode 100644 index 19492b3257b..00000000000 --- a/openmetadata-ui/src/main/resources/ui/cypress/common/Entities/DashboardClass.ts +++ /dev/null @@ -1,78 +0,0 @@ -/* - * 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. - */ -import { EntityType } from '../../constants/Entity.interface'; -import { - DASHBOARD_SERVICE, - DASHBOARD_SERVICE_DETAILS, -} from '../../constants/EntityConstant'; -import { createSingleLevelEntity } from '../EntityUtils'; -import { deleteEntityViaREST, visitEntityDetailsPage } from '../Utils/Entity'; -import { getToken } from '../Utils/LocalStorage'; -import EntityClass from './EntityClass'; - -class DashboardClass extends EntityClass { - dashboardName: string; - - constructor() { - const dashboardName = `cypress-dashboard-${Date.now()}`; - super(dashboardName, DASHBOARD_SERVICE.entity, EntityType.Dashboard); - - this.dashboardName = dashboardName; - this.name = 'Dashboard'; - } - - visitEntity() { - visitEntityDetailsPage({ - term: this.dashboardName, - serviceName: DASHBOARD_SERVICE.service.name, - entity: this.endPoint, - }); - } - - // Creation - - createEntity() { - // Handle creation here - - cy.getAllLocalStorage().then((data) => { - const token = getToken(data); - - createSingleLevelEntity({ - token, - ...DASHBOARD_SERVICE, - entity: [ - { - ...DASHBOARD_SERVICE.entity, - name: this.dashboardName, - displayName: this.dashboardName, - }, - ], - }); - }); - } - - // Cleanup - override cleanup() { - super.cleanup(); - cy.getAllLocalStorage().then((data) => { - const token = getToken(data); - deleteEntityViaREST({ - token, - endPoint: EntityType.DashboardService, - entityName: DASHBOARD_SERVICE_DETAILS.name, - }); - }); - } -} - -export default DashboardClass; diff --git a/openmetadata-ui/src/main/resources/ui/cypress/common/Entities/DashboardServiceClass.ts b/openmetadata-ui/src/main/resources/ui/cypress/common/Entities/DashboardServiceClass.ts deleted file mode 100644 index 00f81d68520..00000000000 --- a/openmetadata-ui/src/main/resources/ui/cypress/common/Entities/DashboardServiceClass.ts +++ /dev/null @@ -1,64 +0,0 @@ -/* - * 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. - */ - -import { createSingleLevelEntity } from '../../common/EntityUtils'; -import { visitServiceDetailsPage } from '../../common/serviceUtils'; -import { SERVICE_TYPE } from '../../constants/constants'; -import { EntityType } from '../../constants/Entity.interface'; -import { DASHBOARD_SERVICE } from '../../constants/EntityConstant'; -import { getToken } from '../Utils/LocalStorage'; -import EntityClass from './EntityClass'; - -class DashboardServiceClass extends EntityClass { - dashboardName: string; - - constructor() { - const dashboardName = `cypress-dashboard-service-${Date.now()}`; - super(dashboardName, DASHBOARD_SERVICE.entity, EntityType.DashboardService); - - this.dashboardName = dashboardName; - this.name = 'Dashboard Service'; - } - - visitEntity() { - visitServiceDetailsPage( - { - name: this.dashboardName, - type: SERVICE_TYPE.Dashboard, - }, - false - ); - } - - // Creation - - createEntity() { - // Handle creation here - - cy.getAllLocalStorage().then((data) => { - const token = getToken(data); - - createSingleLevelEntity({ - ...DASHBOARD_SERVICE, - service: { ...DASHBOARD_SERVICE.service, name: this.dashboardName }, - entity: { - ...DASHBOARD_SERVICE.entity, - service: this.dashboardName, - }, - token, - }); - }); - } -} - -export default DashboardServiceClass; diff --git a/openmetadata-ui/src/main/resources/ui/cypress/common/Entities/DataModelClass.ts b/openmetadata-ui/src/main/resources/ui/cypress/common/Entities/DataModelClass.ts deleted file mode 100644 index 3c37e90d6a9..00000000000 --- a/openmetadata-ui/src/main/resources/ui/cypress/common/Entities/DataModelClass.ts +++ /dev/null @@ -1,89 +0,0 @@ -/* - * 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. - */ -import { - createEntityViaREST, - deleteEntityViaREST, - visitEntityDetailsPage, -} from '../../common/Utils/Entity'; -import { EntityType } from '../../constants/Entity.interface'; -import { - DASHBOARD_DATA_MODEL_DETAILS, - DASHBOARD_SERVICE_DETAILS, -} from '../../constants/EntityConstant'; -import { getToken } from '../Utils/LocalStorage'; -import EntityClass from './EntityClass'; - -class DashboardDataModelClass extends EntityClass { - dashboardDataModelName: string; - - constructor() { - const dashboardDataModelName = `cypress-dashboard-data-model-${Date.now()}`; - super( - dashboardDataModelName, - DASHBOARD_DATA_MODEL_DETAILS, - EntityType.DataModel - ); - - this.dashboardDataModelName = dashboardDataModelName; - this.name = 'Dashboard Data Model'; - } - - visitEntity() { - visitEntityDetailsPage({ - term: this.dashboardDataModelName, - serviceName: DASHBOARD_SERVICE_DETAILS.name, - entity: this.endPoint, - }); - } - - // Creation - - createEntity() { - // Handle creation here - - cy.getAllLocalStorage().then((data) => { - const token = getToken(data); - - createEntityViaREST({ - token, - body: DASHBOARD_SERVICE_DETAILS, - endPoint: EntityType.DashboardService, - }); - - createEntityViaREST({ - token, - body: { - ...DASHBOARD_DATA_MODEL_DETAILS, - name: this.dashboardDataModelName, - displayName: this.dashboardDataModelName, - }, - endPoint: EntityType.DataModel, - }); - }); - } - - // Cleanup - override cleanup() { - super.cleanup(); - cy.getAllLocalStorage().then((data) => { - const token = getToken(data); - deleteEntityViaREST({ - token, - endPoint: EntityType.DashboardService, - entityName: DASHBOARD_SERVICE_DETAILS.name, - }); - }); - } -} - -export default DashboardDataModelClass; diff --git a/openmetadata-ui/src/main/resources/ui/cypress/common/Entities/DatabaseClass.ts b/openmetadata-ui/src/main/resources/ui/cypress/common/Entities/DatabaseClass.ts deleted file mode 100644 index bdc95237df0..00000000000 --- a/openmetadata-ui/src/main/resources/ui/cypress/common/Entities/DatabaseClass.ts +++ /dev/null @@ -1,142 +0,0 @@ -/* - * 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. - */ -import { interceptURL, verifyResponseStatusCode } from '../../common/common'; -import { visitServiceDetailsPage } from '../../common/serviceUtils'; -import { - createEntityTableViaREST, - deleteEntityViaREST, - visitEntityDetailsPage, -} from '../../common/Utils/Entity'; -import { EntityType } from '../../constants/Entity.interface'; -import { - DATABASE_SERVICE, - DATABASE_SERVICE_DETAILS, -} from '../../constants/EntityConstant'; -import { GlobalSettingOptions } from '../../constants/settings.constant'; -import { getToken } from '../Utils/LocalStorage'; -import { - addOwner, - removeOwner, - updateOwner, - validateOwnerAndTeamCounts, -} from '../Utils/Owner'; -import EntityClass from './EntityClass'; - -class DatabaseClass extends EntityClass { - databaseName: string; - tableName: string; - databaseSchemaName: string; - - constructor() { - const databaseName = `cypress-database-${Date.now()}`; - const tableName = `cypress-table-${Date.now()}`; - const databaseSchemaName = `cypress-database-schema-${Date.now()}`; - - super(databaseName, DATABASE_SERVICE.database, EntityType.Database); - - this.databaseName = databaseName; - this.tableName = tableName; - this.databaseSchemaName = databaseSchemaName; - this.name = 'Database'; - } - - visitEntity() { - interceptURL( - 'GET', - `/api/v1/databases/name/*${this.databaseName}?**`, - 'fetchDatabase' - ); - visitServiceDetailsPage( - { - name: DATABASE_SERVICE.service.name, - type: GlobalSettingOptions.DATABASES, - }, - false - ); - - cy.get(`[data-testid="${this.databaseName}"]`).click(); - verifyResponseStatusCode('@fetchDatabase', 200); - } - - followUnfollowEntity() { - // Skiping this since not supported for database - } - - // Creation - - createEntity() { - // Handle creation here - - cy.getAllLocalStorage().then((data) => { - const token = getToken(data); - - createEntityTableViaREST({ - token, - ...DATABASE_SERVICE, - database: { ...DATABASE_SERVICE.database, name: this.databaseName }, - tables: [ - { - ...DATABASE_SERVICE.entity, - name: this.tableName, - databaseSchema: `${DATABASE_SERVICE_DETAILS.name}.${this.databaseName}.${this.databaseSchemaName}`, - }, - ], - schema: { - name: this.databaseSchemaName, - database: `${DATABASE_SERVICE_DETAILS.name}.${this.databaseName}`, - }, - }); - }); - } - - // Check owner is propogated to table entity and perform update and delete owner - verifyOwnerPropogation(newOwnerName: string) { - cy.goToHomePage(); - // Visit table entity details page - visitEntityDetailsPage({ - term: this.tableName, - serviceName: DATABASE_SERVICE.service.name, - entity: EntityType.Table, - }); - - updateOwner(newOwnerName); - cy.reload(); - removeOwner(newOwnerName); - // Visit Database page again - this.visitEntity(); - } - - override userOwnerFlow(ownerName: string, newOwnerName: string) { - validateOwnerAndTeamCounts(); - addOwner(ownerName); - // Verify Owner propogated to table entity - this.verifyOwnerPropogation('Alex Pollard'); - updateOwner(newOwnerName); - removeOwner(newOwnerName); - } - - // Cleanup - override cleanup() { - super.cleanup(); - cy.getAllLocalStorage().then((data) => { - const token = getToken(data); - deleteEntityViaREST({ - token, - endPoint: EntityType.DatabaseService, - entityName: DATABASE_SERVICE.service.name, - }); - }); - } -} - -export default DatabaseClass; diff --git a/openmetadata-ui/src/main/resources/ui/cypress/common/Entities/DatabaseSchemaClass.ts b/openmetadata-ui/src/main/resources/ui/cypress/common/Entities/DatabaseSchemaClass.ts deleted file mode 100644 index 62a2a0a4a9c..00000000000 --- a/openmetadata-ui/src/main/resources/ui/cypress/common/Entities/DatabaseSchemaClass.ts +++ /dev/null @@ -1,104 +0,0 @@ -/* - * 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. - */ -import { interceptURL, verifyResponseStatusCode } from '../../common/common'; -import { visitServiceDetailsPage } from '../../common/serviceUtils'; -import { - createEntityTableViaREST, - deleteEntityViaREST, -} from '../../common/Utils/Entity'; -import { EntityType } from '../../constants/Entity.interface'; -import { DATABASE_SERVICE } from '../../constants/EntityConstant'; -import { GlobalSettingOptions } from '../../constants/settings.constant'; -import { getToken } from '../Utils/LocalStorage'; -import EntityClass from './EntityClass'; - -class DatabaseSchemaClass extends EntityClass { - databaseSchemaName: string; - - constructor() { - const databaseSchemaName = `cypress-database-schema-${Date.now()}`; - super( - databaseSchemaName, - DATABASE_SERVICE.schema, - EntityType.DatabaseSchema - ); - - this.databaseSchemaName = databaseSchemaName; - this.name = 'Database Schema'; - } - - visitEntity() { - interceptURL( - 'GET', - `/api/v1/databases/name/*${DATABASE_SERVICE.database.name}?*`, - 'fetchDatabase' - ); - interceptURL( - 'GET', - `/api/v1/databaseSchemas/name/*${this.databaseSchemaName}?*`, - 'fetchDatabaseSchema' - ); - visitServiceDetailsPage( - { - name: DATABASE_SERVICE.service.name, - type: GlobalSettingOptions.DATABASES, - }, - false - ); - - cy.get(`[data-testid="${DATABASE_SERVICE.database.name}"]`).click(); - verifyResponseStatusCode('@fetchDatabase', 200); - - cy.get(`[data-testid="${this.databaseSchemaName}"]`).click(); - verifyResponseStatusCode('@fetchDatabaseSchema', 200); - } - - followUnfollowEntity() { - // Skiping this since not supported for database - } - - // Creation - - createEntity() { - // Handle creation here - - cy.getAllLocalStorage().then((data) => { - const token = getToken(data); - - createEntityTableViaREST({ - token, - ...DATABASE_SERVICE, - tables: [], - schema: { - ...DATABASE_SERVICE.schema, - name: this.databaseSchemaName, - }, - }); - }); - } - - // Cleanup - override cleanup() { - super.cleanup(); - cy.getAllLocalStorage().then((data) => { - const token = getToken(data); - deleteEntityViaREST({ - token, - endPoint: EntityType.DatabaseService, - entityName: DATABASE_SERVICE.service.name, - }); - }); - } -} - -export default DatabaseSchemaClass; diff --git a/openmetadata-ui/src/main/resources/ui/cypress/common/Entities/DatabaseServiceClass.ts b/openmetadata-ui/src/main/resources/ui/cypress/common/Entities/DatabaseServiceClass.ts deleted file mode 100644 index 06fc8deb209..00000000000 --- a/openmetadata-ui/src/main/resources/ui/cypress/common/Entities/DatabaseServiceClass.ts +++ /dev/null @@ -1,71 +0,0 @@ -/* - * 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. - */ - -import { visitServiceDetailsPage } from '../../common/serviceUtils'; -import { createEntityTableViaREST } from '../../common/Utils/Entity'; -import { SERVICE_TYPE } from '../../constants/constants'; -import { EntityType } from '../../constants/Entity.interface'; -import { DATABASE_SERVICE } from '../../constants/EntityConstant'; -import { getToken } from '../Utils/LocalStorage'; -import EntityClass from './EntityClass'; - -class DatabaseServiceClass extends EntityClass { - databaseName: string; - - constructor() { - const databaseName = `cypress-database-service-${Date.now()}`; - super(databaseName, DATABASE_SERVICE.entity, EntityType.DatabaseService); - - this.databaseName = databaseName; - this.name = 'Database Service'; - } - - visitEntity() { - visitServiceDetailsPage( - { - name: this.databaseName, - type: SERVICE_TYPE.Database, - }, - false - ); - } - - // Creation - - createEntity() { - // Handle creation here - - cy.getAllLocalStorage().then((data) => { - const token = getToken(data); - - createEntityTableViaREST({ - ...DATABASE_SERVICE, - service: { ...DATABASE_SERVICE.service, name: this.databaseName }, - database: { ...DATABASE_SERVICE.database, service: this.databaseName }, - schema: { - ...DATABASE_SERVICE.schema, - database: `${this.databaseName}.${DATABASE_SERVICE.database.name}`, - }, - tables: [ - { - ...DATABASE_SERVICE.entity, - databaseSchema: `${this.databaseName}.${DATABASE_SERVICE.database.name}.${DATABASE_SERVICE.schema.name}`, - }, - ], - token, - }); - }); - } -} - -export default DatabaseServiceClass; diff --git a/openmetadata-ui/src/main/resources/ui/cypress/common/Entities/EntityClass.ts b/openmetadata-ui/src/main/resources/ui/cypress/common/Entities/EntityClass.ts deleted file mode 100644 index c3d51bce48b..00000000000 --- a/openmetadata-ui/src/main/resources/ui/cypress/common/Entities/EntityClass.ts +++ /dev/null @@ -1,520 +0,0 @@ -/* - * 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. - */ - -import { uuid } from '../../constants/constants'; -import { CustomPropertySupportedEntityList } from '../../constants/CustomProperty.constant'; -import { EntityType, ENTITY_PATH } from '../../constants/Entity.interface'; -import { - createAnnouncement as createAnnouncementUtil, - createInactiveAnnouncement as createInactiveAnnouncementUtil, - deleteAnnouncement, - replyAnnouncementUtil, -} from '../Utils/Annoucement'; -import { - createCustomPropertyForEntity, - CustomProperty, - deleteCustomProperties, - setValueForProperty, - validateValueForProperty, -} from '../Utils/CustomProperty'; -import { addDomainToEntity, removeDomainFromEntity } from '../Utils/Domain'; -import { - createEntityViaREST, - deleteEntity, - deleteEntityViaREST, - followEntity, - hardDeleteEntity as hardDeleteEntityUtil, - restoreEntity as restoreEntityUtil, - unfollowEntity, - updateDescriptioForEntity, - updateDisplayNameForEntity, - validateFollowedEntityToWidget, -} from '../Utils/Entity'; -import { - assignGlossaryTerm, - removeGlossaryTerm, - updateGlossaryTerm, -} from '../Utils/Glossary'; -import { getToken } from '../Utils/LocalStorage'; -import { - addOwner, - addTeamAsOwner, - removeOwner, - removeTeamAsOwner, - updateOwner, - updateTeamAsOwner, - validateOwnerAndTeamCounts, -} from '../Utils/Owner'; -import { assignTags, removeTags, updateTags } from '../Utils/Tags'; -import { addTier, removeTier, updateTier } from '../Utils/Tier'; -import { downVoteEntity, upVoteEntity } from '../Utils/Voting'; - -const description = - // eslint-disable-next-line max-len - 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus varius quam eu mi ullamcorper, in porttitor magna mollis. Duis a tellus aliquet nunc commodo bibendum. Donec euismod maximus porttitor. Aenean quis lacus ultrices, tincidunt erat ac, dapibus felis.'; - -export const domainDetails1 = { - name: `cypress-domain-${uuid()}`, - displayName: `Cypress%Domain.${uuid()}`, - description: 'Cypress domain description', - domainType: 'Aggregate', - experts: [], - style: {}, -}; - -export const domainDetails2 = { - name: `cypress-domain-${uuid()}`, - displayName: `Cypress%Domain.${uuid()}`, - description: 'Cypress domain description', - domainType: 'Aggregate', - experts: [], - style: {}, -}; - -export const glossaryDetails1 = { - name: `Cypress%General ${uuid()}`, - displayName: `Cypress % General ${uuid()}`, - description: - 'Glossary terms that describe general conceptual terms. **Note that these conceptual terms are used for automatically labeling the data.**', - reviewers: [], - tags: [], - mutuallyExclusive: false, -}; - -export const glossaryDetails2 = { - name: `Cypress%Person ${uuid()}`, - displayName: `Cypress % Person ${uuid()}`, - description: - // eslint-disable-next-line max-len - 'Glossary related to describing **conceptual** terms related to a Person. These terms are used to label data assets to describe the user data in those assets. Example - a table column can be labeled with Person.PhoneNumber tag. The associated PII and PersonalData tags are automatically applied.', - reviewers: [], - tags: [], - mutuallyExclusive: false, -}; - -export const glossaryTermDetails1 = { - name: `CypressBankNumber-${uuid()}`, - displayName: 'Cypress BankNumber', - description: 'A bank account number.', - reviewers: [], - relatedTerms: [], - synonyms: [], - mutuallyExclusive: false, - tags: [], - style: {}, - glossary: glossaryDetails1.name, -}; - -export const glossaryTermDetails2 = { - name: 'CypressAddress', - displayName: 'Cypress Address', - description: 'Address of a Person.', - reviewers: [], - relatedTerms: [], - synonyms: [], - mutuallyExclusive: false, - tags: [], - style: {}, - glossary: glossaryDetails2.name, -}; - -class EntityClass { - entityName: string; - token: Cypress.Storable; - entityDetails: unknown; - endPoint: EntityType; - protected name: string; - - customPropertyValue: Record< - string, - { value: string; newValue: string; property: CustomProperty } - >; - - constructor( - entityName: string, - entityDetails: unknown, - endPoint: EntityType - ) { - this.entityName = entityName; - this.entityDetails = entityDetails; - this.endPoint = endPoint; - } - - public getName() { - return this.name; - } - - async setToken() { - await new Promise((res) => - cy.getAllLocalStorage().then((data) => { - const token = getToken(data); - - this.token = token; - res(); - }) - ); - } - - // Prepare for tests - prepareForTests() { - this.createEntity(); - - // Create custom property only for supported entities - if (CustomPropertySupportedEntityList.includes(this.endPoint)) { - createCustomPropertyForEntity(this.endPoint).then((data) => { - this.customPropertyValue = data as unknown as Record< - string, - { - value: string; - newValue: string; - property: CustomProperty; - } - >; - }); - } - } - - static preRequisitesForTests() { - cy.getAllLocalStorage().then((data) => { - const token = getToken(data); - - // assign DevOps team to user - - // cy.get('[data-testid="dropdown-profile"]').click(); - // cy.get('[data-testid="user-name"]').click(); - // // edit teams - // cy.get('.ant-collapse-expand-icon > .anticon > svg').click(); - // editTeams('DevOps'); - - // Create domain - - createEntityViaREST({ - body: domainDetails1, - endPoint: EntityType.Domain, - token, - }); - - createEntityViaREST({ - body: domainDetails2, - endPoint: EntityType.Domain, - token, - }); - - // Create glossary - - createEntityViaREST({ - body: glossaryDetails1, - endPoint: EntityType.Glossary, - token, - }); - - createEntityViaREST({ - body: glossaryDetails2, - endPoint: EntityType.Glossary, - token, - }); - - // Create glossary term - - createEntityViaREST({ - body: glossaryTermDetails1, - endPoint: EntityType.GlossaryTerm, - token, - }); - - createEntityViaREST({ - body: glossaryTermDetails2, - endPoint: EntityType.GlossaryTerm, - token, - }); - }); - } - - cleanup() { - // Delete custom property only for supported entities - if (CustomPropertySupportedEntityList.includes(this.endPoint)) { - cy.getAllLocalStorage().then((data) => { - const token = getToken(data); - cy.request({ - method: 'GET', - url: `/api/v1/metadata/types/name/${ENTITY_PATH[this.endPoint]}`, - headers: { Authorization: `Bearer ${token}` }, - }).then(({ body }) => { - deleteCustomProperties(body.id, token); - }); - }); - } - } - - static postRequisitesForTests() { - cy.getAllLocalStorage().then((data) => { - const token = getToken(data); - - // Remove devops as team - // cy.get('[data-testid="dropdown-profile"]').click(); - // cy.get('[data-testid="user-name"]').click(); - // // edit teams - // cy.get('.ant-collapse-expand-icon > .anticon > svg').scrollIntoView(); - // cy.get('.ant-collapse-expand-icon > .anticon > svg').click(); - // editTeams(''); - - // Domain 1 to test - deleteEntityViaREST({ - entityName: domainDetails1.name, - endPoint: EntityType.Domain, - token, - }); - // Domain 2 to test - deleteEntityViaREST({ - entityName: domainDetails2.name, - endPoint: EntityType.Domain, - token, - }); - // Glossary 1 to test - deleteEntityViaREST({ - entityName: `${encodeURIComponent(glossaryDetails1.name)}.${ - glossaryTermDetails1.name - }`, - endPoint: EntityType.GlossaryTerm, - token, - }); - // Glossary 2 to test - deleteEntityViaREST({ - entityName: `${encodeURIComponent(glossaryDetails2.name)}.${ - glossaryTermDetails2.name - }`, - endPoint: EntityType.GlossaryTerm, - token, - }); - // Glossary 2 to test - deleteEntityViaREST({ - entityName: encodeURIComponent(glossaryDetails1.name), - endPoint: EntityType.Glossary, - token, - }); - deleteEntityViaREST({ - entityName: encodeURIComponent(glossaryDetails2.name), - endPoint: EntityType.Glossary, - token, - }); - }); - } - - // Creation - - createEntity() { - // Override for entity creation - } - - // Visit entity - - visitEntity() { - // Override for entity visit - } - - // Navigate to entity - - // Domain - - assignDomain() { - addDomainToEntity(domainDetails1.displayName); - } - - // eslint-disable-next-line @typescript-eslint/no-empty-function - validateDomainVersionForEntity() {} - - updateDomain() { - addDomainToEntity(domainDetails2.displayName); - } - - removeDomain() { - removeDomainFromEntity(domainDetails2.displayName); - } - - // Owner - - userOwnerFlow(ownerName: string, newOwnerName: string) { - validateOwnerAndTeamCounts(); - addOwner(ownerName); - updateOwner(newOwnerName); - removeOwner(newOwnerName); - } - - // Team as Owner - teamOwnerFlow(teamName: string, newTeamName: string) { - addTeamAsOwner(teamName); - // validateOwnedEntityToWidget(this.entityName, true); - updateTeamAsOwner(newTeamName); - // validateOwnedEntityToWidget(this.entityName, false); - removeTeamAsOwner(newTeamName); - // validateOwnedEntityToWidget(this.entityName, false); - } - - // Tier - - tierFlow(tier: string, newTier: string) { - addTier(tier); - updateTier(newTier); - removeTier(); - } - - // Description - - updateDescription() { - updateDescriptioForEntity(description, this.endPoint); - } - - // Tags - - assignTags() { - assignTags('PersonalData.Personal', this.endPoint); - } - updateTags() { - updateTags('PII.None', this.endPoint); - } - removeTags() { - removeTags(['PersonalData.Personal', 'PII.None'], this.endPoint); - } - - // Glossary - - assignGlossary() { - assignGlossaryTerm( - `${glossaryDetails1.name}.${glossaryTermDetails1.name}`, - glossaryTermDetails1.name, - this.endPoint - ); - } - updateGlossary() { - updateGlossaryTerm( - `${glossaryDetails2.name}.${glossaryTermDetails2.name}`, - glossaryTermDetails2.name, - this.endPoint - ); - } - removeGlossary() { - removeGlossaryTerm( - [ - `${glossaryDetails1.name}.${glossaryTermDetails1.name}`, - `${glossaryDetails2.name}.${glossaryTermDetails2.name}`, - ], - this.endPoint - ); - } - - // Voting - - upVote() { - upVoteEntity({ endPoint: this.endPoint }); - } - - downVote() { - downVoteEntity({ endPoint: this.endPoint }); - } - - // Rename - - renameEntity() { - updateDisplayNameForEntity(`Cypress ${this.name} updated`, this.endPoint); - } - - // Delete - - softDeleteEntity() { - deleteEntity( - this.entityName, - this.endPoint, - `Cypress ${this.name} updated` - ); - } - - restoreEntity() { - restoreEntityUtil(); - } - - hardDeleteEntity() { - hardDeleteEntityUtil(`Cypress ${this.name} updated`, this.endPoint); - } - - // Announcement - - createAnnouncement() { - createAnnouncementUtil( - { - title: 'Cypress announcement', - description: 'Cypress announcement description', - }, - this.entityName, - this.name - ); - } - - replyAnnouncement() { - replyAnnouncementUtil(); - } - - removeAnnouncement() { - deleteAnnouncement(); - } - - // Inactive Announcement - - createInactiveAnnouncement() { - createInactiveAnnouncementUtil({ - title: 'Inactive Cypress announcement', - description: 'Inactive Cypress announcement description', - }); - } - - removeInactiveAnnouncement() { - deleteAnnouncement(); - } - - followUnfollowEntity() { - followEntity(this.endPoint); - validateFollowedEntityToWidget(this.entityName, true); - this.visitEntity(); - unfollowEntity(this.endPoint); - validateFollowedEntityToWidget(this.entityName, false); - } - - // Custom property - - setCustomProperty(propertydetails: CustomProperty, value: string) { - setValueForProperty( - propertydetails.name, - value, - propertydetails.propertyType.name - ); - validateValueForProperty( - propertydetails.name, - value, - propertydetails.propertyType.name - ); - } - - updateCustomProperty(propertydetails: CustomProperty, value: string) { - setValueForProperty( - propertydetails.name, - value, - propertydetails.propertyType.name - ); - validateValueForProperty( - propertydetails.name, - value, - propertydetails.propertyType.name - ); - } -} - -export default EntityClass; diff --git a/openmetadata-ui/src/main/resources/ui/cypress/common/Entities/MessagingServiceClass.ts b/openmetadata-ui/src/main/resources/ui/cypress/common/Entities/MessagingServiceClass.ts deleted file mode 100644 index 68adf046d1b..00000000000 --- a/openmetadata-ui/src/main/resources/ui/cypress/common/Entities/MessagingServiceClass.ts +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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. - */ - -import { SERVICE_TYPE } from '../../constants/constants'; -import { EntityType } from '../../constants/Entity.interface'; -import { MESSAGING_SERVICE } from '../../constants/EntityConstant'; -import { createSingleLevelEntity } from '../EntityUtils'; -import { visitServiceDetailsPage } from '../serviceUtils'; -import { getToken } from '../Utils/LocalStorage'; -import EntityClass from './EntityClass'; - -class MessagingServiceClass extends EntityClass { - messagingService: string; - - constructor() { - const messagingService = `cypress-messaging-service-${Date.now()}`; - super( - messagingService, - MESSAGING_SERVICE.entity, - EntityType.MessagingService - ); - - this.messagingService = messagingService; - this.name = 'Messaging Service'; - } - - visitEntity() { - visitServiceDetailsPage( - { - name: this.messagingService, - type: SERVICE_TYPE.Messaging, - }, - false - ); - } - - // Creation - - createEntity() { - // Handle creation here - - cy.getAllLocalStorage().then((data) => { - const token = getToken(data); - - createSingleLevelEntity({ - ...MESSAGING_SERVICE, - service: { ...MESSAGING_SERVICE.service, name: this.messagingService }, - entity: { - ...MESSAGING_SERVICE.entity, - service: this.messagingService, - }, - token, - }); - }); - } -} - -export default MessagingServiceClass; diff --git a/openmetadata-ui/src/main/resources/ui/cypress/common/Entities/MlModelClass.ts b/openmetadata-ui/src/main/resources/ui/cypress/common/Entities/MlModelClass.ts deleted file mode 100644 index e2a00900006..00000000000 --- a/openmetadata-ui/src/main/resources/ui/cypress/common/Entities/MlModelClass.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* - * 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. - */ -import { EntityType } from '../../constants/Entity.interface'; -import { ML_MODEL_SERVICE } from '../../constants/EntityConstant'; -import { createSingleLevelEntity } from '../EntityUtils'; -import { visitEntityDetailsPage } from '../Utils/Entity'; -import { getToken } from '../Utils/LocalStorage'; -import EntityClass from './EntityClass'; - -class MlModelClass extends EntityClass { - mlModelName: string; - - constructor() { - const mlModelName = `cypress-mlmodel-${Date.now()}`; - super(mlModelName, ML_MODEL_SERVICE.entity, EntityType.MlModel); - - this.mlModelName = mlModelName; - this.name = 'MlModel'; - } - - visitEntity() { - visitEntityDetailsPage({ - term: this.mlModelName, - serviceName: ML_MODEL_SERVICE.service.name, - entity: this.endPoint, - }); - } - - // Creation - - createEntity() { - // Handle creation here - - cy.getAllLocalStorage().then((data) => { - const token = getToken(data); - - createSingleLevelEntity({ - token, - ...ML_MODEL_SERVICE, - entity: [{ ...ML_MODEL_SERVICE.entity, name: this.mlModelName }], - }); - }); - } -} - -export default MlModelClass; diff --git a/openmetadata-ui/src/main/resources/ui/cypress/common/Entities/MlModelServiceClass.ts b/openmetadata-ui/src/main/resources/ui/cypress/common/Entities/MlModelServiceClass.ts deleted file mode 100644 index a2fa2654f91..00000000000 --- a/openmetadata-ui/src/main/resources/ui/cypress/common/Entities/MlModelServiceClass.ts +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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. - */ - -import { createSingleLevelEntity } from '../../common/EntityUtils'; -import { visitServiceDetailsPage } from '../../common/serviceUtils'; -import { SERVICE_TYPE } from '../../constants/constants'; -import { EntityType } from '../../constants/Entity.interface'; -import { ML_MODEL_SERVICE } from '../../constants/EntityConstant'; -import { getToken } from '../Utils/LocalStorage'; -import EntityClass from './EntityClass'; - -class MlModelServiceClass extends EntityClass { - mlModelServiceName: string; - - constructor() { - const mlModelServiceName = `cypress-mlmodel-service-${Date.now()}`; - super( - mlModelServiceName, - ML_MODEL_SERVICE.entity, - EntityType.MlModelService - ); - - this.mlModelServiceName = mlModelServiceName; - this.name = 'MlModel Service'; - } - - visitEntity() { - visitServiceDetailsPage( - { - name: this.mlModelServiceName, - type: SERVICE_TYPE.MLModels, - }, - false - ); - } - - // Creation - - createEntity() { - // Handle creation here - - cy.getAllLocalStorage().then((data) => { - const token = getToken(data); - - createSingleLevelEntity({ - ...ML_MODEL_SERVICE, - service: { ...ML_MODEL_SERVICE.service, name: this.mlModelServiceName }, - entity: { - ...ML_MODEL_SERVICE.entity, - service: this.mlModelServiceName, - }, - token, - }); - }); - } -} - -export default MlModelServiceClass; diff --git a/openmetadata-ui/src/main/resources/ui/cypress/common/Entities/PipelineClass.ts b/openmetadata-ui/src/main/resources/ui/cypress/common/Entities/PipelineClass.ts deleted file mode 100644 index 6ef0fa6bbd4..00000000000 --- a/openmetadata-ui/src/main/resources/ui/cypress/common/Entities/PipelineClass.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* - * 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. - */ -import { EntityType } from '../../constants/Entity.interface'; -import { PIPELINE_SERVICE } from '../../constants/EntityConstant'; -import { createSingleLevelEntity } from '../EntityUtils'; -import { visitEntityDetailsPage } from '../Utils/Entity'; -import { getToken } from '../Utils/LocalStorage'; -import EntityClass from './EntityClass'; - -class PipelineClass extends EntityClass { - pipelineName: string; - - constructor() { - const pipelineName = `cypress-pipeline-${Date.now()}`; - super(pipelineName, PIPELINE_SERVICE.entity, EntityType.Pipeline); - - this.pipelineName = pipelineName; - this.name = 'Pipeline'; - } - - visitEntity() { - visitEntityDetailsPage({ - term: this.pipelineName, - serviceName: PIPELINE_SERVICE.service.name, - entity: this.endPoint, - }); - } - - // Creation - - createEntity() { - // Handle creation here - - cy.getAllLocalStorage().then((data) => { - const token = getToken(data); - - createSingleLevelEntity({ - token, - ...PIPELINE_SERVICE, - entity: [{ ...PIPELINE_SERVICE.entity, name: this.pipelineName }], - }); - }); - } -} - -export default PipelineClass; diff --git a/openmetadata-ui/src/main/resources/ui/cypress/common/Entities/PipelineServiceClass.ts b/openmetadata-ui/src/main/resources/ui/cypress/common/Entities/PipelineServiceClass.ts deleted file mode 100644 index 699b0c89bdd..00000000000 --- a/openmetadata-ui/src/main/resources/ui/cypress/common/Entities/PipelineServiceClass.ts +++ /dev/null @@ -1,71 +0,0 @@ -/* - * 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. - */ - -import { createSingleLevelEntity } from '../../common/EntityUtils'; -import { visitServiceDetailsPage } from '../../common/serviceUtils'; -import { SERVICE_TYPE } from '../../constants/constants'; -import { EntityType } from '../../constants/Entity.interface'; -import { PIPELINE_SERVICE } from '../../constants/EntityConstant'; -import { getToken } from '../Utils/LocalStorage'; -import EntityClass from './EntityClass'; - -class PipelineServiceClass extends EntityClass { - pipelineServiceName: string; - - constructor() { - const pipelineServiceName = `cypress-pipeline-service-${Date.now()}`; - super( - pipelineServiceName, - PIPELINE_SERVICE.entity, - EntityType.PipelineService - ); - - this.pipelineServiceName = pipelineServiceName; - this.name = 'Pipeline Service'; - } - - visitEntity() { - visitServiceDetailsPage( - { - name: this.pipelineServiceName, - type: SERVICE_TYPE.Pipeline, - }, - false - ); - } - - // Creation - - createEntity() { - // Handle creation here - - cy.getAllLocalStorage().then((data) => { - const token = getToken(data); - - createSingleLevelEntity({ - ...PIPELINE_SERVICE, - service: { - ...PIPELINE_SERVICE.service, - name: this.pipelineServiceName, - }, - entity: { - ...PIPELINE_SERVICE.entity, - service: this.pipelineServiceName, - }, - token, - }); - }); - } -} - -export default PipelineServiceClass; diff --git a/openmetadata-ui/src/main/resources/ui/cypress/common/Entities/SearchIndexClass.ts b/openmetadata-ui/src/main/resources/ui/cypress/common/Entities/SearchIndexClass.ts deleted file mode 100644 index 7be90b6b157..00000000000 --- a/openmetadata-ui/src/main/resources/ui/cypress/common/Entities/SearchIndexClass.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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. - */ -import { EntityType } from '../../constants/Entity.interface'; -import { - SEARCH_INDEX_DETAILS, - SEARCH_SERVICE, -} from '../../constants/EntityConstant'; -import { createSingleLevelEntity } from '../EntityUtils'; -import { visitEntityDetailsPage } from '../Utils/Entity'; -import { getToken } from '../Utils/LocalStorage'; -import EntityClass from './EntityClass'; - -class SearchIndexClass extends EntityClass { - constructor() { - const topicName = `cypress-search-index-${Date.now()}`; - super(topicName, SEARCH_INDEX_DETAILS, EntityType.SearchIndex); - - this.name = 'SearchIndex'; - } - - visitEntity() { - visitEntityDetailsPage({ - term: this.entityName, - serviceName: SEARCH_SERVICE.service.name, - entity: this.endPoint, - }); - } - - followUnfollowEntity() { - // Skiping this since not working from backend - } - - // Creation - - createEntity() { - // Handle creation here - - cy.getAllLocalStorage().then((data) => { - const token = getToken(data); - - createSingleLevelEntity({ - ...SEARCH_SERVICE, - entity: { ...SEARCH_SERVICE.entity, name: this.entityName }, - token: token, - }); - }); - } -} - -export default SearchIndexClass; diff --git a/openmetadata-ui/src/main/resources/ui/cypress/common/Entities/SearchServiceClass.ts b/openmetadata-ui/src/main/resources/ui/cypress/common/Entities/SearchServiceClass.ts deleted file mode 100644 index 65e1d7a9da5..00000000000 --- a/openmetadata-ui/src/main/resources/ui/cypress/common/Entities/SearchServiceClass.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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. - */ - -import { createSingleLevelEntity } from '../../common/EntityUtils'; -import { visitServiceDetailsPage } from '../../common/serviceUtils'; -import { SERVICE_TYPE } from '../../constants/constants'; -import { EntityType } from '../../constants/Entity.interface'; -import { SEARCH_SERVICE } from '../../constants/EntityConstant'; -import { getToken } from '../Utils/LocalStorage'; -import EntityClass from './EntityClass'; - -class SearchServiceClass extends EntityClass { - searchServiceName: string; - - constructor() { - const searchServiceName = `cypress-search-service-${Date.now()}`; - super(searchServiceName, SEARCH_SERVICE.entity, EntityType.SearchService); - - this.searchServiceName = searchServiceName; - this.name = 'Search Service'; - } - - visitEntity() { - visitServiceDetailsPage( - { - name: this.searchServiceName, - type: SERVICE_TYPE.Search, - }, - false - ); - } - - // Creation - - createEntity() { - // Handle creation here - - cy.getAllLocalStorage().then((data) => { - const token = getToken(data); - - createSingleLevelEntity({ - ...SEARCH_SERVICE, - service: { - ...SEARCH_SERVICE.service, - name: this.searchServiceName, - }, - entity: { - ...SEARCH_SERVICE.entity, - service: this.searchServiceName, - }, - token, - }); - }); - } -} - -export default SearchServiceClass; diff --git a/openmetadata-ui/src/main/resources/ui/cypress/common/Entities/StorageServiceClass.ts b/openmetadata-ui/src/main/resources/ui/cypress/common/Entities/StorageServiceClass.ts deleted file mode 100644 index e3baa8c20e0..00000000000 --- a/openmetadata-ui/src/main/resources/ui/cypress/common/Entities/StorageServiceClass.ts +++ /dev/null @@ -1,71 +0,0 @@ -/* - * 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. - */ - -import { createSingleLevelEntity } from '../../common/EntityUtils'; -import { visitServiceDetailsPage } from '../../common/serviceUtils'; -import { SERVICE_TYPE } from '../../constants/constants'; -import { EntityType } from '../../constants/Entity.interface'; -import { STORAGE_SERVICE } from '../../constants/EntityConstant'; -import { getToken } from '../Utils/LocalStorage'; -import EntityClass from './EntityClass'; - -class StorageServiceClass extends EntityClass { - storageServiceName: string; - - constructor() { - const storageServiceName = `cypress-storage-service-${Date.now()}`; - super( - storageServiceName, - STORAGE_SERVICE.entity, - EntityType.StorageService - ); - - this.storageServiceName = storageServiceName; - this.name = 'Storage Service'; - } - - visitEntity() { - visitServiceDetailsPage( - { - name: this.storageServiceName, - type: SERVICE_TYPE.Storage, - }, - false - ); - } - - // Creation - - createEntity() { - // Handle creation here - - cy.getAllLocalStorage().then((data) => { - const token = getToken(data); - - createSingleLevelEntity({ - ...STORAGE_SERVICE, - service: { - ...STORAGE_SERVICE.service, - name: this.storageServiceName, - }, - entity: { - ...STORAGE_SERVICE.entity, - service: this.storageServiceName, - }, - token, - }); - }); - } -} - -export default StorageServiceClass; diff --git a/openmetadata-ui/src/main/resources/ui/cypress/common/Entities/StoredProcedureClass.ts b/openmetadata-ui/src/main/resources/ui/cypress/common/Entities/StoredProcedureClass.ts deleted file mode 100644 index ad96a34c2aa..00000000000 --- a/openmetadata-ui/src/main/resources/ui/cypress/common/Entities/StoredProcedureClass.ts +++ /dev/null @@ -1,87 +0,0 @@ -/* - * 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. - */ -import { EntityType } from '../../constants/Entity.interface'; -import { - DATABASE_SERVICE, - STORED_PROCEDURE_DETAILS, -} from '../../constants/EntityConstant'; -import { - createEntityTableViaREST, - deleteEntityViaREST, - visitEntityDetailsPage, -} from '../Utils/Entity'; -import { getToken } from '../Utils/LocalStorage'; -import EntityClass from './EntityClass'; - -class StoreProcedureClass extends EntityClass { - storeProcedureName: string; - - constructor() { - const storeProcedureName = `cypress-store-procedure-${Date.now()}`; - super( - storeProcedureName, - STORED_PROCEDURE_DETAILS, - EntityType.StoreProcedure - ); - - this.storeProcedureName = storeProcedureName; - this.name = 'Store Procedure'; - } - - visitEntity() { - visitEntityDetailsPage({ - term: this.storeProcedureName, - serviceName: DATABASE_SERVICE.service.name, - entity: this.endPoint, - }); - } - - // Creation - - createEntity() { - // Handle creation here - - cy.getAllLocalStorage().then((data) => { - const token = getToken(data); - - createEntityTableViaREST({ - token, - ...DATABASE_SERVICE, - storeProcedure: { - ...STORED_PROCEDURE_DETAILS, - name: this.storeProcedureName, - }, - tables: [], - }); - }); - } - - followUnfollowEntity() { - // Skiping this since not supported for store procedure - } - - // Cleanup - override cleanup() { - super.cleanup(); - cy.getAllLocalStorage().then((data) => { - const token = getToken(data); - deleteEntityViaREST({ - token, - endPoint: EntityType.DatabaseService, - entityName: DATABASE_SERVICE.service.name, - }); - }); - } -} - -export default StoreProcedureClass; diff --git a/openmetadata-ui/src/main/resources/ui/cypress/common/Entities/TableClass.ts b/openmetadata-ui/src/main/resources/ui/cypress/common/Entities/TableClass.ts deleted file mode 100644 index b04622e009d..00000000000 --- a/openmetadata-ui/src/main/resources/ui/cypress/common/Entities/TableClass.ts +++ /dev/null @@ -1,72 +0,0 @@ -/* - * 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. - */ -import { EntityType } from '../../constants/Entity.interface'; -import { DATABASE_SERVICE } from '../../constants/EntityConstant'; -import { - createEntityTableViaREST, - deleteEntityViaREST, - visitEntityDetailsPage, -} from '../Utils/Entity'; -import { getToken } from '../Utils/LocalStorage'; -import EntityClass from './EntityClass'; - -class TableClass extends EntityClass { - tableName: string; - - constructor() { - const tableName = `cypress-table-${Date.now()}`; - super(tableName, DATABASE_SERVICE.entity, EntityType.Table); - - this.tableName = tableName; - this.name = 'Table'; - } - - visitEntity() { - visitEntityDetailsPage({ - term: this.tableName, - serviceName: DATABASE_SERVICE.service.name, - entity: this.endPoint, - }); - } - - // Creation - - createEntity() { - // Handle creation here - - cy.getAllLocalStorage().then((data) => { - const token = getToken(data); - - createEntityTableViaREST({ - token, - ...DATABASE_SERVICE, - tables: [{ ...DATABASE_SERVICE.entity, name: this.tableName }], - }); - }); - } - - // Cleanup - override cleanup() { - super.cleanup(); - cy.getAllLocalStorage().then((data) => { - const token = getToken(data); - deleteEntityViaREST({ - token, - endPoint: EntityType.DatabaseService, - entityName: DATABASE_SERVICE.service.name, - }); - }); - } -} - -export default TableClass; diff --git a/openmetadata-ui/src/main/resources/ui/cypress/common/Entities/TopicClass.ts b/openmetadata-ui/src/main/resources/ui/cypress/common/Entities/TopicClass.ts deleted file mode 100644 index 52160eef647..00000000000 --- a/openmetadata-ui/src/main/resources/ui/cypress/common/Entities/TopicClass.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* - * 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. - */ -import { EntityType } from '../../constants/Entity.interface'; -import { - MESSAGING_SERVICE, - TOPIC_DETAILS, -} from '../../constants/EntityConstant'; -import { createSingleLevelEntity } from '../EntityUtils'; -import { visitEntityDetailsPage } from '../Utils/Entity'; -import { getToken } from '../Utils/LocalStorage'; -import EntityClass from './EntityClass'; - -class TopicClass extends EntityClass { - constructor() { - const topicName = `cypress-topic-${Date.now()}`; - super(topicName, TOPIC_DETAILS, EntityType.Topic); - - this.name = 'Topic'; - } - - visitEntity() { - visitEntityDetailsPage({ - term: this.entityName, - serviceName: MESSAGING_SERVICE.service.name, - entity: this.endPoint, - }); - } - - // Creation - - createEntity() { - // Handle creation here - - cy.getAllLocalStorage().then((data) => { - const token = getToken(data); - - createSingleLevelEntity({ - ...MESSAGING_SERVICE, - entity: { ...MESSAGING_SERVICE.entity, name: this.entityName }, - token: token, - }); - }); - } -} - -export default TopicClass; diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Flow/Lineage.spec.ts b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Flow/Lineage.spec.ts deleted file mode 100644 index cacd6ac10c7..00000000000 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Flow/Lineage.spec.ts +++ /dev/null @@ -1,414 +0,0 @@ -/* - * Copyright 2022 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 { interceptURL, verifyResponseStatusCode } from '../../common/common'; -import { visitEntityDetailsPage } from '../../common/Utils/Entity'; -import { EntityType } from '../../constants/Entity.interface'; -import { - LINEAGE_ITEMS, - PIPELINE_ITEMS, -} from '../../constants/lineage.constants'; - -const dataTransfer = new DataTransfer(); - -const dragConnection = (sourceId, targetId, isColumnLineage = false) => { - const selector = !isColumnLineage - ? '.lineage-node-handle' - : '.lineage-column-node-handle'; - - cy.get( - `[data-testid="${sourceId}"] ${selector}.react-flow__handle-right` - ).click({ - force: true, - }); // Adding force true for handles because it can be hidden behind the node - - return cy - .get(`[data-testid="${targetId}"] ${selector}.react-flow__handle-left`) - .click({ force: true }); // Adding force true for handles because it can be hidden behind the node -}; - -const performZoomOut = () => { - for (let i = 0; i < 12; i++) { - cy.get('.react-flow__controls-zoomout').click({ force: true }); - } -}; - -const connectEdgeBetweenNodes = (fromNode, toNode) => { - interceptURL('PUT', '/api/v1/lineage', 'lineageApi'); - const type = toNode.searchIndex; - - cy.get(`[data-testid="${type}-draggable-icon"]`) - .invoke('attr', 'draggable') - .should('contain', 'true'); - - cy.get(`[data-testid="${type}-draggable-icon"]`).trigger('dragstart', { - dataTransfer, - }); - - cy.get('[data-testid="lineage-details"]') - .trigger('drop', { dataTransfer }) - .trigger('dragend'); - - cy.get(`[data-testid="${type}-draggable-icon"]`) - .invoke('attr', 'draggable') - .should('contain', 'false'); - - cy.get('[data-testid="suggestion-node"]').click(); - - interceptURL( - 'GET', - `/api/v1/search/query?q=*${toNode.term}*&**`, - 'nodeQuery' - ); - cy.get('[data-testid="suggestion-node"] input').click().type(toNode.term); - verifyResponseStatusCode('@nodeQuery', 200); - - cy.get(`[data-testid="node-suggestion-${toNode.fqn}"]`) - .scrollIntoView() - .click(); - - dragConnection(`lineage-node-${fromNode.fqn}`, `lineage-node-${toNode.fqn}`); - verifyResponseStatusCode('@lineageApi', 200); -}; - -const verifyNodePresent = (node) => { - cy.get(`[data-testid="lineage-node-${node.fqn}"]`).should('be.visible'); - cy.get( - `[data-testid="lineage-node-${node.fqn}"] [data-testid="entity-header-name"]` - ).should('have.text', node.term); -}; - -const deleteNode = (node) => { - interceptURL('DELETE', '/api/v1/lineage/**', 'lineageDeleteApi'); - cy.get(`[data-testid="lineage-node-${node.fqn}"]`).click({ force: true }); - // Adding force true for handles because it can be hidden behind the node - cy.get('[data-testid="lineage-node-remove-btn"]').click({ force: true }); - verifyResponseStatusCode('@lineageDeleteApi', 200); -}; - -const deleteEdge = (fromNode, toNode) => { - interceptURL('DELETE', '/api/v1/lineage/**', 'lineageDeleteApi'); - cy.get(`[data-testid="edge-${fromNode.fqn}-${toNode.fqn}"]`).click({ - force: true, - }); - - if ( - ['Table', 'Topic'].indexOf(fromNode.entityType) > -1 && - ['Table', 'Topic'].indexOf(toNode.entityType) > -1 - ) { - // Adding force true for handles because it can be hidden behind the node - cy.get('[data-testid="add-pipeline"]').click({ force: true }); - cy.get( - '[data-testid="add-edge-modal"] [data-testid="remove-edge-button"]' - ).click(); - } else { - cy.get('[data-testid="delete-button"]').click({ force: true }); - } - cy.get( - '[data-testid="delete-edge-confirmation-modal"] .ant-btn-primary' - ).click(); - verifyResponseStatusCode('@lineageDeleteApi', 200); -}; - -const applyPipelineFromModal = (fromNode, toNode, pipelineData) => { - interceptURL('PUT', '/api/v1/lineage', 'lineageApi'); - cy.get(`[data-testid="edge-${fromNode.fqn}-${toNode.fqn}"]`).click({ - force: true, - }); - cy.get('[data-testid="add-pipeline"]').click({ force: true }); - - cy.get('[data-testid="add-edge-modal"] [data-testid="field-input"]') - .click() - .type(pipelineData.term); - - cy.get(`[data-testid="pipeline-entry-${pipelineData.fqn}"]`).click(); - cy.get('[data-testid="save-button"]').click(); - - verifyResponseStatusCode('@lineageApi', 200); -}; - -const editPipelineEdgeDescription = ( - fromNode, - toNode, - pipelineData, - description -) => { - cy.get( - `[data-testid="pipeline-label-${fromNode.fqn}-${toNode.fqn}"]` - ).click(); - cy.get('.edge-info-drawer').should('be.visible'); - cy.get('.edge-info-drawer [data-testid="Edge"] a').contains( - pipelineData.name - ); - - interceptURL('PUT', `/api/v1/lineage`, 'updateLineage'); - cy.get('.edge-info-drawer [data-testid="edit-description"]').click(); - - cy.get('.toastui-editor-md-container > .toastui-editor > .ProseMirror') - .click() - .clear() - .type(description); - - cy.get('[data-testid="save"]').click(); - verifyResponseStatusCode('@updateLineage', 200); - cy.get( - '.edge-info-drawer [data-testid="asset-description-container"] [data-testid="viewer-container"]' - ).should('contain', description); -}; - -const verifyPipelineDataInDrawer = ( - fromNode, - toNode, - pipelineData, - bVerifyPipelineLineage -) => { - cy.get( - `[data-testid="pipeline-label-${fromNode.fqn}-${toNode.fqn}"]` - ).click(); - cy.get('.edge-info-drawer').should('be.visible'); - cy.get('.edge-info-drawer [data-testid="Edge"] a').contains( - pipelineData.name - ); - - if (bVerifyPipelineLineage) { - cy.get('.edge-info-drawer [data-testid="Edge"] a').click(); - cy.get('[data-testid="lineage"]').click(); - cy.get('.custom-edge-pipeline-button').should( - 'have.class', - 'blinking-border' - ); - visitEntityDetailsPage({ - term: fromNode.term, - serviceName: fromNode.serviceName, - entity: fromNode.entity, - entityFqn: fromNode.fqn, - }); - cy.get('[data-testid="lineage"]').click(); - } else { - cy.get('.edge-info-drawer .ant-drawer-header .anticon-close').click(); - } -}; - -const addPipelineBetweenNodes = ( - sourceEntity, - targetEntity, - pipelineItem?, - bVerifyPipeline?: boolean -) => { - visitEntityDetailsPage({ - term: sourceEntity.term, - serviceName: sourceEntity.serviceName, - entity: sourceEntity.entity, - entityFqn: sourceEntity.fqn, - }); - - cy.get('[data-testid="lineage"]').click(); - cy.get('[data-testid="edit-lineage"]').click(); - - performZoomOut(); - - connectEdgeBetweenNodes(sourceEntity, targetEntity); - if (pipelineItem) { - applyPipelineFromModal(sourceEntity, targetEntity, pipelineItem); - cy.get('[data-testid="edit-lineage"]').click(); - verifyPipelineDataInDrawer( - sourceEntity, - targetEntity, - pipelineItem, - bVerifyPipeline - ); - } -}; - -const activateColumnLayer = () => { - cy.get('[data-testid="lineage-layer-btn"]').click(); - cy.get('[data-testid="lineage-layer-column-btn"]').click(); -}; - -const verifyColumnLayerInactive = () => { - cy.get('[data-testid="lineage-layer-btn"]').click(); // Open Layer popover - cy.get('[data-testid="lineage-layer-column-btn"]').should( - 'not.have.class', - 'active' - ); - cy.get('[data-testid="lineage-layer-btn"]').click(); // Close Layer popover -}; - -const addColumnLineage = (fromNode, toNode, exitEditMode = true) => { - interceptURL('PUT', '/api/v1/lineage', 'lineageApi'); - dragConnection( - `column-${fromNode.columns[0]}`, - `column-${toNode.columns[0]}`, - true - ); - verifyResponseStatusCode('@lineageApi', 200); - if (exitEditMode) { - cy.get('[data-testid="edit-lineage"]').click(); - } - cy.get( - `[data-testid="column-edge-${btoa(fromNode.columns[0])}-${btoa( - toNode.columns[0] - )}"]` - ); -}; - -const removeColumnLineage = (fromNode, toNode) => { - interceptURL('PUT', '/api/v1/lineage', 'lineageApi'); - cy.get( - `[data-testid="column-edge-${btoa(fromNode.columns[0])}-${btoa( - toNode.columns[0] - )}"]` - ).click({ force: true }); - cy.get('[data-testid="delete-button"]').click({ force: true }); - cy.get( - '[data-testid="delete-edge-confirmation-modal"] .ant-btn-primary' - ).click(); - - verifyResponseStatusCode('@lineageApi', 200); - - cy.get('[data-testid="edit-lineage"]').click(); - - cy.get( - `[data-testid="column-edge-${btoa(fromNode.columns[0])}-${btoa( - toNode.columns[0] - )}"]` - ).should('not.exist'); -}; - -// migrated to playwright -describe.skip('Lineage verification', { tags: 'DataAssets' }, () => { - beforeEach(() => { - cy.login(); - }); - - LINEAGE_ITEMS.forEach((entity, index) => { - it(`Lineage Add Node for entity ${entity.entityType}`, () => { - interceptURL('GET', '/api/v1/lineage', 'lineageApi'); - visitEntityDetailsPage({ - term: entity.term, - serviceName: entity.serviceName, - entity: entity.entity as EntityType, - entityFqn: entity.fqn, - }); - - cy.get('[data-testid="lineage"]').click(); - verifyColumnLayerInactive(); - cy.get('[data-testid="edit-lineage"]').click(); - - performZoomOut(); - - // Connect the current entity to all others in the array except itself - for (let i = 0; i < LINEAGE_ITEMS.length; i++) { - if (i !== index) { - connectEdgeBetweenNodes(entity, LINEAGE_ITEMS[i]); - } - } - - cy.get('[data-testid="edit-lineage"]').click(); - cy.reload(); - - verifyResponseStatusCode('@lineageApi', 200); - - performZoomOut(); - - // Verify Added Nodes - for (let i = 0; i < LINEAGE_ITEMS.length; i++) { - if (i !== index) { - verifyNodePresent(LINEAGE_ITEMS[i]); - } - } - - cy.get('[data-testid="edit-lineage"]').click(); - }); - - it(`Lineage Remove Node between ${entity.entityType}`, () => { - visitEntityDetailsPage({ - term: entity.term, - serviceName: entity.serviceName, - entity: entity.entity as EntityType, - entityFqn: entity.fqn, - }); - - cy.get('[data-testid="lineage"]').click(); - cy.get('[data-testid="edit-lineage"]').click(); - - performZoomOut(); - - // Delete Nodes - for (let i = 0; i < LINEAGE_ITEMS.length; i++) { - if (i !== index) { - deleteEdge(entity, LINEAGE_ITEMS[i]); - cy.get( - `[data-testid="edge-${entity.fqn}-${LINEAGE_ITEMS[i].fqn}"]` - ).should('not.exist'); - } - } - - cy.get('[data-testid="edit-lineage"]').click(); - }); - }); - - it('Lineage Add Pipeline Between Tables', () => { - const sourceEntity = LINEAGE_ITEMS[0]; - const targetEntity = LINEAGE_ITEMS[1]; - addPipelineBetweenNodes( - sourceEntity, - targetEntity, - PIPELINE_ITEMS[0], - true - ); - cy.get('[data-testid="edit-lineage"]').click(); - deleteNode(targetEntity); - }); - - it('Lineage Add Pipeline Between Table and Topic', () => { - const sourceEntity = LINEAGE_ITEMS[1]; - const targetEntity = LINEAGE_ITEMS[2]; - addPipelineBetweenNodes( - sourceEntity, - targetEntity, - PIPELINE_ITEMS[0], - true - ); - - editPipelineEdgeDescription( - sourceEntity, - targetEntity, - PIPELINE_ITEMS[0], - 'Test Description' - ); - - cy.get('[data-testid="edit-lineage"]').click(); - deleteNode(targetEntity); - }); - - it('Add column lineage', () => { - const sourceEntity = LINEAGE_ITEMS[0]; - for (let i = 1; i < LINEAGE_ITEMS.length; i++) { - const targetEntity = LINEAGE_ITEMS[i]; - if (targetEntity.columns.length > 0) { - addPipelineBetweenNodes(sourceEntity, targetEntity); - activateColumnLayer(); - // Add column lineage - addColumnLineage(sourceEntity, targetEntity); - - cy.get('[data-testid="edit-lineage"]').click(); - removeColumnLineage(sourceEntity, targetEntity); - - cy.get('[data-testid="edit-lineage"]').click(); - deleteNode(targetEntity); - cy.goToHomePage(); - } - } - }); -}); diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Database.spec.ts b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Database.spec.ts deleted file mode 100644 index 0cace729572..00000000000 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Database.spec.ts +++ /dev/null @@ -1,155 +0,0 @@ -/* - * 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. - */ - -import EntityClass from '../../common/Entities/EntityClass'; -import { CustomPropertyTypeByName } from '../../common/Utils/CustomProperty'; -import { updateJWTTokenExpiryTime } from '../../common/Utils/Login'; -import { JWT_EXPIRY_TIME_MAP } from '../../constants/constants'; -import DatabaseClass from './../../common/Entities/DatabaseClass'; -import DatabaseSchemaClass from './../../common/Entities/DatabaseSchemaClass'; -import StoreProcedureClass from './../../common/Entities/StoredProcedureClass'; -import TableClass from './../../common/Entities/TableClass'; - -const entities = [ - new DatabaseClass(), - new DatabaseSchemaClass(), - new TableClass(), - new StoreProcedureClass(), -] as const; - -const OWNER1 = 'Aaron Johnson'; -const OWNER2 = 'Cynthia Meyer'; - -const TEAM_OWNER_1 = 'Marketplace'; -const TEAM_OWNER_2 = 'DevOps'; - -// migrated to playwrigth -describe.skip('Database hierarchy details page', { tags: 'DataAssets' }, () => { - before(() => { - cy.login(); - - updateJWTTokenExpiryTime(JWT_EXPIRY_TIME_MAP['2 hours']); - EntityClass.preRequisitesForTests(); - }); - - after(() => { - cy.login(); - - updateJWTTokenExpiryTime(JWT_EXPIRY_TIME_MAP['1 hour']); - EntityClass.postRequisitesForTests(); - }); - - entities.forEach((entity) => { - describe(`${entity.getName()} page`, () => { - before(() => { - cy.login(); - - entity.prepareForTests(); - }); - - after(() => { - cy.login(); - - entity.cleanup(); - cy.logout(); - }); - - beforeEach(() => { - cy.login(); - entity.visitEntity(); - }); - - it(`Domain assign, update & delete`, () => { - entity.assignDomain(); - entity.updateDomain(); - entity.removeDomain(); - }); - - it(`User as Owner assign, update & delete`, () => { - entity.userOwnerFlow(OWNER1, OWNER2); - }); - - it(`Team as Owner assign, update & delete`, () => { - entity.teamOwnerFlow(TEAM_OWNER_1, TEAM_OWNER_2); - }); - - it(`Tier assign, update & delete`, () => { - entity.tierFlow('Tier1', 'Tier5'); - }); - - it(`Update description`, () => { - entity.updateDescription(); - }); - - it(`Tags assign, update & delete`, () => { - entity.assignTags(); - entity.updateTags(); - entity.removeTags(); - }); - - it(`GlossaryTerm assign, update & delete`, () => { - entity.assignGlossary(); - entity.updateGlossary(); - entity.removeGlossary(); - }); - - it(`Update displayName`, () => { - entity.renameEntity(); - }); - - it(`Announcement create & delete`, () => { - entity.createAnnouncement(); - entity.replyAnnouncement(); - entity.removeAnnouncement(); - }); - - it(`Inactive announcement create & delete`, () => { - entity.createInactiveAnnouncement(); - entity.removeInactiveAnnouncement(); - }); - - Object.values(CustomPropertyTypeByName).forEach((type) => { - it(`Set ${type} Custom Property `, () => { - entity.setCustomProperty( - entity.customPropertyValue[type].property, - entity.customPropertyValue[type].value - ); - }); - - it(`Update ${type} Custom Property`, () => { - entity.updateCustomProperty( - entity.customPropertyValue[type].property, - entity.customPropertyValue[type].newValue - ); - }); - }); - - it(`UpVote & DownVote entity`, () => { - entity.upVote(); - entity.downVote(); - }); - - it(`follow unfollow entity`, () => { - entity.followUnfollowEntity(); - }); - - it(`Soft delete`, () => { - entity.softDeleteEntity(); - }); - - it(`Hard delete`, () => { - entity.hardDeleteEntity(); - }); - }); - }); -}); diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Entity.spec.ts b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Entity.spec.ts deleted file mode 100644 index c58a5879783..00000000000 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Entity.spec.ts +++ /dev/null @@ -1,170 +0,0 @@ -/* - * 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. - */ - -import ContainerClass from '../../common/Entities/ContainerClass'; -import DashboardDataModelClass from '../../common/Entities/DataModelClass'; -import EntityClass from '../../common/Entities/EntityClass'; -import MlModelClass from '../../common/Entities/MlModelClass'; -import PipelineClass from '../../common/Entities/PipelineClass'; -import SearchIndexClass from '../../common/Entities/SearchIndexClass'; -import TopicClass from '../../common/Entities/TopicClass'; -import { updateJWTTokenExpiryTime } from '../../common/Utils/Login'; -import { JWT_EXPIRY_TIME_MAP } from '../../constants/constants'; -import { CustomPropertySupportedEntityList } from '../../constants/CustomProperty.constant'; -import DashboardClass from './../../common/Entities/DashboardClass'; -import { CustomPropertyTypeByName } from './../../common/Utils/CustomProperty'; - -// 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'; - -// migrated to playwrigth -describe.skip('Entity detail page', { tags: 'DataAssets' }, () => { - before(() => { - cy.login(); - - updateJWTTokenExpiryTime(JWT_EXPIRY_TIME_MAP['2 hours']); - EntityClass.preRequisitesForTests(); - }); - - after(() => { - cy.login(); - - updateJWTTokenExpiryTime(JWT_EXPIRY_TIME_MAP['1 hour']); - EntityClass.postRequisitesForTests(); - }); - entities.forEach((entity) => { - describe(`${entity.getName()} page`, () => { - before(() => { - cy.login(); - - entity.prepareForTests(); - }); - - after(() => { - cy.login(); - - entity.cleanup(); - cy.logout(); - }); - - beforeEach(() => { - cy.login(); - entity.visitEntity(); - }); - - it(`Domain assign, update & delete`, () => { - entity.assignDomain(); - entity.updateDomain(); - entity.removeDomain(); - }); - - it(`User as Owner assign, update & delete`, () => { - entity.userOwnerFlow(OWNER1, OWNER2); - }); - - it(`Team as Owner assign, update & delete`, () => { - entity.teamOwnerFlow(TEAM_OWNER_1, TEAM_OWNER_2); - }); - - it(`Tier assign, update & delete`, () => { - entity.tierFlow('Tier1', 'Tier5'); - }); - - it(`Update description`, () => { - entity.updateDescription(); - }); - - it(`Tags assign, update & delete`, () => { - entity.assignTags(); - entity.updateTags(); - entity.removeTags(); - }); - - it(`GlossaryTerm assign, update & delete`, () => { - entity.assignGlossary(); - entity.updateGlossary(); - entity.removeGlossary(); - }); - - it(`Update displayName`, () => { - entity.renameEntity(); - }); - - it(`Announcement create & delete`, () => { - entity.createAnnouncement(); - entity.replyAnnouncement(); - entity.removeAnnouncement(); - }); - - it(`Inactive Announcement create & delete`, () => { - entity.createInactiveAnnouncement(); - entity.removeInactiveAnnouncement(); - }); - - it(`UpVote & DownVote entity`, () => { - entity.upVote(); - entity.downVote(); - }); - - // Create custom property only for supported entities - if (CustomPropertySupportedEntityList.includes(entity.endPoint)) { - const properties = Object.values(CustomPropertyTypeByName).join(', '); - - it(`Set ${properties} Custom Property `, () => { - Object.values(CustomPropertyTypeByName).forEach((type) => { - entity.setCustomProperty( - entity.customPropertyValue[type].property, - entity.customPropertyValue[type].value - ); - }); - }); - - it(`Update ${properties} Custom Property`, () => { - Object.values(CustomPropertyTypeByName).forEach((type) => { - entity.updateCustomProperty( - entity.customPropertyValue[type].property, - entity.customPropertyValue[type].newValue - ); - }); - }); - } - - it(`follow unfollow entity`, () => { - entity.followUnfollowEntity(); - }); - - it(`Soft delete`, () => { - entity.softDeleteEntity(); - }); - - it(`Hard delete`, () => { - entity.hardDeleteEntity(); - }); - }); - }); -}); diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Services.spec.ts b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Services.spec.ts deleted file mode 100644 index 62452838681..00000000000 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Services.spec.ts +++ /dev/null @@ -1,130 +0,0 @@ -/* - * 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. - */ - -import EntityClass from '../../common/Entities/EntityClass'; -import DashboardServiceClass from './../../common/Entities/DashboardServiceClass'; -import DatabaseServiceClass from './../../common/Entities/DatabaseServiceClass'; -import MessagingServiceClass from './../../common/Entities/MessagingServiceClass'; -import MlModelServiceClass from './../../common/Entities/MlModelServiceClass'; -import PipelineServiceClass from './../../common/Entities/PipelineServiceClass'; -import SearchServiceClass from './../../common/Entities/SearchServiceClass'; -import StorageServiceClass from './../../common/Entities/StorageServiceClass'; - -const entities = [ - new DatabaseServiceClass(), - new MessagingServiceClass(), - new DashboardServiceClass(), - new PipelineServiceClass(), - new MlModelServiceClass(), - new StorageServiceClass(), - new SearchServiceClass(), - // TODO: add tests for metadata service tests - // new MetadataServiceClass(), -] as const; - -const OWNER1 = 'Aaron Johnson'; -const OWNER2 = 'Cynthia Meyer'; - -const TEAM_OWNER_1 = 'Marketplace'; -const TEAM_OWNER_2 = 'DevOps'; - -// migrated to playwrigth -describe.skip('Services detail page', { tags: 'Integration' }, () => { - before(() => { - cy.login(); - EntityClass.preRequisitesForTests(); - }); - - after(() => { - cy.login(); - - EntityClass.postRequisitesForTests(); - }); - - entities.forEach((entity) => { - describe(`${entity.getName()} page`, () => { - before(() => { - cy.login(); - - entity.prepareForTests(); - }); - - after(() => { - cy.login(); - entity.cleanup(); - }); - - beforeEach(() => { - cy.login(); - entity.visitEntity(); - }); - - it(`Domain assign, update & delete`, () => { - entity.assignDomain(); - entity.updateDomain(); - entity.removeDomain(); - }); - - it(`User as Owner assign, update & delete`, () => { - entity.userOwnerFlow(OWNER1, OWNER2); - }); - - it(`Team as Owner assign, update & delete`, () => { - entity.teamOwnerFlow(TEAM_OWNER_1, TEAM_OWNER_2); - }); - - it(`Tier assign, update & delete`, () => { - entity.tierFlow('Tier1', 'Tier5'); - }); - - it(`Update description`, () => { - entity.updateDescription(); - }); - - it(`Tags assign, update & delete`, () => { - entity.assignTags(); - entity.updateTags(); - entity.removeTags(); - }); - - it(`GlossaryTerm assign, update & delete`, () => { - entity.assignGlossary(); - entity.updateGlossary(); - entity.removeGlossary(); - }); - - it(`Update displayName`, () => { - entity.renameEntity(); - }); - - it(`Announcement create & delete`, () => { - entity.createAnnouncement(); - entity.replyAnnouncement(); - entity.removeAnnouncement(); - }); - - it(`Inactive Announcement create & delete`, () => { - entity.createInactiveAnnouncement(); - entity.removeInactiveAnnouncement(); - }); - - it(`Soft delete`, () => { - entity.softDeleteEntity(); - }); - - it(`Hard delete`, () => { - entity.hardDeleteEntity(); - }); - }); - }); -});