2022-09-19 18:43:39 +05:30
|
|
|
/*
|
2022-12-27 12:37:58 +05:30
|
|
|
* Copyright 2022 Collate.
|
2022-09-19 18:43:39 +05:30
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2023-01-15 18:24:10 +05:30
|
|
|
// / <reference types="cypress" />
|
2022-09-19 18:43:39 +05:30
|
|
|
|
2022-10-29 09:05:20 +05:30
|
|
|
import {
|
2023-01-15 18:24:10 +05:30
|
|
|
deleteCreatedService,
|
|
|
|
descriptionBox,
|
|
|
|
goToAddNewServicePage,
|
|
|
|
handleIngestionRetry,
|
|
|
|
interceptURL,
|
|
|
|
mySqlConnectionInput,
|
|
|
|
scheduleIngestion,
|
|
|
|
testServiceCreationAndIngestion,
|
|
|
|
toastNotification,
|
|
|
|
uuid,
|
|
|
|
verifyResponseStatusCode,
|
|
|
|
visitEntityDetailsPage,
|
2022-10-29 09:05:20 +05:30
|
|
|
} from '../../common/common';
|
|
|
|
import {
|
2023-01-15 18:24:10 +05:30
|
|
|
API_SERVICE,
|
|
|
|
DATA_QUALITY_SAMPLE_DATA_TABLE,
|
|
|
|
DELETE_TERM,
|
|
|
|
MYDATA_SUMMARY_OPTIONS,
|
|
|
|
NEW_COLUMN_TEST_CASE,
|
2023-02-03 16:30:50 +05:30
|
|
|
NEW_COLUMN_TEST_CASE_WITH_NULL_TYPE,
|
2023-01-15 18:24:10 +05:30
|
|
|
NEW_TABLE_TEST_CASE,
|
|
|
|
NEW_TEST_SUITE,
|
|
|
|
SERVICE_TYPE,
|
|
|
|
TEAM_ENTITY,
|
2022-10-29 09:05:20 +05:30
|
|
|
} from '../../constants/constants';
|
2022-09-19 18:43:39 +05:30
|
|
|
|
|
|
|
const serviceType = 'Mysql';
|
|
|
|
const serviceName = `${serviceType}-ct-test-${uuid()}`;
|
|
|
|
const columnTestName = `${NEW_COLUMN_TEST_CASE.column}_${NEW_COLUMN_TEST_CASE.type}`;
|
2023-02-03 16:30:50 +05:30
|
|
|
const nonTeamTypeColumnTestName = `${NEW_COLUMN_TEST_CASE_WITH_NULL_TYPE.column}_${NEW_COLUMN_TEST_CASE_WITH_NULL_TYPE.type}`;
|
2022-09-19 18:43:39 +05:30
|
|
|
|
|
|
|
const goToProfilerTab = () => {
|
2022-12-23 15:24:14 +05:30
|
|
|
interceptURL(
|
|
|
|
'GET',
|
|
|
|
`api/v1/tables/name/${serviceName}.*.${TEAM_ENTITY}?fields=*&include=all`,
|
|
|
|
'waitForPageLoad'
|
|
|
|
);
|
2022-09-29 15:21:33 +05:30
|
|
|
visitEntityDetailsPage(
|
|
|
|
TEAM_ENTITY,
|
|
|
|
serviceName,
|
|
|
|
MYDATA_SUMMARY_OPTIONS.tables
|
2022-09-20 02:59:15 +05:30
|
|
|
);
|
2022-12-23 15:24:14 +05:30
|
|
|
verifyResponseStatusCode('@waitForPageLoad', 200);
|
2022-09-19 18:43:39 +05:30
|
|
|
|
|
|
|
cy.get('[data-testid="Profiler & Data Quality"]')
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
};
|
|
|
|
|
|
|
|
describe('Data Quality and Profiler should work properly', () => {
|
2022-11-28 12:40:19 +05:30
|
|
|
beforeEach(() => {
|
|
|
|
cy.login();
|
2022-12-13 23:42:29 +05:30
|
|
|
});
|
2023-01-15 18:24:10 +05:30
|
|
|
|
2022-09-19 18:43:39 +05:30
|
|
|
it('Add and ingest mysql data', () => {
|
|
|
|
goToAddNewServicePage(SERVICE_TYPE.Database);
|
|
|
|
|
|
|
|
const addIngestionInput = () => {
|
|
|
|
cy.get('[data-testid="schema-filter-pattern-checkbox"]').check();
|
|
|
|
cy.get('[data-testid="filter-pattern-includes-schema"]')
|
2023-04-17 19:23:23 +05:30
|
|
|
.scrollIntoView()
|
2022-09-19 18:43:39 +05:30
|
|
|
.should('be.visible')
|
2022-09-21 22:25:33 +05:30
|
|
|
.type(Cypress.env('mysqlDatabaseSchema'));
|
2022-09-19 18:43:39 +05:30
|
|
|
};
|
|
|
|
|
|
|
|
testServiceCreationAndIngestion(
|
|
|
|
serviceType,
|
2022-09-21 22:25:33 +05:30
|
|
|
mySqlConnectionInput,
|
2022-09-19 18:43:39 +05:30
|
|
|
addIngestionInput,
|
|
|
|
serviceName
|
|
|
|
);
|
|
|
|
});
|
2022-12-13 23:42:29 +05:30
|
|
|
|
2022-11-17 11:03:59 +05:30
|
|
|
it('Add Profiler ingestion', () => {
|
2022-12-13 23:42:29 +05:30
|
|
|
interceptURL(
|
|
|
|
'POST',
|
|
|
|
'/api/v1/services/ingestionPipelines/deploy/*',
|
|
|
|
'deployIngestion'
|
|
|
|
);
|
2022-12-02 15:43:12 +05:30
|
|
|
|
2022-09-19 18:43:39 +05:30
|
|
|
goToProfilerTab();
|
|
|
|
|
|
|
|
cy.get('[data-testid="no-profiler-placeholder"]').should('be.visible');
|
|
|
|
|
|
|
|
cy.clickOnLogo();
|
|
|
|
|
2023-03-21 19:33:44 +05:30
|
|
|
cy.get('[data-testid="appbar-item-settings"]').should('be.visible').click();
|
|
|
|
cy.get('[data-menu-id*="databases"]').should('be.visible').click();
|
2022-09-19 18:43:39 +05:30
|
|
|
cy.intercept('/api/v1/services/ingestionPipelines?*').as('ingestionData');
|
2023-02-07 16:30:42 +01:00
|
|
|
interceptURL(
|
|
|
|
'GET',
|
|
|
|
'/api/v1/system/config/pipeline-service-client',
|
|
|
|
'airflow'
|
|
|
|
);
|
2022-09-19 18:43:39 +05:30
|
|
|
cy.get(`[data-testid="service-name-${serviceName}"]`)
|
|
|
|
.should('exist')
|
|
|
|
.click();
|
|
|
|
cy.get('[data-testid="tabs"]').should('exist');
|
|
|
|
cy.wait('@ingestionData');
|
2023-01-16 12:21:24 +05:30
|
|
|
verifyResponseStatusCode('@airflow', 200);
|
2022-09-19 18:43:39 +05:30
|
|
|
cy.get('[data-testid="Ingestions"]')
|
|
|
|
.scrollIntoView()
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
cy.get('[data-testid="ingestion-details-container"]').should('exist');
|
|
|
|
cy.get('[data-testid="add-new-ingestion-button"]')
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
2023-04-12 18:25:47 +05:30
|
|
|
cy.get('[data-menu-id*="profiler"')
|
2022-09-19 18:43:39 +05:30
|
|
|
.scrollIntoView()
|
|
|
|
.contains('Profiler Ingestion')
|
|
|
|
.click();
|
2022-12-20 14:55:11 +05:30
|
|
|
cy.get('[data-testid="slider-input"]')
|
2023-01-15 18:24:10 +05:30
|
|
|
.scrollIntoView()
|
|
|
|
.should('be.visible')
|
|
|
|
.and('not.be.disabled')
|
|
|
|
.type(10);
|
2022-09-19 18:43:39 +05:30
|
|
|
cy.get('[data-testid="next-button"]')
|
|
|
|
.scrollIntoView()
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
|
|
|
|
scheduleIngestion();
|
|
|
|
|
2022-12-13 23:42:29 +05:30
|
|
|
cy.wait('@deployIngestion').then(() => {
|
|
|
|
cy.get('[data-testid="view-service-button"]')
|
2022-12-02 15:43:12 +05:30
|
|
|
.scrollIntoView()
|
|
|
|
.should('be.visible')
|
2022-12-13 23:42:29 +05:30
|
|
|
.click();
|
2022-09-19 18:43:39 +05:30
|
|
|
|
2022-12-13 23:42:29 +05:30
|
|
|
handleIngestionRetry('database', true, 0, 'profiler');
|
|
|
|
});
|
2022-09-29 15:21:33 +05:30
|
|
|
});
|
2022-12-13 23:42:29 +05:30
|
|
|
|
2022-11-17 11:03:59 +05:30
|
|
|
it('Check if profiler is ingested properly or not', () => {
|
2022-09-19 18:43:39 +05:30
|
|
|
goToProfilerTab();
|
|
|
|
cy.get('[data-testid="no-profiler-placeholder"]').should('not.exist');
|
2022-10-08 00:07:24 +05:30
|
|
|
});
|
2022-09-19 18:43:39 +05:30
|
|
|
|
|
|
|
it('Add table test case with new test suite', () => {
|
2022-12-23 15:24:14 +05:30
|
|
|
const term = TEAM_ENTITY;
|
2022-09-19 18:43:39 +05:30
|
|
|
goToProfilerTab();
|
2023-01-15 18:24:10 +05:30
|
|
|
interceptURL(
|
|
|
|
'GET',
|
|
|
|
`api/v1/tables/name/${serviceName}.*.${term}?include=all`,
|
|
|
|
'addTableTestPage'
|
|
|
|
);
|
2022-09-19 18:43:39 +05:30
|
|
|
cy.get('[data-testid="profiler-add-table-test-btn"]')
|
|
|
|
.scrollIntoView()
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
2023-01-15 18:24:10 +05:30
|
|
|
verifyResponseStatusCode('@addTableTestPage', 200);
|
2022-09-19 18:43:39 +05:30
|
|
|
cy.get('[data-testid="create-new-test-suite"]')
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
|
|
|
|
// creating new test suite
|
|
|
|
cy.get('[data-testid="new-test-title"]')
|
|
|
|
.should('be.visible')
|
|
|
|
.contains('New Test Suite');
|
|
|
|
cy.get('[data-testid="test-suite-name"]')
|
|
|
|
.scrollIntoView()
|
|
|
|
.type(NEW_TEST_SUITE.name);
|
|
|
|
cy.get(descriptionBox).scrollIntoView().type(NEW_TEST_SUITE.description);
|
|
|
|
cy.get('[data-testid="next-button"]').scrollIntoView().click();
|
|
|
|
|
|
|
|
// creating new test case
|
|
|
|
cy.get('#tableTestForm_testTypeId').scrollIntoView().click();
|
|
|
|
cy.contains(NEW_TABLE_TEST_CASE.type).should('be.visible').click();
|
|
|
|
cy.get('#tableTestForm_params_columnName')
|
|
|
|
.should('be.visible')
|
|
|
|
.type(NEW_TABLE_TEST_CASE.field);
|
|
|
|
cy.get(descriptionBox)
|
|
|
|
.scrollIntoView()
|
|
|
|
.type(NEW_TABLE_TEST_CASE.description);
|
|
|
|
|
|
|
|
cy.get('[data-testid="submit-test"]')
|
|
|
|
.scrollIntoView()
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
|
2023-02-03 20:48:41 +05:30
|
|
|
cy.get('[data-testid="success-line"]')
|
|
|
|
.scrollIntoView()
|
|
|
|
.should('be.visible');
|
2022-09-19 18:43:39 +05:30
|
|
|
cy.get('[data-testid="add-ingestion-button"]').should('be.visible').click();
|
|
|
|
scheduleIngestion();
|
|
|
|
|
2023-02-03 20:48:41 +05:30
|
|
|
cy.get('[data-testid="success-line"]')
|
|
|
|
.scrollIntoView()
|
|
|
|
.should('be.visible');
|
2022-09-19 18:43:39 +05:30
|
|
|
|
|
|
|
// wait for ingestion to run
|
|
|
|
cy.clock();
|
|
|
|
cy.wait(10000);
|
2023-04-14 09:14:49 +02:00
|
|
|
interceptURL('GET', '/api/v1/dataQuality/testCases?fields=*', 'testCase');
|
2022-09-19 18:43:39 +05:30
|
|
|
cy.get('[data-testid="view-service-button"]')
|
|
|
|
.should('be.visible')
|
|
|
|
.click({ force: true });
|
|
|
|
|
2022-10-29 09:05:20 +05:30
|
|
|
verifyResponseStatusCode('@getEntityDetails', 200);
|
|
|
|
|
2022-09-20 02:59:15 +05:30
|
|
|
verifyResponseStatusCode('@testCase', 200);
|
2022-09-19 18:43:39 +05:30
|
|
|
cy.contains(`${TEAM_ENTITY}_${NEW_TABLE_TEST_CASE.type}`).should(
|
|
|
|
'be.visible'
|
|
|
|
);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('Edit Test Case should work properly', () => {
|
|
|
|
const testName = `${TEAM_ENTITY}_${NEW_TABLE_TEST_CASE.type}`;
|
|
|
|
goToProfilerTab();
|
|
|
|
|
2022-12-14 20:04:48 +05:30
|
|
|
cy.get('[data-testid="profiler-tab-left-panel"]')
|
2022-09-19 18:43:39 +05:30
|
|
|
.contains('Data Quality')
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
|
|
|
|
cy.get(`[data-testid="${testName}"]`).should('be.visible');
|
|
|
|
cy.get(`[data-testid="edit-${testName}"]`).should('be.visible').click();
|
|
|
|
cy.get('#tableTestForm_params_columnName')
|
|
|
|
.scrollIntoView()
|
|
|
|
.clear()
|
|
|
|
.wait(200)
|
|
|
|
.type('test');
|
2023-04-14 09:14:49 +02:00
|
|
|
interceptURL('PATCH', '/api/v1/dataQuality/testCases/*', 'updateTest');
|
2022-09-19 18:43:39 +05:30
|
|
|
cy.get('.ant-modal-footer').contains('Submit').click();
|
|
|
|
verifyResponseStatusCode('@updateTest', 200);
|
|
|
|
cy.get('.Toastify__toast-body')
|
2023-02-16 17:28:00 +05:30
|
|
|
.contains('Test case updated successfully.')
|
2022-09-19 18:43:39 +05:30
|
|
|
.should('be.visible')
|
|
|
|
.wait(200);
|
|
|
|
cy.get(`[data-testid="${testName}"]`).should('be.visible').click();
|
|
|
|
cy.contains('columnName: test').scrollIntoView().should('exist');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('Delete Test Case should work properly', () => {
|
|
|
|
const testName = `${TEAM_ENTITY}_${NEW_TABLE_TEST_CASE.type}`;
|
|
|
|
|
|
|
|
goToProfilerTab();
|
|
|
|
|
2022-12-14 20:04:48 +05:30
|
|
|
cy.get('[data-testid="profiler-tab-left-panel"]')
|
2022-09-19 18:43:39 +05:30
|
|
|
.contains('Data Quality')
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
|
|
|
|
cy.get(`[data-testid="${testName}"]`).should('be.visible');
|
|
|
|
cy.get(`[data-testid="delete-${testName}"]`).should('be.visible').click();
|
|
|
|
cy.get('[data-testid="hard-delete-option"]').should('be.visible').click();
|
|
|
|
cy.get('[data-testid="confirmation-text-input"]')
|
|
|
|
.should('be.visible')
|
|
|
|
.type(DELETE_TERM);
|
|
|
|
interceptURL(
|
|
|
|
'DELETE',
|
2023-04-14 09:14:49 +02:00
|
|
|
'/api/v1/dataQuality/testCases/*?hardDelete=true&recursive=false',
|
2022-09-19 18:43:39 +05:30
|
|
|
'deleteTest'
|
|
|
|
);
|
2023-04-14 09:14:49 +02:00
|
|
|
interceptURL('GET', '/api/v1/dataQuality/testCases?*', 'getTestCase');
|
2022-09-19 18:43:39 +05:30
|
|
|
cy.get('[data-testid="confirm-button"]')
|
|
|
|
.should('be.visible')
|
|
|
|
.should('not.be.disabled')
|
|
|
|
.click();
|
|
|
|
verifyResponseStatusCode('@deleteTest', 200);
|
|
|
|
verifyResponseStatusCode('@getTestCase', 200);
|
2022-12-13 23:42:29 +05:30
|
|
|
toastNotification('Test Case deleted successfully!');
|
|
|
|
cy.get('[class="ant-empty-description"]')
|
|
|
|
.invoke('text')
|
|
|
|
.should('eq', 'No data');
|
2022-09-19 18:43:39 +05:30
|
|
|
});
|
|
|
|
|
|
|
|
it('Add Column test case should work properly', () => {
|
|
|
|
goToProfilerTab();
|
2022-12-14 20:04:48 +05:30
|
|
|
cy.get('[data-testid="profiler-tab-left-panel"]')
|
2023-01-15 18:24:10 +05:30
|
|
|
.contains('Column Profile')
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
|
2022-09-19 18:43:39 +05:30
|
|
|
cy.get('[data-testid="add-test-id"]')
|
|
|
|
.scrollIntoView()
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
|
|
|
|
// selecting existing test suite
|
|
|
|
cy.get('#selectTestSuite_testSuiteId').should('exist').click();
|
|
|
|
cy.contains(NEW_TEST_SUITE.name).should('be.visible').click();
|
|
|
|
cy.get('[data-testid="next-button"]')
|
|
|
|
.scrollIntoView()
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
|
|
|
|
// creating new test case
|
|
|
|
cy.get('#tableTestForm_testTypeId').scrollIntoView().click();
|
|
|
|
cy.get(`[title="${NEW_COLUMN_TEST_CASE.type}"]`)
|
|
|
|
.scrollIntoView()
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
cy.get('#tableTestForm_params_minLength')
|
|
|
|
.scrollIntoView()
|
|
|
|
.should('be.visible')
|
|
|
|
.type(NEW_COLUMN_TEST_CASE.min);
|
|
|
|
cy.get('#tableTestForm_params_maxLength')
|
|
|
|
.scrollIntoView()
|
|
|
|
.should('be.visible')
|
|
|
|
.type(NEW_COLUMN_TEST_CASE.max);
|
|
|
|
cy.get(descriptionBox)
|
|
|
|
.scrollIntoView()
|
|
|
|
.type(NEW_COLUMN_TEST_CASE.description);
|
|
|
|
|
|
|
|
cy.get('[data-testid="submit-test"]')
|
|
|
|
.scrollIntoView()
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
|
|
|
|
cy.get('[data-testid="success-line"]')
|
2023-02-03 20:48:41 +05:30
|
|
|
.scrollIntoView()
|
2022-09-19 18:43:39 +05:30
|
|
|
.contains(
|
|
|
|
'has been created successfully. This will be picked up in the next run.'
|
|
|
|
)
|
|
|
|
.should('be.visible');
|
|
|
|
cy.get('[data-testid="view-service-button"]').scrollIntoView().click();
|
2023-01-15 18:24:10 +05:30
|
|
|
cy.get('.ant-table-row').should(
|
|
|
|
'contain',
|
|
|
|
'id_columnValueLengthsToBeBetween'
|
|
|
|
);
|
2023-02-03 16:30:50 +05:30
|
|
|
|
|
|
|
// Creating new test case and selecting Null team type
|
|
|
|
|
|
|
|
goToProfilerTab();
|
|
|
|
cy.get('[data-testid="profiler-tab-left-panel"]')
|
|
|
|
.contains('Column Profile')
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
|
|
|
|
cy.get('[data-testid="add-test-id"]')
|
|
|
|
.scrollIntoView()
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
|
|
|
|
// selecting existing test suite
|
|
|
|
cy.get('#selectTestSuite_testSuiteId').should('exist').click();
|
|
|
|
cy.contains(NEW_TEST_SUITE.name).should('be.visible').click();
|
|
|
|
cy.get('[data-testid="next-button"]')
|
|
|
|
.scrollIntoView()
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
|
|
|
|
cy.get('#tableTestForm_testTypeId').scrollIntoView().click();
|
|
|
|
cy.get(`[title="${NEW_COLUMN_TEST_CASE_WITH_NULL_TYPE.type}"]`)
|
|
|
|
.scrollIntoView()
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
cy.get(descriptionBox)
|
|
|
|
.scrollIntoView()
|
|
|
|
.type(NEW_COLUMN_TEST_CASE_WITH_NULL_TYPE.description);
|
|
|
|
|
|
|
|
cy.get('[data-testid="submit-test"]')
|
|
|
|
.scrollIntoView()
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
|
|
|
|
cy.get('[data-testid="success-line"]')
|
|
|
|
.contains(
|
|
|
|
'has been created successfully. This will be picked up in the next run.'
|
|
|
|
)
|
|
|
|
.should('be.visible');
|
|
|
|
cy.get('[data-testid="view-service-button"]').scrollIntoView().click();
|
|
|
|
cy.get('.ant-table-row').should('contain', 'id_columnValuesToBeNotNull');
|
2022-09-19 18:43:39 +05:30
|
|
|
});
|
|
|
|
|
|
|
|
it('Edit column test case should work properly', () => {
|
2023-04-14 09:14:49 +02:00
|
|
|
interceptURL('GET', '/api/v1/dataQuality/testCases?*', 'testCase');
|
2022-09-19 18:43:39 +05:30
|
|
|
goToProfilerTab();
|
|
|
|
verifyResponseStatusCode('@testCase', 200);
|
2022-12-14 20:04:48 +05:30
|
|
|
cy.get('[data-testid="profiler-tab-left-panel"]')
|
2023-01-15 18:24:10 +05:30
|
|
|
.contains('Column Profile')
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
2023-01-27 11:10:07 +05:30
|
|
|
cy.get('[data-testid="id-test-count"]')
|
|
|
|
.scrollIntoView()
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
2022-09-19 18:43:39 +05:30
|
|
|
cy.get(`[data-testid="${columnTestName}"]`).should('be.visible');
|
|
|
|
cy.get(`[data-testid="edit-${columnTestName}"]`)
|
2023-01-27 11:10:07 +05:30
|
|
|
.scrollIntoView()
|
2022-09-19 18:43:39 +05:30
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
cy.get('#tableTestForm_params_minLength')
|
|
|
|
.scrollIntoView()
|
|
|
|
.should('be.visible')
|
|
|
|
.clear()
|
|
|
|
.type(4);
|
2023-04-14 09:14:49 +02:00
|
|
|
interceptURL('PATCH', '/api/v1/dataQuality/testCases/*', 'updateTest');
|
2022-09-19 18:43:39 +05:30
|
|
|
cy.get('.ant-modal-footer').contains('Submit').click();
|
|
|
|
verifyResponseStatusCode('@updateTest', 200);
|
|
|
|
cy.get('.Toastify__toast-body')
|
2023-02-16 17:28:00 +05:30
|
|
|
.contains('Test case updated successfully.')
|
2022-09-19 18:43:39 +05:30
|
|
|
.should('be.visible')
|
|
|
|
.wait(200);
|
|
|
|
cy.get(`[data-testid="${columnTestName}"]`).should('be.visible').click();
|
|
|
|
cy.contains('minLength: 4').scrollIntoView().should('exist');
|
2023-02-03 16:30:50 +05:30
|
|
|
|
|
|
|
// Editing Non Team Type Test Case
|
|
|
|
cy.get(`[data-testid="${nonTeamTypeColumnTestName}"]`).should('be.visible');
|
|
|
|
cy.get(`[data-testid="edit-${nonTeamTypeColumnTestName}"]`)
|
|
|
|
.scrollIntoView()
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
cy.get('.ant-modal-footer').contains('Cancel').click();
|
2022-09-19 18:43:39 +05:30
|
|
|
});
|
|
|
|
|
|
|
|
it('Delete Column Test Case should work properly', () => {
|
2023-04-14 09:14:49 +02:00
|
|
|
interceptURL('GET', '/api/v1/dataQuality/testCases?*', 'testCase');
|
2022-09-19 18:43:39 +05:30
|
|
|
goToProfilerTab();
|
|
|
|
verifyResponseStatusCode('@testCase', 200);
|
2022-12-14 20:04:48 +05:30
|
|
|
cy.get('[data-testid="profiler-tab-left-panel"]')
|
2023-01-15 18:24:10 +05:30
|
|
|
.contains('Column Profile')
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
2023-01-27 11:10:07 +05:30
|
|
|
cy.get('[data-testid="id-test-count"]')
|
|
|
|
.scrollIntoView()
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
2022-09-19 18:43:39 +05:30
|
|
|
|
2023-02-03 16:30:50 +05:30
|
|
|
[columnTestName, nonTeamTypeColumnTestName].map((test) => {
|
|
|
|
cy.get(`[data-testid="${test}"]`).should('be.visible');
|
|
|
|
cy.get(`[data-testid="delete-${test}"]`)
|
|
|
|
.scrollIntoView()
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
cy.get('[data-testid="hard-delete-option"]').should('be.visible').click();
|
|
|
|
cy.get('[data-testid="confirmation-text-input"]')
|
|
|
|
.should('be.visible')
|
|
|
|
.type(DELETE_TERM);
|
|
|
|
interceptURL(
|
|
|
|
'DELETE',
|
2023-04-14 09:14:49 +02:00
|
|
|
'/api/v1/dataQuality/testCases/*?hardDelete=true&recursive=false',
|
2023-02-03 16:30:50 +05:30
|
|
|
'deleteTest'
|
|
|
|
);
|
2023-04-14 09:14:49 +02:00
|
|
|
interceptURL('GET', '/api/v1/dataQuality/testCases?*', 'getTestCase');
|
2023-02-03 16:30:50 +05:30
|
|
|
cy.get('[data-testid="confirm-button"]')
|
|
|
|
.should('be.visible')
|
|
|
|
.should('not.be.disabled')
|
|
|
|
.click();
|
|
|
|
verifyResponseStatusCode('@deleteTest', 200);
|
|
|
|
verifyResponseStatusCode('@getTestCase', 200);
|
|
|
|
toastNotification('Test Case deleted successfully!');
|
|
|
|
});
|
|
|
|
|
2022-12-13 23:42:29 +05:30
|
|
|
cy.get('[class="ant-empty-description"]')
|
|
|
|
.invoke('text')
|
|
|
|
.should('eq', 'No data');
|
2022-09-19 18:43:39 +05:30
|
|
|
});
|
|
|
|
|
2023-03-10 14:30:53 +05:30
|
|
|
it('Soft Delete Test suite should work properly', () => {
|
2022-12-13 23:42:29 +05:30
|
|
|
cy.get('[data-testid="appbar-item-data-quality"]')
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
2023-03-10 14:30:53 +05:30
|
|
|
|
|
|
|
cy.get(`[data-testid="test-suite-${NEW_TEST_SUITE.name}"]`)
|
2022-09-19 18:43:39 +05:30
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
2023-03-10 14:30:53 +05:30
|
|
|
|
|
|
|
cy.get('[data-testid="manage-button"]').should('be.visible').click();
|
|
|
|
|
|
|
|
cy.get('[data-testid="delete-button"]').should('be.visible').click();
|
|
|
|
|
|
|
|
cy.get('[data-testid="soft-delete-option"]')
|
|
|
|
.should('contain', NEW_TEST_SUITE.name)
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
|
|
|
|
cy.get('[data-testid="confirm-button"]')
|
|
|
|
.should('exist')
|
|
|
|
.should('be.disabled');
|
|
|
|
|
2022-09-19 18:43:39 +05:30
|
|
|
cy.get('[data-testid="confirmation-text-input"]')
|
|
|
|
.should('be.visible')
|
|
|
|
.type(DELETE_TERM);
|
|
|
|
interceptURL(
|
|
|
|
'DELETE',
|
2023-04-14 09:14:49 +02:00
|
|
|
'/api/v1/dataQuality/testSuites/*?hardDelete=false&recursive=true',
|
2022-09-19 18:43:39 +05:30
|
|
|
'deleteTestSuite'
|
|
|
|
);
|
|
|
|
cy.get('[data-testid="confirm-button"]')
|
|
|
|
.should('be.visible')
|
|
|
|
.should('not.be.disabled')
|
|
|
|
.click();
|
|
|
|
verifyResponseStatusCode('@deleteTestSuite', 200);
|
2023-03-10 14:30:53 +05:30
|
|
|
toastNotification('Test Suite deleted successfully!');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('Restore Test suite should work properly', () => {
|
|
|
|
cy.get('[data-testid="appbar-item-data-quality"]')
|
2022-09-19 18:43:39 +05:30
|
|
|
.should('be.visible')
|
2023-03-10 14:30:53 +05:30
|
|
|
.click();
|
|
|
|
|
|
|
|
cy.get('[data-testid="switch-deleted"]').should('exist').click();
|
|
|
|
|
|
|
|
cy.get(`[data-testid="test-suite-${NEW_TEST_SUITE.name}"]`)
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
|
|
|
|
cy.get('[data-testid="deleted-badge"]').should('be.visible');
|
|
|
|
|
|
|
|
cy.get('[data-testid="manage-button"]').should('be.visible').click();
|
|
|
|
|
|
|
|
cy.get('[data-testid="restore-button"]').should('be.visible').click();
|
|
|
|
|
|
|
|
cy.get('[data-testid="restore-modal-body"]')
|
|
|
|
.contains(`Are you sure you want to restore ${NEW_TEST_SUITE.name}`)
|
|
|
|
.should('be.visible');
|
|
|
|
|
2023-04-14 09:14:49 +02:00
|
|
|
interceptURL(
|
|
|
|
'PUT',
|
|
|
|
'/api/v1/dataQuality/testSuites/restore',
|
|
|
|
'restoreTestSuite'
|
|
|
|
);
|
2023-03-10 14:30:53 +05:30
|
|
|
|
|
|
|
cy.get('.ant-modal-footer').contains('Restore').click();
|
|
|
|
|
|
|
|
verifyResponseStatusCode('@restoreTestSuite', 200);
|
|
|
|
toastNotification('Test Suite restored successfully');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('Hard Delete Test suite should work properly', () => {
|
|
|
|
cy.get('[data-testid="appbar-item-data-quality"]')
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
cy.get(`[data-testid="test-suite-${NEW_TEST_SUITE.name}"]`)
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
|
|
|
|
cy.get('[data-testid="manage-button"]').should('be.visible').click();
|
|
|
|
|
|
|
|
cy.get('[data-testid="delete-button"]').should('be.visible').click();
|
|
|
|
|
|
|
|
// Click on Permanent/Hard delete option
|
|
|
|
cy.get('[data-testid="hard-delete-option"]')
|
|
|
|
.should('contain', NEW_TEST_SUITE.name)
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
|
|
|
|
cy.get('[data-testid="confirm-button"]')
|
|
|
|
.should('exist')
|
|
|
|
.should('be.disabled');
|
|
|
|
|
|
|
|
cy.get('[data-testid="confirmation-text-input"]')
|
|
|
|
.should('be.visible')
|
|
|
|
.type(DELETE_TERM);
|
|
|
|
interceptURL(
|
|
|
|
'DELETE',
|
2023-04-14 09:14:49 +02:00
|
|
|
'/api/v1/dataQuality/testSuites/*?hardDelete=true&recursive=true',
|
2023-03-10 14:30:53 +05:30
|
|
|
'deleteTestSuite'
|
|
|
|
);
|
|
|
|
cy.get('[data-testid="confirm-button"]')
|
|
|
|
.should('be.visible')
|
|
|
|
.should('not.be.disabled')
|
|
|
|
.click();
|
|
|
|
verifyResponseStatusCode('@deleteTestSuite', 200);
|
|
|
|
|
|
|
|
toastNotification('Test Suite deleted successfully!');
|
2022-09-19 18:43:39 +05:30
|
|
|
});
|
2022-09-21 22:25:33 +05:30
|
|
|
|
|
|
|
it('delete created service', () => {
|
2022-12-13 23:42:29 +05:30
|
|
|
deleteCreatedService(
|
|
|
|
SERVICE_TYPE.Database,
|
|
|
|
serviceName,
|
|
|
|
API_SERVICE.databaseServices
|
|
|
|
);
|
2022-09-21 22:25:33 +05:30
|
|
|
});
|
2022-10-13 15:27:06 +05:30
|
|
|
|
|
|
|
it('Profiler matrix and test case graph should visible', () => {
|
|
|
|
const { term, entity, serviceName, testCaseName } =
|
|
|
|
DATA_QUALITY_SAMPLE_DATA_TABLE;
|
|
|
|
visitEntityDetailsPage(term, serviceName, entity);
|
2023-04-14 11:28:11 +05:30
|
|
|
cy.get('[data-testid="entity-header-name"]')
|
|
|
|
.should('be.visible')
|
|
|
|
.contains(term);
|
2022-10-13 15:27:06 +05:30
|
|
|
cy.get('[data-testid="Profiler & Data Quality"]')
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
cy.get('[data-testid="Profiler & Data Quality"]').should(
|
|
|
|
'have.class',
|
|
|
|
'active'
|
|
|
|
);
|
|
|
|
interceptURL('GET', '/api/v1/tables/*/columnProfile?*', 'getProfilerInfo');
|
|
|
|
|
2022-12-14 20:04:48 +05:30
|
|
|
cy.get('[data-testid="profiler-tab-left-panel"]')
|
2023-01-15 18:24:10 +05:30
|
|
|
.contains('Column Profile')
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
2022-10-13 15:27:06 +05:30
|
|
|
cy.get('[data-row-key="shop_id"] > :nth-child(1) > a')
|
|
|
|
.scrollIntoView()
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
verifyResponseStatusCode('@getProfilerInfo', 200);
|
|
|
|
|
|
|
|
cy.get('#count_graph').scrollIntoView().should('be.visible');
|
|
|
|
cy.get('#proportion_graph').scrollIntoView().should('be.visible');
|
|
|
|
cy.get('#math_graph').scrollIntoView().should('be.visible');
|
|
|
|
cy.get('#sum_graph').scrollIntoView().should('be.visible');
|
|
|
|
|
2023-04-14 09:14:49 +02:00
|
|
|
interceptURL('GET', '/api/v1/dataQuality/testCases?*', 'getTestCaseInfo');
|
2023-04-03 13:03:48 -07:00
|
|
|
interceptURL(
|
|
|
|
'GET',
|
2023-04-14 09:14:49 +02:00
|
|
|
'/api/v1/dataQuality/testCases/*/testCaseResult?*',
|
2023-04-03 13:03:48 -07:00
|
|
|
'getTestResult'
|
|
|
|
);
|
2022-10-13 15:27:06 +05:30
|
|
|
cy.get('[data-testid="profiler-switch"]')
|
|
|
|
.contains('Data Quality')
|
|
|
|
.scrollIntoView()
|
|
|
|
.click();
|
|
|
|
verifyResponseStatusCode('@getTestCaseInfo', 200);
|
|
|
|
cy.get(`[data-testid="${testCaseName}"]`).should('be.visible').click();
|
|
|
|
verifyResponseStatusCode('@getTestResult', 200);
|
|
|
|
cy.get(`[id="${testCaseName}_graph"]`).should('be.visible');
|
|
|
|
});
|
2022-12-13 23:42:29 +05:30
|
|
|
|
|
|
|
it('SQL query should be visible while editing the test case', () => {
|
|
|
|
const { term, entity, serviceName, sqlTestCase, testSuiteName, sqlQuery } =
|
|
|
|
DATA_QUALITY_SAMPLE_DATA_TABLE;
|
2022-12-23 15:24:14 +05:30
|
|
|
interceptURL(
|
|
|
|
'GET',
|
|
|
|
`api/v1/tables/name/${serviceName}.*.${term}?fields=*&include=all`,
|
|
|
|
'waitForPageLoad'
|
|
|
|
);
|
2022-12-13 23:42:29 +05:30
|
|
|
visitEntityDetailsPage(term, serviceName, entity);
|
2022-12-23 15:24:14 +05:30
|
|
|
verifyResponseStatusCode('@waitForPageLoad', 200);
|
2023-04-14 11:28:11 +05:30
|
|
|
cy.get('[data-testid="entity-header-name"]')
|
|
|
|
.should('be.visible')
|
|
|
|
.contains(term);
|
2022-12-13 23:42:29 +05:30
|
|
|
cy.get('[data-testid="Profiler & Data Quality"]')
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
cy.get('[data-testid="Profiler & Data Quality"]').should(
|
|
|
|
'have.class',
|
|
|
|
'active'
|
|
|
|
);
|
2023-01-15 18:24:10 +05:30
|
|
|
interceptURL(
|
|
|
|
'GET',
|
|
|
|
`api/v1/tables/name/${serviceName}.*.${term}?include=all`,
|
|
|
|
'addTableTestPage'
|
|
|
|
);
|
2022-12-13 23:42:29 +05:30
|
|
|
cy.get('[data-testid="profiler-add-table-test-btn"]')
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
2023-01-15 18:24:10 +05:30
|
|
|
verifyResponseStatusCode('@addTableTestPage', 200);
|
2022-12-13 23:42:29 +05:30
|
|
|
|
|
|
|
// selecting existing test suite
|
|
|
|
cy.get('#selectTestSuite_testSuiteId').should('exist').click();
|
|
|
|
cy.contains(testSuiteName).should('be.visible').click();
|
|
|
|
cy.get('[data-testid="next-button"]')
|
|
|
|
.scrollIntoView()
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
|
|
|
|
// creating new test case
|
|
|
|
cy.get('#tableTestForm_testTypeId').scrollIntoView().click();
|
|
|
|
cy.contains(sqlTestCase).should('be.visible').click();
|
|
|
|
cy.get('.CodeMirror-scroll')
|
|
|
|
.scrollIntoView()
|
|
|
|
.should('be.visible')
|
|
|
|
.type(sqlQuery);
|
|
|
|
cy.get(descriptionBox).scrollIntoView().type(sqlTestCase);
|
|
|
|
|
|
|
|
cy.get('[data-testid="submit-test"]')
|
|
|
|
.scrollIntoView()
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
|
2023-04-14 09:14:49 +02:00
|
|
|
interceptURL('GET', '/api/v1/dataQuality/testCases?fields=*', 'testCase');
|
|
|
|
interceptURL(
|
|
|
|
'GET',
|
|
|
|
'/api/v1/dataQuality/testDefinitions/*',
|
|
|
|
'testCaseDefinition'
|
|
|
|
);
|
2022-12-13 23:42:29 +05:30
|
|
|
|
2023-02-03 20:48:41 +05:30
|
|
|
cy.get('[data-testid="success-line"]')
|
|
|
|
.scrollIntoView()
|
|
|
|
.should('be.visible');
|
2022-12-13 23:42:29 +05:30
|
|
|
cy.get('[data-testid="view-service-button"]').should('be.visible').click();
|
|
|
|
|
|
|
|
verifyResponseStatusCode('@testCase', 200);
|
|
|
|
cy.get('[data-testid="dim_address_tableCustomSQLQuery"]').should(
|
|
|
|
'be.visible'
|
|
|
|
);
|
|
|
|
cy.get('[data-testid="edit-dim_address_tableCustomSQLQuery"]')
|
|
|
|
.should('be.visible')
|
|
|
|
.click();
|
|
|
|
|
|
|
|
verifyResponseStatusCode('@testCaseDefinition', 200);
|
|
|
|
cy.get('#tableTestForm').should('be.visible');
|
|
|
|
cy.get('.CodeMirror-scroll')
|
|
|
|
.scrollIntoView()
|
|
|
|
.should('be.visible')
|
|
|
|
.contains(sqlQuery);
|
|
|
|
});
|
2022-09-19 18:43:39 +05:30
|
|
|
});
|