2022-05-11 23:35:13 -07:00
|
|
|
/*
|
2022-12-27 12:37:58 +05:30
|
|
|
* Copyright 2022 Collate.
|
2022-05-11 23:35:13 -07:00
|
|
|
* 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
|
|
|
import {
|
|
|
|
|
deleteCreatedService,
|
|
|
|
|
goToAddNewServicePage,
|
|
|
|
|
mySqlConnectionInput,
|
|
|
|
|
testServiceCreationAndIngestion,
|
|
|
|
|
updateDescriptionForIngestedTables,
|
|
|
|
|
uuid,
|
|
|
|
|
} from '../../common/common';
|
|
|
|
|
import {
|
|
|
|
|
API_SERVICE,
|
|
|
|
|
SERVICE_TYPE,
|
|
|
|
|
TEAM_ENTITY,
|
|
|
|
|
} from '../../constants/constants';
|
2022-07-25 10:54:47 +05:30
|
|
|
|
|
|
|
|
const serviceType = 'Mysql';
|
2023-08-07 18:43:42 +05:30
|
|
|
const serviceName = `${serviceType}.ct%test-${uuid()}`;
|
2022-09-28 21:58:20 +05:30
|
|
|
const tableName = TEAM_ENTITY;
|
2022-09-27 18:55:58 +05:30
|
|
|
const description = `This is ${tableName} description`;
|
2022-05-11 23:35:13 -07:00
|
|
|
|
|
|
|
|
describe('MySQL Ingestion', () => {
|
2022-09-23 16:05:54 +05:30
|
|
|
beforeEach(() => {
|
2022-11-28 12:40:19 +05:30
|
|
|
cy.login();
|
2022-09-23 16:05:54 +05:30
|
|
|
});
|
2023-01-15 18:24:10 +05:30
|
|
|
|
2022-05-11 23:35:13 -07:00
|
|
|
it('add and ingest data', () => {
|
2022-08-11 10:57:39 +05:30
|
|
|
goToAddNewServicePage(SERVICE_TYPE.Database);
|
2022-05-11 23:35:13 -07:00
|
|
|
|
|
|
|
|
const addIngestionInput = () => {
|
2023-08-20 12:01:06 +05:30
|
|
|
cy.get('#root\\/schemaFilterPattern\\/includes')
|
2023-04-17 19:23:23 +05:30
|
|
|
.scrollIntoView()
|
2023-06-02 00:55:59 +05:30
|
|
|
.type(`${Cypress.env('mysqlDatabaseSchema')}{enter}`);
|
2022-05-11 23:35:13 -07:00
|
|
|
};
|
|
|
|
|
|
2023-09-25 14:34:48 +05:30
|
|
|
const viewIngestionInput = () => {
|
|
|
|
|
cy.get('.ant-select-selection-item-content')
|
|
|
|
|
.scrollIntoView()
|
|
|
|
|
.contains(`${Cypress.env('mysqlDatabaseSchema')}`);
|
|
|
|
|
};
|
|
|
|
|
|
2023-05-02 08:28:04 +05:30
|
|
|
testServiceCreationAndIngestion({
|
2022-07-25 10:54:47 +05:30
|
|
|
serviceType,
|
2023-05-02 08:28:04 +05:30
|
|
|
connectionInput: mySqlConnectionInput,
|
2022-07-25 10:54:47 +05:30
|
|
|
addIngestionInput,
|
2023-05-02 08:28:04 +05:30
|
|
|
serviceName,
|
|
|
|
|
serviceCategory: SERVICE_TYPE.Database,
|
2023-09-25 14:34:48 +05:30
|
|
|
viewIngestionInput,
|
2023-05-02 08:28:04 +05:30
|
|
|
});
|
2022-05-11 23:35:13 -07:00
|
|
|
});
|
2022-07-25 10:54:47 +05:30
|
|
|
|
2022-11-03 10:10:32 +05:30
|
|
|
it('Update table description and verify description after re-run', () => {
|
2022-09-27 18:55:58 +05:30
|
|
|
updateDescriptionForIngestedTables(
|
|
|
|
|
serviceName,
|
|
|
|
|
tableName,
|
|
|
|
|
description,
|
|
|
|
|
SERVICE_TYPE.Database,
|
|
|
|
|
'tables'
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
|
2022-08-06 12:38:27 +05:30
|
|
|
it('delete created service', () => {
|
2023-01-15 18:24:10 +05:30
|
|
|
deleteCreatedService(
|
|
|
|
|
SERVICE_TYPE.Database,
|
|
|
|
|
serviceName,
|
|
|
|
|
API_SERVICE.databaseServices
|
|
|
|
|
);
|
2022-08-06 12:38:27 +05:30
|
|
|
});
|
2022-05-11 23:35:13 -07:00
|
|
|
});
|