|
|
|
@ -9,14 +9,21 @@ export const genTest = (apiType, dbType) => {
|
|
|
|
|
|
|
|
|
|
function addNewRow(index, cellValue) { |
|
|
|
|
cy.get(".nc-add-new-row-btn:visible").should("exist"); |
|
|
|
|
cy.get(".nc-add-new-row-btn").click({ force: true }); |
|
|
|
|
cy.get("#data-table-form-Title > input").first().type(cellValue); |
|
|
|
|
cy.getActiveModal() |
|
|
|
|
cy.get(".nc-add-new-row-btn").click(); |
|
|
|
|
// cy.get("#data-table-form-Title > input").first().type(cellValue);
|
|
|
|
|
cy.get(".nc-expand-col-Title").find(".nc-cell > input") |
|
|
|
|
.should("exist") |
|
|
|
|
.first() |
|
|
|
|
.clear() |
|
|
|
|
.type(cellValue); |
|
|
|
|
|
|
|
|
|
cy.getActiveDrawer() |
|
|
|
|
.find("button") |
|
|
|
|
.contains("Save row") |
|
|
|
|
.click({ force: true }); |
|
|
|
|
|
|
|
|
|
cy.toastWait("updated successfully"); |
|
|
|
|
cy.get("body").type("{esc}"); |
|
|
|
|
mainPage.getCell("Title", index).contains(cellValue).should("exist"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -34,7 +41,7 @@ export const genTest = (apiType, dbType) => {
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
beforeEach(() => { |
|
|
|
|
cy.fileHook(); |
|
|
|
|
cy.fileHook(); |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
// delete table
|
|
|
|
@ -69,17 +76,17 @@ export const genTest = (apiType, dbType) => {
|
|
|
|
|
// edit the newly created column
|
|
|
|
|
it("Edit table column - rename", () => { |
|
|
|
|
cy.get(`th:contains(${colName}) .nc-icon.ant-dropdown-trigger`) |
|
|
|
|
.trigger("mouseover", { force: true }) |
|
|
|
|
.click({ force: true }); |
|
|
|
|
.trigger("mouseover", { force: true }) |
|
|
|
|
.click({ force: true }); |
|
|
|
|
|
|
|
|
|
cy.get(".nc-column-edit").click(); |
|
|
|
|
cy.get(".nc-column-edit").should("not.be.visible"); |
|
|
|
|
|
|
|
|
|
// rename column and verify
|
|
|
|
|
cy.getActiveMenu().find('input.nc-column-name-input', { timeout: 3000 }) |
|
|
|
|
.should('exist') |
|
|
|
|
.clear() |
|
|
|
|
.type(updatedColName); |
|
|
|
|
.should('exist') |
|
|
|
|
.clear() |
|
|
|
|
.type(updatedColName); |
|
|
|
|
cy.get(".ant-btn-primary:visible").contains("Save").click(); |
|
|
|
|
|
|
|
|
|
cy.toastWait("Column updated"); |
|
|
|
@ -110,7 +117,7 @@ export const genTest = (apiType, dbType) => {
|
|
|
|
|
.clear() |
|
|
|
|
.type(updatedRandVal); |
|
|
|
|
|
|
|
|
|
cy.getActiveModal() |
|
|
|
|
cy.getActiveDrawer() |
|
|
|
|
.find("button") |
|
|
|
|
.contains("Save row") |
|
|
|
|
.click({ force: true }); |
|
|
|
@ -126,7 +133,7 @@ export const genTest = (apiType, dbType) => {
|
|
|
|
|
.should("exist"); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
it("Delete row", () => { |
|
|
|
|
it("Delete Row", () => { |
|
|
|
|
mainPage |
|
|
|
|
.getCell("Title", 1) |
|
|
|
|
.contains(updatedRandVal) |
|
|
|
@ -134,7 +141,7 @@ export const genTest = (apiType, dbType) => {
|
|
|
|
|
|
|
|
|
|
// delete row
|
|
|
|
|
cy.getActiveMenu() |
|
|
|
|
.find('.ant-dropdown-menu-item:contains("Delete row")') |
|
|
|
|
.find('.ant-dropdown-menu-item:contains("Delete Row")') |
|
|
|
|
.first() |
|
|
|
|
.click({ force: true }); |
|
|
|
|
cy.get("td").contains(randVal).should("not.exist"); |
|
|
|
@ -150,12 +157,12 @@ export const genTest = (apiType, dbType) => {
|
|
|
|
|
|
|
|
|
|
cy.get('.nc-no-label').should('exist').eq(0).trigger('mouseover', { force: true }) |
|
|
|
|
cy.get(".ant-checkbox").should('exist') |
|
|
|
|
.eq(0).click({ force: true }); |
|
|
|
|
.eq(0).click({ force: true }); |
|
|
|
|
|
|
|
|
|
// delete selected rows
|
|
|
|
|
mainPage.getCell("Title", 3).rightclick({ force: true }); |
|
|
|
|
cy.getActiveMenu() |
|
|
|
|
.contains("Delete all selected rows") |
|
|
|
|
.contains("Delete Selected Rows") |
|
|
|
|
.click({ force: true }); |
|
|
|
|
|
|
|
|
|
// verify if everything is wiped off
|
|
|
|
|