From 9d08cf7eb90c60ddcb4ee7e92e5cde92ba182263 Mon Sep 17 00:00:00 2001 From: Shailesh Parmar Date: Mon, 16 Jan 2023 12:21:24 +0530 Subject: [PATCH] Cypress: Fixed failing cypress test in main and glossary search localization (#9730) --- .../resources/ui/cypress/common/advancedSearch.js | 1 - .../ui/cypress/e2e/Flow/AdvanceSearch.spec.js | 14 +++++++++++--- .../e2e/Pages/DataQualityAndProfiler.spec.js | 2 ++ .../components/Glossary/GlossaryV1.component.tsx | 5 +++-- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/cypress/common/advancedSearch.js b/openmetadata-ui/src/main/resources/ui/cypress/common/advancedSearch.js index c815285d067..355f7090b4a 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/common/advancedSearch.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/common/advancedSearch.js @@ -173,7 +173,6 @@ export const goToAdvanceSearch = () => { .should('exist') .and('be.visible') .click(); - verifyResponseStatusCode('@explorePage', 200); cy.get('[data-testid="tables-tab"]') .scrollIntoView() diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Flow/AdvanceSearch.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Flow/AdvanceSearch.spec.js index b703da65263..e6c86174875 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Flow/AdvanceSearch.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Flow/AdvanceSearch.spec.js @@ -40,7 +40,6 @@ const service_name = MYSQL.serviceName; describe('Advance search should work properly for all fields', () => { beforeEach(() => { cy.login(); - cy.get('[data-testid="appbar-item-explore"]').and('be.visible').click(); }); it('Pre-requisite for advance search', () => { @@ -115,12 +114,15 @@ describe('Advance search should work properly for all fields', () => { }); }); }); + + after(() => { + Cypress.session.clearAllSavedSessions(); + }); }); describe('Advance search should work properly for Add Group functionality', () => { beforeEach(() => { cy.login(); - cy.get('[data-testid="appbar-item-explore"]').and('be.visible').click(); }); Object.values(OPERATOR).forEach((operator) => { @@ -194,12 +196,14 @@ describe('Advance search should work properly for Add Group functionality', () = }); }); }); + after(() => { + Cypress.session.clearAllSavedSessions(); + }); }); describe('Advance search should work properly for Add Rule functionality', () => { beforeEach(() => { cy.login(); - cy.get('[data-testid="appbar-item-explore"]').and('be.visible').click(); }); Object.values(OPERATOR).forEach((operator) => { @@ -280,4 +284,8 @@ describe('Advance search should work properly for Add Rule functionality', () => API_SERVICE.databaseServices ); }); + + after(() => { + Cypress.session.clearAllSavedSessions(); + }); }); diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/DataQualityAndProfiler.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/DataQualityAndProfiler.spec.js index 82ebe7ac90b..090719a9118 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/DataQualityAndProfiler.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/DataQualityAndProfiler.spec.js @@ -101,11 +101,13 @@ describe('Data Quality and Profiler should work properly', () => { .should('be.visible') .click(); cy.intercept('/api/v1/services/ingestionPipelines?*').as('ingestionData'); + interceptURL('GET', '/api/v1/config/airflow', 'airflow'); cy.get(`[data-testid="service-name-${serviceName}"]`) .should('exist') .click(); cy.get('[data-testid="tabs"]').should('exist'); cy.wait('@ingestionData'); + verifyResponseStatusCode('@airflow', 200); cy.get('[data-testid="Ingestions"]') .scrollIntoView() .should('be.visible') diff --git a/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryV1.component.tsx b/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryV1.component.tsx index 1d17d12bfda..77aee8596fc 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryV1.component.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/Glossary/GlossaryV1.component.tsx @@ -332,8 +332,9 @@ const GlossaryV1 = ({

{searchText ? ( - {t('label.no-glossary-found-for-searchText', { - searchText, + {t('message.no-entity-found-for-name', { + entity: t('label.glossary-term'), + name: searchText, })} ) : (