|
|
@ -9,14 +9,21 @@ export const genTest = (apiType, dbType) => { |
|
|
|
|
|
|
|
|
|
|
|
function addNewRow(index, cellValue) { |
|
|
|
function addNewRow(index, cellValue) { |
|
|
|
cy.get(".nc-add-new-row-btn:visible").should("exist"); |
|
|
|
cy.get(".nc-add-new-row-btn:visible").should("exist"); |
|
|
|
cy.get(".nc-add-new-row-btn").click({ force: true }); |
|
|
|
cy.get(".nc-add-new-row-btn").click(); |
|
|
|
cy.get("#data-table-form-Title > input").first().type(cellValue); |
|
|
|
// cy.get("#data-table-form-Title > input").first().type(cellValue);
|
|
|
|
cy.getActiveModal() |
|
|
|
cy.get(".nc-expand-col-Title").find(".nc-cell > input") |
|
|
|
|
|
|
|
.should("exist") |
|
|
|
|
|
|
|
.first() |
|
|
|
|
|
|
|
.clear() |
|
|
|
|
|
|
|
.type(cellValue); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cy.getActiveDrawer() |
|
|
|
.find("button") |
|
|
|
.find("button") |
|
|
|
.contains("Save row") |
|
|
|
.contains("Save row") |
|
|
|
.click({ force: true }); |
|
|
|
.click({ force: true }); |
|
|
|
|
|
|
|
|
|
|
|
cy.toastWait("updated successfully"); |
|
|
|
cy.toastWait("updated successfully"); |
|
|
|
|
|
|
|
cy.get("body").type("{esc}"); |
|
|
|
mainPage.getCell("Title", index).contains(cellValue).should("exist"); |
|
|
|
mainPage.getCell("Title", index).contains(cellValue).should("exist"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -110,7 +117,7 @@ export const genTest = (apiType, dbType) => { |
|
|
|
.clear() |
|
|
|
.clear() |
|
|
|
.type(updatedRandVal); |
|
|
|
.type(updatedRandVal); |
|
|
|
|
|
|
|
|
|
|
|
cy.getActiveModal() |
|
|
|
cy.getActiveDrawer() |
|
|
|
.find("button") |
|
|
|
.find("button") |
|
|
|
.contains("Save row") |
|
|
|
.contains("Save row") |
|
|
|
.click({ force: true }); |
|
|
|
.click({ force: true }); |
|
|
@ -126,7 +133,7 @@ export const genTest = (apiType, dbType) => { |
|
|
|
.should("exist"); |
|
|
|
.should("exist"); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
it("Delete row", () => { |
|
|
|
it("Delete Row", () => { |
|
|
|
mainPage |
|
|
|
mainPage |
|
|
|
.getCell("Title", 1) |
|
|
|
.getCell("Title", 1) |
|
|
|
.contains(updatedRandVal) |
|
|
|
.contains(updatedRandVal) |
|
|
@ -134,7 +141,7 @@ export const genTest = (apiType, dbType) => { |
|
|
|
|
|
|
|
|
|
|
|
// delete row
|
|
|
|
// delete row
|
|
|
|
cy.getActiveMenu() |
|
|
|
cy.getActiveMenu() |
|
|
|
.find('.ant-dropdown-menu-item:contains("Delete row")') |
|
|
|
.find('.ant-dropdown-menu-item:contains("Delete Row")') |
|
|
|
.first() |
|
|
|
.first() |
|
|
|
.click({ force: true }); |
|
|
|
.click({ force: true }); |
|
|
|
cy.get("td").contains(randVal).should("not.exist"); |
|
|
|
cy.get("td").contains(randVal).should("not.exist"); |
|
|
@ -155,7 +162,7 @@ export const genTest = (apiType, dbType) => { |
|
|
|
// delete selected rows
|
|
|
|
// delete selected rows
|
|
|
|
mainPage.getCell("Title", 3).rightclick({ force: true }); |
|
|
|
mainPage.getCell("Title", 3).rightclick({ force: true }); |
|
|
|
cy.getActiveMenu() |
|
|
|
cy.getActiveMenu() |
|
|
|
.contains("Delete all selected rows") |
|
|
|
.contains("Delete Selected Rows") |
|
|
|
.click({ force: true }); |
|
|
|
.click({ force: true }); |
|
|
|
|
|
|
|
|
|
|
|
// verify if everything is wiped off
|
|
|
|
// verify if everything is wiped off
|
|
|
|