From 241c838c64d474bb98b998c3b4d22658b300e74d Mon Sep 17 00:00:00 2001 From: Chirag Madlani <12962843+chirag-madlani@users.noreply.github.com> Date: Mon, 2 Oct 2023 12:06:10 +0530 Subject: [PATCH] fix(test): cypress skipped tests (#13360) * fix(test): cypress skipped tests * limit cypress tests to changed one * fix service search * enable cypress tests * enable tier and owner spec --------- Co-authored-by: Sriharsha Chintalapani --- .../ui/cypress/constants/Version.constants.js | 42 +++++++++---------- .../cypress/e2e/AddNewService/Airflow.spec.js | 3 +- .../cypress/e2e/Features/QueryEntity.spec.js | 2 +- .../e2e/Features/RecentlyViewed.spec.js | 3 +- .../e2e/Flow/AddAndRemoveTierAndOwner.spec.js | 22 +++++----- .../ui/cypress/e2e/Pages/Alerts.spec.js | 2 +- .../ui/cypress/e2e/Pages/Glossary.spec.js | 6 +-- .../ui/cypress/e2e/Pages/Users.spec.js | 4 +- .../ui/src/components/Services/Services.tsx | 4 ++ .../resources/ui/src/enums/search.enum.ts | 1 + .../ui/src/interface/search.interface.ts | 6 +++ 11 files changed, 53 insertions(+), 42 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/cypress/constants/Version.constants.js b/openmetadata-ui/src/main/resources/ui/cypress/constants/Version.constants.js index cd225f2d7fd5..5fbb9352de45 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/constants/Version.constants.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/constants/Version.constants.js @@ -1023,13 +1023,13 @@ export const SERVICE_DETAILS_FOR_VERSION_TEST = { entityPatchPayload: COMMON_PATCH_PAYLOAD, settingsMenuId: 'services.dashboards', }, - // Pipeline: { - // serviceName: PIPELINE_SERVICE_NAME, - // serviceCategory: SERVICE_CATEGORIES.PIPELINE_SERVICES, - // entityCreationDetails: PIPELINE_SERVICE_DETAILS_FOR_VERSION_TEST, - // entityPatchPayload: COMMON_PATCH_PAYLOAD, - // settingsMenuId: 'services.pipelines', - // }, + Pipeline: { + serviceName: PIPELINE_SERVICE_NAME, + serviceCategory: SERVICE_CATEGORIES.PIPELINE_SERVICES, + entityCreationDetails: PIPELINE_SERVICE_DETAILS_FOR_VERSION_TEST, + entityPatchPayload: COMMON_PATCH_PAYLOAD, + settingsMenuId: 'services.pipelines', + }, 'ML Model': { serviceName: ML_MODEL_SERVICE_NAME, serviceCategory: SERVICE_CATEGORIES.ML_MODEL_SERVICES, @@ -1037,20 +1037,20 @@ export const SERVICE_DETAILS_FOR_VERSION_TEST = { entityPatchPayload: COMMON_PATCH_PAYLOAD, settingsMenuId: 'services.mlModels', }, - // Storage: { - // serviceName: STORAGE_SERVICE_NAME, - // serviceCategory: SERVICE_CATEGORIES.STORAGE_SERVICES, - // entityCreationDetails: STORAGE_SERVICE_DETAILS_FOR_VERSION_TEST, - // entityPatchPayload: COMMON_PATCH_PAYLOAD, - // settingsMenuId: 'services.storages', - // }, - // Search: { - // serviceName: SEARCH_SERVICE_NAME, - // serviceCategory: SERVICE_CATEGORIES.SEARCH_SERVICES, - // entityCreationDetails: SEARCH_SERVICE_DETAILS_FOR_VERSION_TEST, - // entityPatchPayload: COMMON_PATCH_PAYLOAD, - // settingsMenuId: 'services.search', - // }, + Storage: { + serviceName: STORAGE_SERVICE_NAME, + serviceCategory: SERVICE_CATEGORIES.STORAGE_SERVICES, + entityCreationDetails: STORAGE_SERVICE_DETAILS_FOR_VERSION_TEST, + entityPatchPayload: COMMON_PATCH_PAYLOAD, + settingsMenuId: 'services.storages', + }, + Search: { + serviceName: SEARCH_SERVICE_NAME, + serviceCategory: SERVICE_CATEGORIES.SEARCH_SERVICES, + entityCreationDetails: SEARCH_SERVICE_DETAILS_FOR_VERSION_TEST, + entityPatchPayload: COMMON_PATCH_PAYLOAD, + settingsMenuId: 'services.search', + }, }; export const DATABASE_DETAILS_FOR_VERSION_TEST = { diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/Airflow.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/Airflow.spec.js index 88a36c0b1f70..09aef714f80b 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/Airflow.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/Airflow.spec.js @@ -54,8 +54,7 @@ describe('Airflow Ingestion', () => { }); }); - // Todo: unskip below test once issue is fixed https://github.com/open-metadata/OpenMetadata/issues/11676 - it.skip('Update pipeline description and verify description after re-run', () => { + it('Update pipeline description and verify description after re-run', () => { updateDescriptionForIngestedTables( serviceName, tableName, diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Features/QueryEntity.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Features/QueryEntity.spec.js index e3bf96f2af0e..47ec156c1475 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Features/QueryEntity.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Features/QueryEntity.spec.js @@ -30,7 +30,7 @@ const DATA = { }, }; -describe.skip('Query Entity', () => { +describe('Query Entity', () => { beforeEach(() => { cy.login(); cy.get("[data-testid='welcome-screen-close-btn']").click(); diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Features/RecentlyViewed.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Features/RecentlyViewed.spec.js index 6b09a56de64b..a62c2f7f29be 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Features/RecentlyViewed.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Features/RecentlyViewed.spec.js @@ -53,8 +53,7 @@ describe('Recently viwed data assets', () => { ).should('have.length', 0); }); - // Todo: locally its working as expected but in cypress its not showing recently view table - it.skip(`recently view section should have at max list of 5 entity`, () => { + it(`recently view section should have at max list of 5 entity`, () => { RECENTLY_VIEW_ENTITIES.map((entity, index) => { visitEntityDetailsPage(entity.term, entity.serviceName, entity.entity); diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Flow/AddAndRemoveTierAndOwner.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Flow/AddAndRemoveTierAndOwner.spec.js index 098a5e33da83..4f29036f7b81 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Flow/AddAndRemoveTierAndOwner.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Flow/AddAndRemoveTierAndOwner.spec.js @@ -24,20 +24,22 @@ import { } from '../../common/common'; import { DELETE_TERM, + SEARCH_ENTITY_DASHBOARD, SEARCH_ENTITY_MLMODEL, SEARCH_ENTITY_PIPELINE, SEARCH_ENTITY_STORED_PROCEDURE, + SEARCH_ENTITY_TABLE, SEARCH_ENTITY_TOPIC, } from '../../constants/constants'; const ENTITIES = { - // table: { - // ...SEARCH_ENTITY_TABLE.table_5, - // schema: 'shopify', - // database: 'ecommerce_db', - // }, + table: { + ...SEARCH_ENTITY_TABLE.table_5, + schema: 'shopify', + database: 'ecommerce_db', + }, topic: SEARCH_ENTITY_TOPIC.topic_2, - // dashboard: SEARCH_ENTITY_DASHBOARD.dashboard_2, + dashboard: SEARCH_ENTITY_DASHBOARD.dashboard_2, pipeline: SEARCH_ENTITY_PIPELINE.pipeline_2, mlmodel: SEARCH_ENTITY_MLMODEL.mlmodel_2, storedProcedure: SEARCH_ENTITY_STORED_PROCEDURE.stored_procedure_2, @@ -88,7 +90,7 @@ describe('Add and Remove Owner', () => { }); }); - it.skip('databaseSchema details page', () => { + it('databaseSchema details page', () => { interceptURL('PATCH', '/api/v1/databaseSchemas/*', 'patchOwner'); interceptURL('GET', '/api/v1/*/name/*', 'schemaDetails'); const value = ENTITIES.table; @@ -106,7 +108,7 @@ describe('Add and Remove Owner', () => { addRemoveOwner(OWNER, 'databaseSchemas'); }); - it.skip('database details page', () => { + it('database details page', () => { interceptURL('PATCH', '/api/v1/databases/*', 'patchOwner'); interceptURL('GET', '/api/v1/databases/name/*', 'databaseDetails'); const value = ENTITIES.table; @@ -124,7 +126,7 @@ describe('Add and Remove Owner', () => { addRemoveOwner(OWNER, 'databases'); }); - it.skip('service details page', () => { + it('service details page', () => { interceptURL('PATCH', '/api/v1/services/databaseServices/*', 'patchOwner'); interceptURL( 'GET', @@ -341,7 +343,7 @@ describe('Add and Remove Tier', () => { }); }); - it.skip('database details page', () => { + it('database details page', () => { interceptURL('GET', '/api/v1/databases/name/*', 'databaseDetails'); const value = ENTITIES.table; visitEntityDetailsPage(value.term, value.serviceName, value.entity); diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Alerts.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Alerts.spec.js index 9ce762fd364d..1325595d6459 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Alerts.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Alerts.spec.js @@ -56,7 +56,7 @@ const visitAddAlertPage = () => { }); }; -describe.skip('Alerts page should work properly', () => { +describe('Alerts page should work properly', () => { beforeEach(() => { interceptURL('POST', '/api/v1/events/subscriptions', 'createAlert'); interceptURL('GET', `/api/v1/search/query?q=*`, 'getSearchResult'); diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Glossary.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Glossary.spec.js index 6aae08991080..eb24ac2a44cb 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Glossary.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Glossary.spec.js @@ -721,7 +721,7 @@ describe('Glossary page should work properly', () => { voteGlossary(true); }); - it.skip('Update glossary term', () => { + it('Update glossary term', () => { const uSynonyms = ['pick up', 'take', 'obtain']; const newRef = { name: 'take', url: 'https://take.com' }; const term2 = NEW_GLOSSARY_TERMS.term_2.name; @@ -758,7 +758,7 @@ describe('Glossary page should work properly', () => { voteGlossary(); }); - it.skip('Assets Tab should work properly', () => { + it('Assets Tab should work properly', () => { selectActiveGlossary(NEW_GLOSSARY.name); const glossary = NEW_GLOSSARY.name; const term1 = NEW_GLOSSARY_TERMS.term_1.name; @@ -889,7 +889,7 @@ describe('Glossary page should work properly', () => { .should('be.visible'); }); - it.skip('Remove Glossary term from entity should work properly', () => { + it('Remove Glossary term from entity should work properly', () => { const glossaryName = NEW_GLOSSARY_1.name; const { name, fullyQualifiedName } = NEW_GLOSSARY_1_TERMS.term_1; const entity = SEARCH_ENTITY_TABLE.table_3; diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Users.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Users.spec.js index 32d6a27365b0..ffe519b57e15 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Users.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/Users.spec.js @@ -54,11 +54,11 @@ describe('Users flow should work properly', () => { softDeleteUser(userName); }); - it.skip('Restore soft deleted user', () => { + it('Restore soft deleted user', () => { restoreUser(userName); }); - it.skip('Permanently Delete Soft Deleted User', () => { + it('Permanently Delete Soft Deleted User', () => { softDeleteUser(userName); deleteSoftDeletedUser(userName); }); diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Services/Services.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Services/Services.tsx index 542e429e61b4..d516667754d4 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Services/Services.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Services/Services.tsx @@ -100,6 +100,10 @@ const Services = ({ serviceName }: ServicesProps) => { return SearchIndex.PIPELINE_SERVICE; case ServiceCategory.ML_MODEL_SERVICES: return SearchIndex.ML_MODEL_SERVICE; + case ServiceCategory.STORAGE_SERVICES: + return SearchIndex.STORAGE_SERVICE; + case ServiceCategory.SEARCH_SERVICES: + return SearchIndex.SEARCH_SERVICE; } return SearchIndex.DATABASE_SERVICE; diff --git a/openmetadata-ui/src/main/resources/ui/src/enums/search.enum.ts b/openmetadata-ui/src/main/resources/ui/src/enums/search.enum.ts index fa7176ccb96d..85ee1168a9df 100644 --- a/openmetadata-ui/src/main/resources/ui/src/enums/search.enum.ts +++ b/openmetadata-ui/src/main/resources/ui/src/enums/search.enum.ts @@ -32,6 +32,7 @@ export enum SearchIndex { SEARCH_SERVICE = 'search_service_search_index', DASHBOARD_SERCVICE = 'dashboard_service_search_index', ML_MODEL_SERVICE = 'mlmodel_service_search_index', + STORAGE_SERVICE = 'storage_service_search_index', DOMAIN = 'domain_search_index', SEARCH_INDEX = 'search_entity_index', STORED_PROCEDURE = 'stored_procedure_search_index', diff --git a/openmetadata-ui/src/main/resources/ui/src/interface/search.interface.ts b/openmetadata-ui/src/main/resources/ui/src/interface/search.interface.ts index 32800e2fe032..14b94a61d2e0 100644 --- a/openmetadata-ui/src/main/resources/ui/src/interface/search.interface.ts +++ b/openmetadata-ui/src/main/resources/ui/src/interface/search.interface.ts @@ -138,6 +138,10 @@ export interface SearchServiceSearchSource extends SearchSourceBase, SearchService {} +export interface StorageServiceSearchSource + extends SearchSourceBase, + SearchService {} + export type ExploreSearchSource = | TableSearchSource | DashboardSearchSource @@ -161,6 +165,7 @@ export type ExploreSearchSource = | MlModelServiceSearchSource | MessagingServiceSearchSource | SearchServiceSearchSource + | StorageServiceSearchSource | DomainSearchSource | SearchIndexSearchSource; @@ -185,6 +190,7 @@ export type SearchIndexSearchSourceMapping = { [SearchIndex.ML_MODEL_SERVICE]: MlModelServiceSearchSource; [SearchIndex.MESSAGING_SERVICE]: MessagingServiceSearchSource; [SearchIndex.SEARCH_SERVICE]: SearchServiceSearchSource; + [SearchIndex.STORAGE_SERVICE]: StorageServiceSearchSource; [SearchIndex.DOMAIN]: DomainSearchSource; [SearchIndex.SEARCH_INDEX]: SearchIndexSearchSource; [SearchIndex.STORED_PROCEDURE]: StoredProcedureSearchSource;