diff --git a/cypress/integration/common/filter_sort_fields_operations_spec.js b/cypress/integration/common/filter_sort_fields_operations_spec.js index 846d533f12..f3b12053e9 100644 --- a/cypress/integration/common/filter_sort_fields_operations_spec.js +++ b/cypress/integration/common/filter_sort_fields_operations_spec.js @@ -158,3 +158,25 @@ const genTest = (type) => { genTest('rest') genTest('graphql') + +/** + * @copyright Copyright (c) 2021, Xgene Cloud Ltd + * + * @author Raju Udava + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ \ No newline at end of file diff --git a/cypress/integration/common/open_existing_table_spec.js b/cypress/integration/common/open_existing_table_spec.js index b62247b902..6f03b54271 100644 --- a/cypress/integration/common/open_existing_table_spec.js +++ b/cypress/integration/common/open_existing_table_spec.js @@ -4,30 +4,60 @@ import { loginPage } from "../../support/page_objects/navigation" const genTest = (type) => { describe(`${type.toUpperCase()} api - Existing table`, () => { + before(() => loginPage.loginAndOpenProject(type)) - before(loginPage.loginAndOpenProject(type)) - - it('Open Country table', () => { - - cy.get('.nc-project-tree :contains(Tables)', {timeout: 10000}) - .first().click() - .contains('Country', {timeout: 6000}).first().click({force: true}); + it('Table column header, URL validation', () => { + cy.openTableTab('Country') + // column name validation cy.get(`.project-tab:contains(Country):visible`).should('exist') + // URL validation cy.url().should('contain', `?name=Country&`) + }) + + it('Expand belongs-to column', () => { + // expand first row cy.get('td[data-col="Country => City"] div:visible', {timeout: 12000}).first().click() cy.get('td[data-col="Country => City"] div .mdi-arrow-expand:visible').first().click() - - cy.get(":contains(Link to 'City'):visible").should('exist') - - cy.get(":contains(Link to 'City'):visible").first().click() - }); - - + }) + + it('Expand Link record, validate', () => { + cy.getActiveModal().find('button:contains(Link to \'City\')').click() + cy.wait(1000) + + // Link record form validation + cy.getActiveModal().contains('Link Record').should('exist') + cy.getActiveModal().find('button.mdi-reload').should('exist') + cy.getActiveModal().find('button:contains("New Record")').should('exist') + cy.getActiveModal().find('.child-card').eq(0).contains('Batna').should('exist') + }) }) } - genTest('rest') genTest('graphql') + + +/** + * @copyright Copyright (c) 2021, Xgene Cloud Ltd + * + * @author Pranav C Balan + * @author Raju Udava + * + * @license GNU AGPL version 3 or any later version + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ diff --git a/cypress/support/commands.js b/cypress/support/commands.js index 96814986a8..9d727703a4 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -165,7 +165,7 @@ Cypress.Commands.add("getActiveMenu", () => { return cy.get('.menuable__content__active').last() }); -Cypress.Commands.add("getActiveModal", () => { +Cypress.Commands.add("getActiveContentModal", () => { return cy.get('.v-dialog__content--active').last() });