diff --git a/openmetadata-ui/src/main/resources/ui/cypress/e2e/Features/SchemaDefinition.spec.ts b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Features/SchemaDefinition.spec.ts new file mode 100644 index 00000000000..9ae1c457632 --- /dev/null +++ b/openmetadata-ui/src/main/resources/ui/cypress/e2e/Features/SchemaDefinition.spec.ts @@ -0,0 +1,35 @@ +/* + * Copyright 2024 Collate. + * 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. + */ +import { visitEntityDetailsPage } from '../../common/Utils/Entity'; +import { EntityType } from '../../constants/Entity.interface'; + +const table = { + term: 'dim_address', + serviceName: 'sample_data', + entity: EntityType.Table, +}; +const query = + 'CREATE TABLE dim_address(address_id NUMERIC PRIMARY KEY, shop_id NUMERIC)'; + +describe('Schema definition (views)', () => { + beforeEach(() => { + cy.login(); + }); + + it('Verify schema definition (views) of table entity', () => { + visitEntityDetailsPage(table); + + cy.get('[data-testid="schema_definition"]').click(); + cy.get('.CodeMirror-line > [role="presentation"]').should('contain', query); + }); +}); diff --git a/openmetadata-ui/src/main/resources/ui/cypress/support/commands.ts b/openmetadata-ui/src/main/resources/ui/cypress/support/commands.ts index 6bcd6a52b2c..9d77a93a916 100644 --- a/openmetadata-ui/src/main/resources/ui/cypress/support/commands.ts +++ b/openmetadata-ui/src/main/resources/ui/cypress/support/commands.ts @@ -49,7 +49,7 @@ Cypress.Commands.add('goToHomePage', (doNotNavigate) => { interceptURL('GET', '/api/v1/users/loggedInUser?fields=*', 'userProfile'); !doNotNavigate && cy.visit('/'); - verifyResponseStatusCode('@userProfile', 200, { timeout: 10000 }); + verifyResponseStatusCode('@userProfile', 200, { requestTimeout: 10000 }); }); Cypress.Commands.add('clickOnLogo', () => {