From b7ca64f6eb027e3a364716a852f25f48d92d8dd6 Mon Sep 17 00:00:00 2001 From: Shailesh Parmar Date: Fri, 23 Dec 2022 15:24:14 +0530 Subject: [PATCH] Cypress: Fixed data quality and profiler cypress test (#9461) * Cypress: Fixed data quality and profiler cypress test * added API wait for data quality test --- .../e2e/Pages/DataQualityAndProfiler.js | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/DataQualityAndProfiler.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/DataQualityAndProfiler.js index 2b18227eb1b..0967cc27615 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/DataQualityAndProfiler.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/DataQualityAndProfiler.js @@ -44,11 +44,17 @@ const serviceName = `${serviceType}-ct-test-${uuid()}`; const columnTestName = `${NEW_COLUMN_TEST_CASE.column}_${NEW_COLUMN_TEST_CASE.type}`; const goToProfilerTab = () => { + interceptURL( + 'GET', + `api/v1/tables/name/${serviceName}.*.${TEAM_ENTITY}?fields=*&include=all`, + 'waitForPageLoad' + ); visitEntityDetailsPage( TEAM_ENTITY, serviceName, MYDATA_SUMMARY_OPTIONS.tables ); + verifyResponseStatusCode('@waitForPageLoad', 200); cy.get('[data-testid="Profiler & Data Quality"]') .should('be.visible') @@ -139,13 +145,14 @@ describe('Data Quality and Profiler should work properly', () => { }); it('Add table test case with new test suite', () => { + const term = TEAM_ENTITY; goToProfilerTab(); - + interceptURL('GET', `api/v1/tables/name/${serviceName}.*.${term}?include=all`, 'addTableTestPage') cy.get('[data-testid="profiler-add-table-test-btn"]') .scrollIntoView() .should('be.visible') .click(); - + verifyResponseStatusCode('@addTableTestPage', 200) cy.get('[data-testid="create-new-test-suite"]') .should('be.visible') .click(); @@ -456,8 +463,13 @@ describe('Data Quality and Profiler should work properly', () => { it('SQL query should be visible while editing the test case', () => { const { term, entity, serviceName, sqlTestCase, testSuiteName, sqlQuery } = DATA_QUALITY_SAMPLE_DATA_TABLE; - + interceptURL( + 'GET', + `api/v1/tables/name/${serviceName}.*.${term}?fields=*&include=all`, + 'waitForPageLoad' + ); visitEntityDetailsPage(term, serviceName, entity); + verifyResponseStatusCode('@waitForPageLoad', 200); cy.get('[data-testid="inactive-link"]').should('be.visible').contains(term); cy.get('[data-testid="Profiler & Data Quality"]') .should('be.visible') @@ -466,10 +478,11 @@ describe('Data Quality and Profiler should work properly', () => { 'have.class', 'active' ); - + interceptURL('GET', `api/v1/tables/name/${serviceName}.*.${term}?include=all`, 'addTableTestPage') cy.get('[data-testid="profiler-add-table-test-btn"]') .should('be.visible') .click(); + verifyResponseStatusCode('@addTableTestPage', 200) // selecting existing test suite cy.get('#selectTestSuite_testSuiteId').should('exist').click();