Cypress: Fixed data quality and profiler cypress test (#9461)

* Cypress: Fixed data quality and profiler cypress test

* added API wait for data quality test
This commit is contained in:
Shailesh Parmar 2022-12-23 15:24:14 +05:30 committed by GitHub
parent c9fac5eb8b
commit b7ca64f6eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -44,11 +44,17 @@ const serviceName = `${serviceType}-ct-test-${uuid()}`;
const columnTestName = `${NEW_COLUMN_TEST_CASE.column}_${NEW_COLUMN_TEST_CASE.type}`; const columnTestName = `${NEW_COLUMN_TEST_CASE.column}_${NEW_COLUMN_TEST_CASE.type}`;
const goToProfilerTab = () => { const goToProfilerTab = () => {
interceptURL(
'GET',
`api/v1/tables/name/${serviceName}.*.${TEAM_ENTITY}?fields=*&include=all`,
'waitForPageLoad'
);
visitEntityDetailsPage( visitEntityDetailsPage(
TEAM_ENTITY, TEAM_ENTITY,
serviceName, serviceName,
MYDATA_SUMMARY_OPTIONS.tables MYDATA_SUMMARY_OPTIONS.tables
); );
verifyResponseStatusCode('@waitForPageLoad', 200);
cy.get('[data-testid="Profiler & Data Quality"]') cy.get('[data-testid="Profiler & Data Quality"]')
.should('be.visible') .should('be.visible')
@ -139,13 +145,14 @@ describe('Data Quality and Profiler should work properly', () => {
}); });
it('Add table test case with new test suite', () => { it('Add table test case with new test suite', () => {
const term = TEAM_ENTITY;
goToProfilerTab(); goToProfilerTab();
interceptURL('GET', `api/v1/tables/name/${serviceName}.*.${term}?include=all`, 'addTableTestPage')
cy.get('[data-testid="profiler-add-table-test-btn"]') cy.get('[data-testid="profiler-add-table-test-btn"]')
.scrollIntoView() .scrollIntoView()
.should('be.visible') .should('be.visible')
.click(); .click();
verifyResponseStatusCode('@addTableTestPage', 200)
cy.get('[data-testid="create-new-test-suite"]') cy.get('[data-testid="create-new-test-suite"]')
.should('be.visible') .should('be.visible')
.click(); .click();
@ -456,8 +463,13 @@ describe('Data Quality and Profiler should work properly', () => {
it('SQL query should be visible while editing the test case', () => { it('SQL query should be visible while editing the test case', () => {
const { term, entity, serviceName, sqlTestCase, testSuiteName, sqlQuery } = const { term, entity, serviceName, sqlTestCase, testSuiteName, sqlQuery } =
DATA_QUALITY_SAMPLE_DATA_TABLE; DATA_QUALITY_SAMPLE_DATA_TABLE;
interceptURL(
'GET',
`api/v1/tables/name/${serviceName}.*.${term}?fields=*&include=all`,
'waitForPageLoad'
);
visitEntityDetailsPage(term, serviceName, entity); visitEntityDetailsPage(term, serviceName, entity);
verifyResponseStatusCode('@waitForPageLoad', 200);
cy.get('[data-testid="inactive-link"]').should('be.visible').contains(term); cy.get('[data-testid="inactive-link"]').should('be.visible').contains(term);
cy.get('[data-testid="Profiler & Data Quality"]') cy.get('[data-testid="Profiler & Data Quality"]')
.should('be.visible') .should('be.visible')
@ -466,10 +478,11 @@ describe('Data Quality and Profiler should work properly', () => {
'have.class', 'have.class',
'active' 'active'
); );
interceptURL('GET', `api/v1/tables/name/${serviceName}.*.${term}?include=all`, 'addTableTestPage')
cy.get('[data-testid="profiler-add-table-test-btn"]') cy.get('[data-testid="profiler-add-table-test-btn"]')
.should('be.visible') .should('be.visible')
.click(); .click();
verifyResponseStatusCode('@addTableTestPage', 200)
// selecting existing test suite // selecting existing test suite
cy.get('#selectTestSuite_testSuiteId').should('exist').click(); cy.get('#selectTestSuite_testSuiteId').should('exist').click();