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 f7955e3b316..fd438c04aca 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/common/common.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/common/common.js @@ -74,18 +74,12 @@ export const handleIngestionRetry = ( // ingestions page let retryCount = count; const testIngestionsTab = () => { - cy.get('[data-testid="Ingestions"]').should('exist').and('be.visible'); - cy.get('[data-testid="Ingestions"] >> [data-testid="filter-count"]').should( - 'have.text', - rowIndex - ); // click on the tab only for the first time if (retryCount === 0) { - // Wait for pipeline status to be loaded - if (ingestionType === 'metadata') { - verifyResponseStatusCode('@ingestionPipelines', 200); - } - + cy.get('[data-testid="Ingestions"]').should('exist').and('be.visible'); + cy.get( + '[data-testid="Ingestions"] >> [data-testid="filter-count"]' + ).should('have.text', rowIndex); cy.get('[data-testid="Ingestions"]').click(); if (ingestionType === 'metadata') { @@ -112,15 +106,9 @@ export const handleIngestionRetry = ( retryCount++; - if (ingestionType === 'metadata') { - cy.get(`[data-row-key*="${ingestionType}"]`) - .find('[data-testid="pipeline-status"]') - .as('checkRun'); - } else { - cy.get(`[data-row-key*="${ingestionType}"]`) - .find('[data-testid="pipeline-status"]') - .as('checkRun'); - } + cy.get(`[data-row-key*="${ingestionType}"]`) + .find('[data-testid="pipeline-status"]') + .as('checkRun'); // the latest run should be success cy.get('@checkRun').then(($ingestionStatus) => { if ( @@ -290,9 +278,17 @@ export const testServiceCreationAndIngestion = ( cy.clock(); cy.wait(10000); - cy.get('[data-testid="view-service-button"]').should('be.visible'); - cy.get('[data-testid="view-service-button"]').click(); + interceptURL( + 'GET', + '/api/v1/services/ingestionPipelines?*', + 'ingestionPipelines' + ); + interceptURL('GET', '/api/v1/services/*/name/*', 'serviceDetails'); + + cy.get('[data-testid="view-service-button"]').should('be.visible').click(); verifyResponseStatusCode('@getIngestionPipelineStatus', 200); + verifyResponseStatusCode('@ingestionPipelines', 200); + verifyResponseStatusCode('@serviceDetails', 200); handleIngestionRetry(type, testIngestionButton); }; diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/postgres.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/postgres.spec.js index e703819eebf..bd414860a7c 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/postgres.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/postgres.spec.js @@ -115,22 +115,36 @@ describe('Postgres Ingestion', () => { .click(); verifyResponseStatusCode('@getServices', 200); - cy.intercept('/api/v1/services/ingestionPipelines?*').as('ingestionData'); + interceptURL( + 'GET', + '/api/v1/services/ingestionPipelines?*', + 'ingestionData' + ); interceptURL( 'GET', '/api/v1/system/config/pipeline-service-client', 'airflow' ); + interceptURL( + 'GET', + '/api/v1/permissions/ingestionPipeline/name/*', + 'ingestionPermissions' + ); + interceptURL('GET', '/api/v1/services/*/name/*', 'serviceDetails'); cy.get(`[data-testid="service-name-${serviceName}"]`) .should('exist') .click(); - cy.get('[data-testid="tabs"]').should('exist'); - cy.wait('@ingestionData'); + verifyResponseStatusCode('@ingestionData', 200, { + responseTimeout: 50000, + }); + verifyResponseStatusCode('@serviceDetails', 200); verifyResponseStatusCode('@airflow', 200); + cy.get('[data-testid="tabs"]').should('exist'); cy.get('[data-testid="Ingestions"]') .scrollIntoView() .should('be.visible') .click(); + verifyResponseStatusCode('@ingestionPermissions', 200); cy.get('[data-testid="ingestion-details-container"]').should('exist'); cy.get('[data-testid="add-new-ingestion-button"]') .should('be.visible') diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/redshiftWithDBT.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/redshiftWithDBT.spec.js index 54647328177..02e43246d9a 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/redshiftWithDBT.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/redshiftWithDBT.spec.js @@ -109,22 +109,37 @@ describe('RedShift Ingestion', () => { .click(); verifyResponseStatusCode('@getServices', 200); - cy.intercept('/api/v1/services/ingestionPipelines?*').as('ingestionData'); + interceptURL( + 'GET', + '/api/v1/services/ingestionPipelines?*', + 'ingestionData' + ); interceptURL( 'GET', '/api/v1/system/config/pipeline-service-client', 'airflow' ); + interceptURL( + 'GET', + '/api/v1/permissions/ingestionPipeline/name/*', + 'ingestionPermissions' + ); + interceptURL('GET', '/api/v1/services/*/name/*', 'serviceDetails'); cy.get(`[data-testid="service-name-${REDSHIFT.serviceName}"]`) .should('exist') .click(); - cy.get('[data-testid="tabs"]').should('exist'); - cy.wait('@ingestionData'); + + verifyResponseStatusCode('@ingestionData', 200, { + responseTimeout: 50000, + }); + verifyResponseStatusCode('@serviceDetails', 200); verifyResponseStatusCode('@airflow', 200); + cy.get('[data-testid="tabs"]').should('exist'); cy.get('[data-testid="Ingestions"]') .scrollIntoView() .should('be.visible') .click(); + verifyResponseStatusCode('@ingestionPermissions', 200); cy.get('[data-testid="ingestion-details-container"]').should('exist'); cy.get('[data-testid="add-new-ingestion-button"]') .should('be.visible') diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Features/TeamsHierarchy.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Features/TeamsHierarchy.spec.js index 96626ba6312..40b8c927825 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Features/TeamsHierarchy.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Features/TeamsHierarchy.spec.js @@ -38,7 +38,7 @@ describe('Add nested teams and test TeamsSelectable', () => { cy.login(); cy.get('[data-testid="appbar-item-settings"]').should('be.visible').click(); - interceptURL('GET', '/api/v1/teams/name/Organization?*', 'getOrganization'); + interceptURL('GET', '/api/v1/teams/name/*', 'getOrganization'); interceptURL('GET', '/api/v1/users*', 'getTeams'); interceptURL('GET', '/api/v1/permissions/team/*', 'getPermissions'); // Clicking on teams @@ -64,6 +64,8 @@ describe('Add nested teams and test TeamsSelectable', () => { verifyResponseStatusCode('@getCreatedTeam', 200); // asserting the added values cy.get('table').find('.ant-table-row').contains(teamName).click(); + verifyResponseStatusCode('@getOrganization', 200); + verifyResponseStatusCode('@getPermissions', 200); }); });