|
|
@ -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"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -34,7 +41,7 @@ export const genTest = (apiType, dbType) => { |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
beforeEach(() => { |
|
|
|
beforeEach(() => { |
|
|
|
cy.fileHook(); |
|
|
|
cy.fileHook(); |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
// delete table
|
|
|
|
// delete table
|
|
|
@ -69,17 +76,17 @@ export const genTest = (apiType, dbType) => { |
|
|
|
// edit the newly created column
|
|
|
|
// edit the newly created column
|
|
|
|
it("Edit table column - rename", () => { |
|
|
|
it("Edit table column - rename", () => { |
|
|
|
cy.get(`th:contains(${colName}) .nc-icon.ant-dropdown-trigger`) |
|
|
|
cy.get(`th:contains(${colName}) .nc-icon.ant-dropdown-trigger`) |
|
|
|
.trigger("mouseover", { force: true }) |
|
|
|
.trigger("mouseover", { force: true }) |
|
|
|
.click({ force: true }); |
|
|
|
.click({ force: true }); |
|
|
|
|
|
|
|
|
|
|
|
cy.get(".nc-column-edit").click(); |
|
|
|
cy.get(".nc-column-edit").click(); |
|
|
|
cy.get(".nc-column-edit").should("not.be.visible"); |
|
|
|
cy.get(".nc-column-edit").should("not.be.visible"); |
|
|
|
|
|
|
|
|
|
|
|
// rename column and verify
|
|
|
|
// rename column and verify
|
|
|
|
cy.getActiveMenu().find('input.nc-column-name-input', { timeout: 3000 }) |
|
|
|
cy.getActiveMenu().find('input.nc-column-name-input', { timeout: 3000 }) |
|
|
|
.should('exist') |
|
|
|
.should('exist') |
|
|
|
.clear() |
|
|
|
.clear() |
|
|
|
.type(updatedColName); |
|
|
|
.type(updatedColName); |
|
|
|
cy.get(".ant-btn-primary:visible").contains("Save").click(); |
|
|
|
cy.get(".ant-btn-primary:visible").contains("Save").click(); |
|
|
|
|
|
|
|
|
|
|
|
cy.toastWait("Column updated"); |
|
|
|
cy.toastWait("Column updated"); |
|
|
@ -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"); |
|
|
@ -150,12 +157,12 @@ export const genTest = (apiType, dbType) => { |
|
|
|
|
|
|
|
|
|
|
|
cy.get('.nc-no-label').should('exist').eq(0).trigger('mouseover', { force: true }) |
|
|
|
cy.get('.nc-no-label').should('exist').eq(0).trigger('mouseover', { force: true }) |
|
|
|
cy.get(".ant-checkbox").should('exist') |
|
|
|
cy.get(".ant-checkbox").should('exist') |
|
|
|
.eq(0).click({ force: true }); |
|
|
|
.eq(0).click({ force: true }); |
|
|
|
|
|
|
|
|
|
|
|
// 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
|
|
|
@ -185,4 +192,4 @@ export const genTest = (apiType, dbType) => { |
|
|
|
* You should have received a copy of the GNU Affero General Public License |
|
|
|
* 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/>.
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
* |
|
|
|
* |
|
|
|
*/ |
|
|
|
*/ |