mirror of https://github.com/nocodb/nocodb
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
133 lines
4.9 KiB
133 lines
4.9 KiB
3 years ago
|
import { mainPage } from "../../support/page_objects/mainPage";
|
||
3 years ago
|
import { isTestSuiteActive } from "../../support/page_objects/projectConstants";
|
||
3 years ago
|
|
||
3 years ago
|
export const genTest = (apiType, dbType) => {
|
||
3 years ago
|
if (!isTestSuiteActive(apiType, dbType)) return;
|
||
3 years ago
|
|
||
3 years ago
|
describe(`${apiType.toUpperCase()} api - M2M Column validation`, () => {
|
||
|
before(() => {
|
||
3 years ago
|
mainPage.tabReset();
|
||
3 years ago
|
cy.openTableTab("Actor", 25);
|
||
|
});
|
||
3 years ago
|
|
||
3 years ago
|
after(() => {
|
||
|
cy.closeTableTab("Actor");
|
||
|
});
|
||
3 years ago
|
|
||
3 years ago
|
it("Table column header, URL validation", () => {
|
||
|
// column name validation
|
||
|
cy.get(`.project-tab:contains(Actor):visible`).should("exist");
|
||
|
// URL validation
|
||
|
cy.url().should("contain", `name=Actor`);
|
||
|
});
|
||
3 years ago
|
|
||
2 years ago
|
it("M2m chip content validation on grid", () => {
|
||
|
// grid m2m content validation
|
||
|
mainPage.getCell("Film List", 1)
|
||
|
.find('.nc-virtual-cell > .v-lazy > .d-flex > .chips')
|
||
|
.contains("ACADEMY DINOSAUR")
|
||
|
.should('exist');
|
||
|
mainPage.getCell("Film List", 1)
|
||
|
.find('.nc-virtual-cell > .v-lazy > .d-flex > .chips')
|
||
|
.contains("ANACONDA CONFESSIONS")
|
||
|
.should('exist');
|
||
|
});
|
||
|
|
||
3 years ago
|
it("Expand m2m column", () => {
|
||
|
// expand first row
|
||
3 years ago
|
cy.get('td[data-col="Film List"] div', { timeout: 12000 })
|
||
3 years ago
|
.first()
|
||
|
.click({ force: true });
|
||
3 years ago
|
cy.get('td[data-col="Film List"] div .mdi-arrow-expand')
|
||
3 years ago
|
.first()
|
||
|
.click({ force: true });
|
||
3 years ago
|
|
||
3 years ago
|
cy.snipActiveModal("Modal_ManyToMany");
|
||
3 years ago
|
|
||
3 years ago
|
// validations
|
||
|
cy.getActiveModal().contains("Film").should("exist");
|
||
|
cy.getActiveModal().find("button.mdi-reload").should("exist");
|
||
|
cy.getActiveModal()
|
||
|
.find("button:contains(Link to 'Film')")
|
||
|
.should("exist");
|
||
|
cy.getActiveModal()
|
||
|
.find(".child-card")
|
||
|
.eq(0)
|
||
|
.contains("ACADEMY DINOSAUR")
|
||
|
.should("exist");
|
||
|
});
|
||
|
|
||
|
it('Expand "Link to" record, validate', () => {
|
||
|
cy.getActiveModal()
|
||
|
.find("button:contains(Link to 'Film')")
|
||
|
.click()
|
||
|
.then(() => {
|
||
|
cy.snipActiveModal("Modal_M2M_LinkToRecord");
|
||
|
// Link record form validation
|
||
2 years ago
|
cy.getActiveModal().contains("Link record").should("exist");
|
||
3 years ago
|
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("ACE GOLDFINGER")
|
||
|
.should("exist");
|
||
|
cy.get("body").type("{esc}");
|
||
|
});
|
||
3 years ago
|
});
|
||
3 years ago
|
|
||
3 years ago
|
it("Expand first linked card, validate", () => {
|
||
|
cy.getActiveModal()
|
||
|
.find(".child-card")
|
||
|
.eq(0)
|
||
|
.contains("ACADEMY DINOSAUR", { timeout: 2000 })
|
||
|
.click()
|
||
|
.then(() => {
|
||
|
// Link card validation
|
||
|
cy.getActiveModal()
|
||
|
.find("h5")
|
||
|
.contains("ACADEMY DINOSAUR")
|
||
|
.should("exist");
|
||
|
cy.getActiveModal()
|
||
3 years ago
|
.find('button:contains("Save row")')
|
||
3 years ago
|
.should("exist");
|
||
|
cy.getActiveModal()
|
||
|
.find('button:contains("Cancel")')
|
||
|
.should("exist");
|
||
3 years ago
|
|
||
3 years ago
|
cy.getActiveModal()
|
||
|
.find('button:contains("Cancel")')
|
||
|
.click();
|
||
|
cy.getActiveModal().find("button.mdi-close").click();
|
||
|
});
|
||
3 years ago
|
});
|
||
|
});
|
||
|
};
|
||
3 years ago
|
|
||
3 years ago
|
/**
|
||
|
* @copyright Copyright (c) 2021, Xgene Cloud Ltd
|
||
|
*
|
||
|
* @author Pranav C Balan <pranavxc@gmail.com>
|
||
|
* @author Raju Udava <sivadstala@gmail.com>
|
||
|
*
|
||
|
* @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 <http://www.gnu.org/licenses/>.
|
||
|
*
|
||
|
*/
|