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 36abde256d2..33efbcf75f7 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/common/common.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/common/common.js @@ -27,6 +27,14 @@ const TEAM_TYPES = ['BusinessUnit', 'Department', 'Division', 'Group']; const isDatabaseService = (type) => type === 'database'; +export const checkServiceFieldSectionHighlighting = (field) => { + cy.get(`[data-id="${field}"]`).should( + 'have.attr', + 'data-highlighted', + 'true' + ); +}; + const checkTeamTypeOptions = () => { for (const teamType of TEAM_TYPES) { cy.get(`.ant-select-dropdown [title="${teamType}"]`) @@ -41,8 +49,21 @@ export const interceptURL = (method, url, alias, callback) => { }; // waiting for response and validating the response status code -export const verifyResponseStatusCode = (alias, responseCode, option) => { - cy.wait(alias, option).its('response.statusCode').should('eq', responseCode); +export const verifyResponseStatusCode = ( + alias, + responseCode, + option, + hasMultipleResponseCode = false +) => { + if (hasMultipleResponseCode) { + cy.wait(alias, option) + .its('response.statusCode') + .should('be.oneOf', responseCode); + } else { + cy.wait(alias, option) + .its('response.statusCode') + .should('eq', responseCode); + } }; // waiting for multiple response and validating the response status code @@ -180,14 +201,15 @@ export const scheduleIngestion = () => { // Storing the created service name and the type of service for later use -export const testServiceCreationAndIngestion = ( +export const testServiceCreationAndIngestion = ({ serviceType, connectionInput, addIngestionInput, serviceName, type = 'database', - testIngestionButton = true -) => { + testIngestionButton = true, + serviceCategory, +}) => { // Storing the created service name and the type of service // Select Service in step 1 cy.get(`[data-testid="${serviceType}"]`).should('exist').click(); @@ -201,6 +223,12 @@ export const testServiceCreationAndIngestion = ( 'api/v1/services/ingestionPipelines/*', 'ingestionPipelineStatus' ); + // intercept the service requirement md file fetch request + interceptURL( + 'GET', + `en-US/${serviceCategory}/${serviceType}.md`, + 'getServiceRequirements' + ); cy.get('[data-testid="next-button"]').should('exist').click(); verifyResponseStatusCode('@ingestionPipelineStatus', 200); verifyResponseStatusCode('@ipApi', 204); @@ -214,6 +242,10 @@ export const testServiceCreationAndIngestion = ( }); cy.contains('Connection Details').scrollIntoView().should('be.visible'); + // Requirement panel should be visible and fetch the requirements md file + cy.get('[data-testid="service-requirements"]').should('be.visible'); + verifyResponseStatusCode('@getServiceRequirements', [200, 304], {}, true); + connectionInput(); // Test the connection @@ -909,9 +941,13 @@ export const updateOwner = () => { export const mySqlConnectionInput = () => { cy.get('#root\\/username').type(Cypress.env('mysqlUsername')); + checkServiceFieldSectionHighlighting('username'); cy.get('#root\\/password').type(Cypress.env('mysqlPassword')); + checkServiceFieldSectionHighlighting('password'); cy.get('#root\\/hostPort').type(Cypress.env('mysqlHostPort')); + checkServiceFieldSectionHighlighting('hostPort'); cy.get('#root\\/databaseSchema').type(Cypress.env('mysqlDatabaseSchema')); + checkServiceFieldSectionHighlighting('databaseSchema'); }; export const login = (username, password) => { 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 290e5443080..d524823d791 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 @@ -12,6 +12,7 @@ */ import { + checkServiceFieldSectionHighlighting, deleteCreatedService, editOwnerforCreatedService, goToAddNewServicePage, @@ -39,19 +40,25 @@ describe('BigQuery Ingestion', () => { cy.get('.form-group > #root\\/type') .scrollIntoView() .type('service_account'); + checkServiceFieldSectionHighlighting('type'); cy.get('#root\\/projectId') .scrollIntoView() .type(Cypress.env('bigqueryProjectId')); + checkServiceFieldSectionHighlighting('projectId'); cy.get('#root\\/privateKeyId') .scrollIntoView() .type(Cypress.env('bigqueryPrivateKeyId')); + checkServiceFieldSectionHighlighting('privateKeyId'); cy.get('#root\\/privateKey') .scrollIntoView() .type(Cypress.env('bigqueryPrivateKey')); + checkServiceFieldSectionHighlighting('privateKey'); cy.get('#root\\/clientEmail').scrollIntoView().type(clientEmail); + checkServiceFieldSectionHighlighting('clientEmail'); cy.get('#root\\/clientId') .scrollIntoView() .type(Cypress.env('bigqueryClientId')); + checkServiceFieldSectionHighlighting('clientId'); cy.get('#root\\/clientX509CertUrl') .scrollIntoView() .type( @@ -59,12 +66,15 @@ describe('BigQuery Ingestion', () => { clientEmail )}` ); + checkServiceFieldSectionHighlighting('clientX509CertUrl'); cy.get('[data-testid="add-item-Taxonomy Project IDs"]') .scrollIntoView() .click(); + checkServiceFieldSectionHighlighting('taxonomyProjectID'); cy.get('#root\\/taxonomyProjectID_0') .scrollIntoView() .type(Cypress.env('bigqueryProjectIdTaxonomy')); + checkServiceFieldSectionHighlighting('taxonomyProjectID'); }; const addIngestionInput = () => { @@ -78,12 +88,13 @@ describe('BigQuery Ingestion', () => { .type(filterPattern); }; - testServiceCreationAndIngestion( + testServiceCreationAndIngestion({ serviceType, connectionInput, addIngestionInput, - serviceName - ); + serviceName, + serviceCategory: SERVICE_TYPE.Database, + }); }); it('Update table description and verify description after re-run', () => { 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 87c22fa27db..59de31f8920 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 @@ -12,6 +12,7 @@ */ import { + checkServiceFieldSectionHighlighting, deleteCreatedService, editOwnerforCreatedService, goToAddNewServicePage, @@ -38,15 +39,19 @@ describe('Glue Ingestion', () => { cy.get('#root\\/awsConfig\\/awsAccessKeyId') .scrollIntoView() .type(Cypress.env('glueAwsAccessKeyId')); + checkServiceFieldSectionHighlighting('awsAccessKeyId'); cy.get('#root\\/awsConfig\\/awsSecretAccessKey') .scrollIntoView() .type(Cypress.env('glueAwsSecretAccessKey')); + checkServiceFieldSectionHighlighting('awsSecretAccessKey'); cy.get('#root\\/awsConfig\\/awsRegion') .scrollIntoView() .type(Cypress.env('glueAwsRegion')); + checkServiceFieldSectionHighlighting('awsRegion'); cy.get('#root\\/awsConfig\\/endPointURL') .scrollIntoView() .type(Cypress.env('glueEndPointURL')); + checkServiceFieldSectionHighlighting('endPointURL'); }; const addIngestionInput = () => { @@ -60,14 +65,14 @@ describe('Glue Ingestion', () => { .type(filterPattern); }; - testServiceCreationAndIngestion( + testServiceCreationAndIngestion({ serviceType, connectionInput, addIngestionInput, serviceName, - 'database', - false - ); + testIngestionButton: false, + serviceCategory: SERVICE_TYPE.Database, + }); }); it('Update table description and verify description after re-run', () => { 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 69ecaa083eb..383ced14887 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 @@ -12,6 +12,7 @@ */ import { + checkServiceFieldSectionHighlighting, deleteCreatedService, editOwnerforCreatedService, goToAddNewServicePage, @@ -44,9 +45,11 @@ describe('Kafka Ingestion', () => { cy.get('#root\\/bootstrapServers').type( Cypress.env('kafkaBootstrapServers') ); + checkServiceFieldSectionHighlighting('bootstrapServers'); cy.get('#root\\/schemaRegistryURL').type( Cypress.env('kafkaSchemaRegistryUrl') ); + checkServiceFieldSectionHighlighting('schemaRegistryURL'); }; const addIngestionInput = () => { @@ -59,13 +62,14 @@ describe('Kafka Ingestion', () => { .type(topicName); }; - testServiceCreationAndIngestion( - 'Kafka', + testServiceCreationAndIngestion({ + serviceType: 'Kafka', connectionInput, addIngestionInput, serviceName, - 'messaging' - ); + type: 'messaging', + serviceCategory: SERVICE_TYPE.Messaging, + }); }); it('Update table description and verify description after re-run', () => { 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 3ca9831b653..316a4bfdcc7 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 @@ -12,6 +12,7 @@ */ import { + checkServiceFieldSectionHighlighting, deleteCreatedService, editOwnerforCreatedService, goToAddNewServicePage, @@ -44,12 +45,15 @@ describe('Metabase Ingestion', () => { cy.get('#root\\/username') .scrollIntoView() .type(Cypress.env('metabaseUsername')); + checkServiceFieldSectionHighlighting('username'); cy.get('#root\\/password') .scrollIntoView() .type(Cypress.env('metabasePassword')); + checkServiceFieldSectionHighlighting('password'); cy.get('#root\\/hostPort') .scrollIntoView() .type(Cypress.env('metabaseHostPort')); + checkServiceFieldSectionHighlighting('hostPort'); }; const addIngestionInput = () => { @@ -64,13 +68,14 @@ describe('Metabase Ingestion', () => { .type(tableName); }; - testServiceCreationAndIngestion( + testServiceCreationAndIngestion({ serviceType, connectionInput, addIngestionInput, serviceName, - 'dashboard' - ); + type: 'dashboard', + serviceCategory: SERVICE_TYPE.Dashboard, + }); }); it('Update table description and verify description after re-run', () => { 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 3065049b7d4..72b2d94b653 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 @@ -51,12 +51,13 @@ describe('MySQL Ingestion', () => { .type(Cypress.env('mysqlDatabaseSchema')); }; - testServiceCreationAndIngestion( + testServiceCreationAndIngestion({ serviceType, - mySqlConnectionInput, + connectionInput: mySqlConnectionInput, addIngestionInput, - serviceName - ); + serviceName, + serviceCategory: SERVICE_TYPE.Database, + }); }); it('Update table description and verify description after re-run', () => { diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/postgres.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/postgres.spec.js index be789a7ba7d..a2bbb6db6da 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/postgres.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/postgres.spec.js @@ -12,6 +12,7 @@ */ import { + checkServiceFieldSectionHighlighting, deleteCreatedService, editOwnerforCreatedService, goToAddNewServicePage, @@ -51,15 +52,19 @@ describe('Postgres Ingestion', () => { cy.get('#root\\/username') .scrollIntoView() .type(Cypress.env('postgresUsername')); + checkServiceFieldSectionHighlighting('username'); cy.get('#root\\/password') .scrollIntoView() .type(Cypress.env('postgresPassword')); + checkServiceFieldSectionHighlighting('password'); cy.get('#root\\/hostPort') .scrollIntoView() .type(Cypress.env('postgresHostPort')); + checkServiceFieldSectionHighlighting('hostPort'); cy.get('#root\\/database') .scrollIntoView() .type(Cypress.env('postgresDatabase')); + checkServiceFieldSectionHighlighting('database'); }; const addIngestionInput = () => { @@ -73,12 +78,13 @@ describe('Postgres Ingestion', () => { .type(filterPattern); }; - testServiceCreationAndIngestion( + testServiceCreationAndIngestion({ serviceType, connectionInput, addIngestionInput, - serviceName - ); + serviceName, + serviceCategory: SERVICE_TYPE.Database, + }); }); it('Update table description and verify description after re-run', () => { diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/redshiftWithDBT.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/redshiftWithDBT.spec.js index adcb2f40f0b..b73d2788a71 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/redshiftWithDBT.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/AddNewService/redshiftWithDBT.spec.js @@ -12,6 +12,7 @@ */ import { + checkServiceFieldSectionHighlighting, deleteCreatedService, editOwnerforCreatedService, goToAddNewServicePage, @@ -40,15 +41,19 @@ describe('RedShift Ingestion', () => { goToAddNewServicePage(SERVICE_TYPE.Database); const connectionInput = () => { cy.get('#root\\/username').type(Cypress.env('redshiftUsername')); + checkServiceFieldSectionHighlighting('username'); cy.get('#root\\/password') .scrollIntoView() .type(Cypress.env('redshiftPassword')); + checkServiceFieldSectionHighlighting('password'); cy.get('#root\\/hostPort') .scrollIntoView() .type(Cypress.env('redshiftHost')); + checkServiceFieldSectionHighlighting('hostPort'); cy.get('#root\\/database') .scrollIntoView() .type(Cypress.env('redshiftDatabase')); + checkServiceFieldSectionHighlighting('database'); }; const addIngestionInput = () => { @@ -66,14 +71,15 @@ describe('RedShift Ingestion', () => { .click(); }; - testServiceCreationAndIngestion( - REDSHIFT.serviceType, + testServiceCreationAndIngestion({ + serviceType: REDSHIFT.serviceType, connectionInput, addIngestionInput, - REDSHIFT.serviceName, - 'database', - true - ); + serviceName: REDSHIFT.serviceName, + type: 'database', + testIngestionButton: true, + serviceCategory: SERVICE_TYPE.Database, + }); }); it('Update table description and verify description after re-run', () => { 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 37ab7fc6e4a..20fb8b550e6 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 @@ -12,6 +12,7 @@ */ import { + checkServiceFieldSectionHighlighting, deleteCreatedService, editOwnerforCreatedService, goToAddNewServicePage, @@ -36,10 +37,15 @@ describe('Snowflake Ingestion', () => { goToAddNewServicePage(SERVICE_TYPE.Database); const connectionInput = () => { cy.get('#root\\/username').type(Cypress.env('snowflakeUsername')); + checkServiceFieldSectionHighlighting('username'); cy.get('#root\\/password').type(Cypress.env('snowflakePassword')); + checkServiceFieldSectionHighlighting('password'); cy.get('#root\\/account').type(Cypress.env('snowflakeAccount')); + checkServiceFieldSectionHighlighting('account'); cy.get('#root\\/database').type(Cypress.env('snowflakeDatabase')); + checkServiceFieldSectionHighlighting('database'); cy.get('#root\\/warehouse').type(Cypress.env('snowflakeWarehouse')); + checkServiceFieldSectionHighlighting('warehouse'); }; const addIngestionInput = () => { @@ -53,12 +59,13 @@ describe('Snowflake Ingestion', () => { .type(schema); }; - testServiceCreationAndIngestion( + testServiceCreationAndIngestion({ serviceType, connectionInput, addIngestionInput, - serviceName - ); + serviceName, + serviceCategory: SERVICE_TYPE.Database, + }); }); it('Update table description and verify description after re-run', () => { 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 1ac521d01eb..c14c172742a 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 @@ -66,13 +66,14 @@ describe('Superset Ingestion', () => { .type(tableName); }; - testServiceCreationAndIngestion( + testServiceCreationAndIngestion({ serviceType, connectionInput, addIngestionInput, serviceName, - 'dashboard' - ); + type: 'dashboard', + serviceCategory: SERVICE_TYPE.Dashboard, + }); }); it('Update table description and verify description after re-run', () => { diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Flow/SearchFlow.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Flow/SearchFlow.spec.js index e6716abec9d..10508d614e3 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Flow/SearchFlow.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Flow/SearchFlow.spec.js @@ -33,7 +33,7 @@ import { testServiceCreationAndIngestion, verifyResponseStatusCode, } from '../../common/common'; -import { API_SERVICE } from '../../constants/constants'; +import { API_SERVICE, SERVICE_TYPE } from '../../constants/constants'; import { MYSQL } from '../../constants/service.constants'; const service_name = MYSQL.serviceName; @@ -85,12 +85,13 @@ describe.skip('pre-requests for test case', () => { .type(Cypress.env('mysqlDatabaseSchema')); }; - testServiceCreationAndIngestion( - MYSQL.serviceType, - mySqlConnectionInput, + testServiceCreationAndIngestion({ + serviceType: MYSQL.serviceType, + connectionInput: mySqlConnectionInput, addIngestionInput, - service_name - ); + serviceName: service_name, + serviceCategory: SERVICE_TYPE.Database, + }); }); }); diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/DataQualityAndProfiler.spec.js b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/DataQualityAndProfiler.spec.js index bc1481529bf..137669c9716 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/DataQualityAndProfiler.spec.js +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Pages/DataQualityAndProfiler.spec.js @@ -79,12 +79,13 @@ describe('Data Quality and Profiler should work properly', () => { .type(Cypress.env('mysqlDatabaseSchema')); }; - testServiceCreationAndIngestion( + testServiceCreationAndIngestion({ serviceType, - mySqlConnectionInput, + connectionInput: mySqlConnectionInput, addIngestionInput, - serviceName - ); + serviceName, + serviceCategory: SERVICE_TYPE.Database, + }); }); it('Add Profiler ingestion', () => {