diff --git a/openmetadata-ui/src/main/resources/ui/cypress/common/DataInsightUtils.js b/openmetadata-ui/src/main/resources/ui/cypress/common/DataInsightUtils.js index 42e0a8335fd3..eb48e4a5e559 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/common/DataInsightUtils.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/common/DataInsightUtils.js @@ -10,9 +10,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { RETRY_TIMES } from './common'; +import { SidebarItem } from '../constants/Entity.interface'; +import { interceptURL, RETRY_TIMES, verifyResponseStatusCode } from './common'; const BASE_WAIT_TIME = 4000; +let isSuccessStatus = false; export const checkDataInsightSuccessStatus = ( count = 1, @@ -38,10 +40,29 @@ export const checkDataInsightSuccessStatus = ( if ($ingestionStatus.text() !== 'Success') { cy.get('@checkRun').should('have.text', 'Success'); - return true; + isSuccessStatus = true; } - return false; + isSuccessStatus = false; } }); }; + +export const verifyKpiChart = () => { + interceptURL( + 'GET', + '/api/v1/analytics/dataInsights/charts/aggregate?*', + 'dataInsightsChart' + ); + checkDataInsightSuccessStatus(); + + cy.sidebarClick(SidebarItem.DATA_INSIGHT); + verifyResponseStatusCode('@dataInsightsChart', 200); + cy.get('[data-testid="search-dropdown-Team"]').should('be.visible'); + cy.get('[data-testid="search-dropdown-Tier"]').should('be.visible'); + cy.get('[data-testid="summary-card"]').should('be.visible'); + cy.get('[data-testid="kpi-card"]').should('be.visible'); + if (isSuccessStatus) { + cy.get('#kpi-chart').scrollIntoView().should('be.visible'); + } +}; diff --git a/openmetadata-ui/src/main/resources/ui/cypress/common/common.js b/openmetadata-ui/src/main/resources/ui/cypress/common/common.js index 1de78e5bbabf..400490ec6ef9 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/common/common.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/common/common.js @@ -625,7 +625,7 @@ export const editCreatedProperty = (propertyName) => { cy.get('[data-testid="save"]').click(); - cy.wait('@checkPatchForDescription', { timeout: 10000 }); + cy.wait('@checkPatchForDescription', { timeout: 15000 }); cy.get('.ant-modal-wrap').should('not.exist'); diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/DataInsight.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/DataInsight.spec.js index 7671683e8123..e3a5b2920a1a 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/DataInsight.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/DataInsight.spec.js @@ -22,7 +22,7 @@ import { interceptURL, verifyResponseStatusCode, } from '../../common/common'; -import { checkDataInsightSuccessStatus } from '../../common/DataInsightUtils'; +import { verifyKpiChart } from '../../common/DataInsightUtils'; import { SidebarItem } from '../../constants/Entity.interface'; import { GlobalSettingOptions } from '../../constants/settings.constant'; @@ -39,8 +39,6 @@ const KPI_DATA = [ }, ]; -let isSuccessStatus = false; - const deleteKpiRequest = () => { cy.get('[data-menu-id*="kpi"]').click(); cy.wait('@getKpi').then(({ response }) => { @@ -141,7 +139,7 @@ describe('Data Insight feature', () => { cy.get('[data-testid="run-now-button"]').click(); verifyResponseStatusCode('@triggerPipeline', 200); cy.reload(); - isSuccessStatus = checkDataInsightSuccessStatus(); + verifyKpiChart(); }); it('Verifying Data assets tab', () => { @@ -151,9 +149,6 @@ describe('Data Insight feature', () => { cy.get('[data-testid="search-dropdown-Tier"]').should('be.visible'); cy.get('[data-testid="summary-card"]').should('be.visible'); cy.get('[data-testid="kpi-card"]').should('be.visible'); - if (isSuccessStatus) { - cy.get('#kpi-chart').scrollIntoView().should('be.visible'); - } cy.get('#entity-summary-chart').scrollIntoView().should('be.visible'); cy.get('#PercentageOfEntitiesWithDescriptionByType-graph') .scrollIntoView() diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/DataInsightSettings.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/DataInsightSettings.spec.js index d64c5fbfb576..133218bbd666 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/DataInsightSettings.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/DataInsightSettings.spec.js @@ -37,7 +37,7 @@ describe('Data Insight settings page should work properly', () => { ).click(); verifyResponseStatusCode('@getDataInsightDetails', 200); cy.get('[data-testid="edit-button"]').click(); - cy.get('#cronType').click(); + cy.get('[data-testid="cron-type"]').click(); cy.get('[title="Day"]').click(); cy.get('[data-testid="hour-options"]').click(); cy.get('[title="01"]').click(); @@ -82,8 +82,8 @@ describe('Data Insight settings page should work properly', () => { ).click(); cy.get('[data-testid="install-application"]').click(); cy.get('[data-testid="save-button"]').click(); - cy.get('#cronType').click(); - cy.get('[title="Day"]').click(); + cy.get('[data-testid="cron-type"]').click(); + cy.get('.rc-virtual-list [title="Day"]').click(); cy.get('[data-testid="cron-type"]').should('contain', 'Day'); cy.get('[data-testid="deploy-button"]').click(); verifyResponseStatusCode('@installApplication', 201); diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/MyData.spec.ts b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/MyData.spec.ts index cc2e80d1a33c..25e525e30a8f 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/MyData.spec.ts +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/MyData.spec.ts @@ -119,7 +119,9 @@ const verifyEntities = ({ url }) => { tables.forEach((table) => { cy.get( `[data-testid="table-data-card_${table.databaseSchema}.${table.name}"]` - ).should('be.exist'); + ) + .scrollIntoView() + .should('be.exist'); }); }; diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/SearchIndexApplication.spec.ts b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/SearchIndexApplication.spec.ts index 24e417d336b4..abde7848beff 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/SearchIndexApplication.spec.ts +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/SearchIndexApplication.spec.ts @@ -40,7 +40,7 @@ describe('Search Index Application', () => { interceptURL('PATCH', '/api/v1/apps/*', 'updateApplication'); visitSearchApplicationPage(); cy.get('[data-testid="edit-button"]').click(); - cy.get('#cronType').click(); + cy.get('[data-testid="cron-type"]').click(); cy.get('[title="Day"]').click(); cy.get('[data-testid="hour-options"]').click(); cy.get('[title="01"]').click(); @@ -86,8 +86,8 @@ describe('Search Index Application', () => { cy.get('[data-testid="install-application"]').click(); cy.get('[data-testid="save-button"]').scrollIntoView().click(); cy.get('[data-testid="submit-btn"]').scrollIntoView().click(); - cy.get('#cronType').click(); - cy.get('[title="Day"]').click(); + cy.get('[data-testid="cron-type"]').click(); + cy.get('.rc-virtual-list [title="Day"]').click(); cy.get('[data-testid="cron-type"]').should('contain', 'Day'); cy.get('[data-testid="deploy-button"]').click(); verifyResponseStatusCode('@installApplication', 201);