From 33c429f67c42dc72cc51c8033c8444375ba07e23 Mon Sep 17 00:00:00 2001 From: Shailesh Parmar Date: Thu, 27 Apr 2023 19:30:45 +0530 Subject: [PATCH] fixed kafka cypress test (#11313) * fixed kafka cypress test * added API wait for dbt * added wait on database * reverting cypress.config changes --- .../main/resources/ui/cypress/common/common.js | 6 +++--- .../e2e/AddNewService/redshiftWithDBT.spec.js | 17 ++++++++++++++++- 2 files changed, 19 insertions(+), 4 deletions(-) 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 41b3d57d027..36abde256d2 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/common/common.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/common/common.js @@ -110,12 +110,13 @@ export const handleIngestionRetry = ( testIngestionsTab(); if (retryCount !== 0) { + verifyResponseStatusCode('@serviceDetails', 200); verifyResponseStatusCode('@ingestionPipelines', 200); + verifyResponseStatusCode('@airflow', 200); verifyResponseStatusCode('@pipelineStatuses', 200, { responseTimeout: 50000, }); verifyResponseStatusCode('@ingestionPermissions', 200); - verifyResponseStatusCode('@airflow', 200); } retryCount++; @@ -134,7 +135,6 @@ export const handleIngestionRetry = ( cy.wait(timer); timer *= 2; cy.reload(); - verifyResponseStatusCode('@serviceDetails', 200); checkSuccessState(); } else { cy.get('@checkRun').should('have.text', 'Success'); @@ -301,9 +301,9 @@ export const testServiceCreationAndIngestion = ( interceptURL('GET', '/api/v1/services/*/name/*', 'serviceDetails'); cy.get('[data-testid="view-service-button"]').should('be.visible').click(); + verifyResponseStatusCode('@serviceDetails', 200); verifyResponseStatusCode('@getIngestionPipelineStatus', 200); verifyResponseStatusCode('@ingestionPipelines', 200); - verifyResponseStatusCode('@serviceDetails', 200); handleIngestionRetry(type, testIngestionButton); }; 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 b9ca3510932..adcb2f40f0b 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 @@ -131,6 +131,7 @@ describe('RedShift Ingestion', () => { 'ingestionPermissions' ); interceptURL('GET', '/api/v1/services/*/name/*', 'serviceDetails'); + interceptURL('GET', '/api/v1/databases?*', 'databases'); cy.get(`[data-testid="service-name-${REDSHIFT.serviceName}"]`) .should('exist') .click(); @@ -140,6 +141,7 @@ describe('RedShift Ingestion', () => { }); verifyResponseStatusCode('@serviceDetails', 200); verifyResponseStatusCode('@airflow', 200); + verifyResponseStatusCode('@databases', 200); cy.get('[data-testid="tabs"]').should('exist'); cy.get('[data-testid="Ingestions"]') .scrollIntoView() @@ -181,11 +183,24 @@ describe('RedShift Ingestion', () => { scheduleIngestion(); cy.wait('@deployIngestion').then(() => { + interceptURL( + 'GET', + '/api/v1/services/ingestionPipelines?*', + 'ingestionPipelines' + ); + interceptURL('GET', '/api/v1/services/*/name/*', 'serviceDetails'); + interceptURL( + 'GET', + '/api/v1/services/ingestionPipelines/status', + 'getIngestionPipelineStatus' + ); cy.get('[data-testid="view-service-button"]') .scrollIntoView() .should('be.visible') .click(); - + verifyResponseStatusCode('@serviceDetails', 200); + verifyResponseStatusCode('@getIngestionPipelineStatus', 200); + verifyResponseStatusCode('@ingestionPipelines', 200); handleIngestionRetry('database', true, 0, 'dbt'); }); });