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 cfc7709790e..1798315157e 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/common/common.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/common/common.js @@ -334,7 +334,6 @@ export const editOwnerforCreatedService = (service_type, service_Name) => { export const goToAddNewServicePage = (service_type) => { cy.get('[data-testid="tables"]').should('be.visible'); - //Click on settings page cy.get('[data-testid="appbar-item-settings"]').should('be.visible').click(); @@ -862,3 +861,122 @@ export const addTeam = (TEAM_DETAILS) => { verifyResponseStatusCode('@saveTeam', 201); verifyResponseStatusCode('@createTeam', 200); }; + +export const retryIngestionRun = () => { + const retryTimes = 10; + let retryCount = 0; + + const testIngestionsTab = () => { + cy.get('[data-testid="Ingestions"]').should('be.visible'); + cy.get('[data-testid="Ingestions"] >> [data-testid="filter-count"]').should( + 'have.text', + '1' + ); + if (retryCount === 0) { + cy.wait(1000); + cy.get('[data-testid="Ingestions"]').should('be.visible'); + } + }; + + const checkSuccessState = () => { + testIngestionsTab(); + retryCount++; + // the latest run should be success + cy.get('[aria-describedby*="tippy-tooltip"] > .tw-h-5').then( + ($ingestionStatus) => { + if ( + ($ingestionStatus.text() === 'Running' || + $ingestionStatus.text() === 'Queued') && + retryCount <= retryTimes + ) { + // retry after waiting for 20 seconds + cy.wait(20000); + cy.reload(); + checkSuccessState(); + } else { + cy.get('[aria-describedby*="tippy-tooltip"] > .tw-h-5').should( + 'have.text', + 'Success' + ); + } + } + ); + }; + + checkSuccessState(); +}; + +export const updateDescriptionForIngestedTables = ( + serviceName, + tableName, + description, + type, + entity +) => { + //Navigate to ingested table + //Search entity + searchEntity(tableName); + cy.get(`[data-testid="${entity}-tab"]`).should('be.visible').click(); + + cy.get(`[data-testid="${entity}-tab"]`) + .should('be.visible') + .should('have.class', 'active'); + interceptURL('GET', `/api/v1/permissions/*/*`, 'getEntityDetails'); + cy.get('[data-testid="table-link"]').first().click(); + verifyResponseStatusCode('@getEntityDetails', 200); + + //update description + cy.get('[data-testid="edit-description"]') + .should('be.visible') + .click({ force: true }); + cy.get(descriptionBox).should('be.visible').clear().type(description); + interceptURL('PATCH', '/api/v1/*/*', 'updateEntity'); + cy.get('[data-testid="save"]').click(); + verifyResponseStatusCode('@updateEntity', 200); + + //re-run ingestion flow + + cy.get('[data-testid="appbar-item-settings"]').should('be.visible').click(); + + // Services page + cy.get('.ant-menu-title-content').contains(type).should('be.visible').click(); + + interceptURL( + 'GET', + `/api/v1/services/*/name/${serviceName}*`, + 'getSelectedService' + ); + + //click on created service + cy.get(`[data-testid="service-name-${serviceName}"]`) + .should('exist') + .should('be.visible') + .click(); + + verifyResponseStatusCode('@getSelectedService', 200); + + cy.get('[data-testid="Ingestions"]').should('be.visible').click(); + interceptURL( + 'POST', + '/api/v1/services/ingestionPipelines/trigger/*', + 'checkRun' + ); + cy.get('[data-testid="run"]').should('be.visible').click(); + verifyResponseStatusCode('@checkRun', 200); + //Wait for success + retryIngestionRun(); + + //Navigate to table name + searchEntity(tableName); + cy.get(`[data-testid="${entity}-tab"]`).should('be.visible').click(); + + cy.get(`[data-testid="${entity}-tab"]`) + .should('be.visible') + .should('have.class', 'active'); + cy.get('[data-testid="table-link"]').first().click(); + verifyResponseStatusCode('@getEntityDetails', 200); + cy.get('[data-testid="description"] > [data-testid="viewer-container"] ') + .first() + .invoke('text') + .should('eq', description); +}; diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/bigquery.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/bigquery.spec.js index 9952c83c40f..35f7601d293 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/bigquery.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/bigquery.spec.js @@ -11,11 +11,13 @@ * limitations under the License. */ -import { deleteCreatedService, editOwnerforCreatedService, goToAddNewServicePage, login, testServiceCreationAndIngestion, uuid } from '../../common/common'; +import { deleteCreatedService, editOwnerforCreatedService, goToAddNewServicePage, login, testServiceCreationAndIngestion, updateDescriptionForIngestedTables, uuid } from '../../common/common'; import { LOGIN, SERVICE_TYPE } from '../../constants/constants'; const serviceType = 'BigQuery'; const serviceName = `${serviceType}-ct-test-${uuid()}`; +const tableName = 'augcustomers'; +const description = `This is ${serviceName} description`; describe('BigQuery Ingestion', () => { beforeEach(() => { @@ -73,6 +75,16 @@ describe('BigQuery Ingestion', () => { ); }); + it('Update table description and verify', () => { + updateDescriptionForIngestedTables( + serviceName, + tableName, + description, + SERVICE_TYPE.Database, + 'tables' + ); + }); + it('Edit and validate owner', () => { editOwnerforCreatedService(SERVICE_TYPE.Database, serviceName); }); diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/glue.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/glue.spec.js index 7e5e048833d..53cc8f63a4a 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/glue.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/glue.spec.js @@ -11,17 +11,20 @@ * limitations under the License. */ -import { deleteCreatedService, editOwnerforCreatedService, goToAddNewServicePage, login, testServiceCreationAndIngestion, uuid } from '../../common/common'; +import { deleteCreatedService, editOwnerforCreatedService, goToAddNewServicePage, login, testServiceCreationAndIngestion, updateDescriptionForIngestedTables, uuid } from '../../common/common'; import { LOGIN, SERVICE_TYPE } from '../../constants/constants'; const serviceType = 'Glue'; const serviceName = `${serviceType}-ct-test-${uuid()}`; +const tableName = 'cloudfront_logs2'; +const description = `This is ${serviceName} description`; describe('Glue Ingestion', () => { beforeEach(() => { login(LOGIN.username, LOGIN.password); cy.goToHomePage(); }); + it('add and ingest data', () => { goToAddNewServicePage(SERVICE_TYPE.Database); const connectionInput = () => { @@ -56,6 +59,16 @@ describe('Glue Ingestion', () => { ); }); + it('Update table description and verify', () => { + updateDescriptionForIngestedTables( + serviceName, + tableName, + description, + SERVICE_TYPE.Database, + 'tables' + ); + }); + it('Edit and validate owner', () => { editOwnerforCreatedService(SERVICE_TYPE.Database, serviceName); }); diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/kafka.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/kafka.spec.js index 67cf8786750..fd704b83386 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/kafka.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/kafka.spec.js @@ -11,11 +11,13 @@ * limitations under the License. */ -import { deleteCreatedService, editOwnerforCreatedService, goToAddNewServicePage, login, testServiceCreationAndIngestion, uuid } from '../../common/common'; +import { deleteCreatedService, editOwnerforCreatedService, goToAddNewServicePage, login, testServiceCreationAndIngestion, updateDescriptionForIngestedTables, uuid } from '../../common/common'; import { LOGIN, SERVICE_TYPE } from '../../constants/constants'; const serviceType = 'Kafka'; const serviceName = `${serviceType}-ct-test-${uuid()}`; +const tableName = '__consumer_offsets'; +const description = `This is ${serviceName} description`; describe('Kafka Ingestion', () => { beforeEach(() => { @@ -55,6 +57,16 @@ describe('Kafka Ingestion', () => { ); }); + it('Update table description and verify', () => { + updateDescriptionForIngestedTables( + serviceName, + tableName, + description, + SERVICE_TYPE.Messaging, + 'topics' + ); + }); + it('Edit and validate owner', () => { editOwnerforCreatedService(SERVICE_TYPE.Messaging, serviceName); }); diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/metabase.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/metabase.spec.js index a4c1127c9b7..872d9ab30e5 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/metabase.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/metabase.spec.js @@ -11,11 +11,13 @@ * limitations under the License. */ -import { deleteCreatedService, editOwnerforCreatedService, goToAddNewServicePage, login, testServiceCreationAndIngestion, uuid } from '../../common/common'; +import { deleteCreatedService, editOwnerforCreatedService, goToAddNewServicePage, login, testServiceCreationAndIngestion, updateDescriptionForIngestedTables, uuid } from '../../common/common'; import { LOGIN, SERVICE_TYPE } from '../../constants/constants'; const serviceType = 'Metabase'; const serviceName = `${serviceType}-ct-test-${uuid()}`; +const tableName = 'Customers Dashboard'; +const description = `This is ${serviceName} description`; describe('Metabase Ingestion', () => { beforeEach(() => { @@ -51,6 +53,16 @@ describe('Metabase Ingestion', () => { ); }); + it('Update table description and verify', () => { + updateDescriptionForIngestedTables( + serviceName, + tableName, + description, + SERVICE_TYPE.Dashboard, + 'dashboards' + ); + }); + it('Edit and validate owner', () => { editOwnerforCreatedService(SERVICE_TYPE.Dashboard, serviceName); }); diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/mysql.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/mysql.spec.js index 38f845377e7..470479ac6f2 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/mysql.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/mysql.spec.js @@ -11,11 +11,13 @@ * limitations under the License. */ -import { deleteCreatedService, editOwnerforCreatedService, goToAddNewServicePage, login, mySqlConnectionInput, testServiceCreationAndIngestion, uuid } from '../../common/common'; +import { deleteCreatedService, editOwnerforCreatedService, goToAddNewServicePage, login, mySqlConnectionInput, testServiceCreationAndIngestion, updateDescriptionForIngestedTables, uuid } from '../../common/common'; import { LOGIN, SERVICE_TYPE } from '../../constants/constants'; const serviceType = 'Mysql'; const serviceName = `${serviceType}-ct-test-${uuid()}`; +const tableName = 'DATABASE_CHANGE_LOG'; +const description = `This is ${tableName} description`; describe('MySQL Ingestion', () => { beforeEach(() => { @@ -40,6 +42,16 @@ describe('MySQL Ingestion', () => { ); }); + it('Update table description and verify', () => { + updateDescriptionForIngestedTables( + serviceName, + tableName, + description, + SERVICE_TYPE.Database, + 'tables' + ); + }); + it('Edit and validate owner', () => { editOwnerforCreatedService(SERVICE_TYPE.Database, serviceName); }); diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/redshift.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/redshift.spec.js index 68ac62db741..215476bc8e6 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/redshift.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/redshift.spec.js @@ -11,11 +11,13 @@ * limitations under the License. */ -import { deleteCreatedService, editOwnerforCreatedService, goToAddNewServicePage, login, testServiceCreationAndIngestion, uuid } from '../../common/common'; +import { deleteCreatedService, editOwnerforCreatedService, goToAddNewServicePage, login, testServiceCreationAndIngestion, updateDescriptionForIngestedTables, uuid } from '../../common/common'; import { LOGIN, SERVICE_TYPE } from '../../constants/constants'; const serviceType = 'Redshift'; const serviceName = `${serviceType}-ct-test-${uuid()}`; +const tableName = 'boolean_test'; +const description = `This is ${serviceName} description`; describe('RedShift Ingestion', () => { beforeEach(() => { @@ -53,6 +55,16 @@ describe('RedShift Ingestion', () => { ); }); + it('Update table description and verify', () => { + updateDescriptionForIngestedTables( + serviceName, + tableName, + description, + SERVICE_TYPE.Database, + 'tables' + ); + }); + it('Edit and validate owner', () => { editOwnerforCreatedService(SERVICE_TYPE.Database, serviceName); }); diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/snowflake.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/snowflake.spec.js index 0acc318e7e0..e0b04e08f28 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/snowflake.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/snowflake.spec.js @@ -11,11 +11,13 @@ * limitations under the License. */ -import { deleteCreatedService, editOwnerforCreatedService, goToAddNewServicePage, login, testServiceCreationAndIngestion, uuid } from '../../common/common'; +import { deleteCreatedService, editOwnerforCreatedService, goToAddNewServicePage, login, testServiceCreationAndIngestion, updateDescriptionForIngestedTables, uuid } from '../../common/common'; import { LOGIN, SERVICE_TYPE } from '../../constants/constants'; const serviceType = 'Snowflake'; const serviceName = `${serviceType}-ct-test-${uuid()}`; +const tableName = 'TEST_TABLE'; +const description = `This is ${serviceName} description`; describe('Snowflake Ingestion', () => { beforeEach(() => { @@ -47,6 +49,16 @@ describe('Snowflake Ingestion', () => { ); }); + it('Update table description and verify', () => { + updateDescriptionForIngestedTables( + serviceName, + tableName, + description, + SERVICE_TYPE.Database, + 'tables' + ); + }); + it('Edit and validate owner', () => { editOwnerforCreatedService(SERVICE_TYPE.Database, serviceName); }); diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/superset.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/superset.spec.js index 6e6741e19b3..ecdf58ede69 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/superset.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/superset.spec.js @@ -11,11 +11,13 @@ * limitations under the License. */ -import { deleteCreatedService, editOwnerforCreatedService, goToAddNewServicePage, login, testServiceCreationAndIngestion, uuid } from '../../common/common'; +import { deleteCreatedService, editOwnerforCreatedService, goToAddNewServicePage, login, testServiceCreationAndIngestion, updateDescriptionForIngestedTables, uuid } from '../../common/common'; import { LOGIN, SERVICE_TYPE } from '../../constants/constants'; const serviceType = 'Superset'; const serviceName = `${serviceType}-ct-test-${uuid()}`; +const tableName = 'NEW DASHBOARD'; +const description = `This is ${serviceName} description`; describe('Superset Ingestion', () => { beforeEach(() => { @@ -53,6 +55,16 @@ describe('Superset Ingestion', () => { ); }); + it('Update table description and verify', () => { + updateDescriptionForIngestedTables( + serviceName, + tableName, + description, + SERVICE_TYPE.Dashboard, + 'dashboards' + ); + }); + it('Edit and validate owner', () => { editOwnerforCreatedService(SERVICE_TYPE.Dashboard, serviceName); });