|
|
@ -8,6 +8,13 @@ export const genTest = (apiType, dbType) => { |
|
|
|
before(() => { |
|
|
|
before(() => { |
|
|
|
cy.fileHook(); |
|
|
|
cy.fileHook(); |
|
|
|
mainPage.tabReset(); |
|
|
|
mainPage.tabReset(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// // kludge: wait for page load to finish
|
|
|
|
|
|
|
|
// cy.wait(1000);
|
|
|
|
|
|
|
|
// // close team & auth tab
|
|
|
|
|
|
|
|
// cy.get('button.ant-tabs-tab-remove').should('exist').click();
|
|
|
|
|
|
|
|
// cy.wait(1000);
|
|
|
|
|
|
|
|
|
|
|
|
// open country table
|
|
|
|
// open country table
|
|
|
|
cy.openTableTab("Country", 25); |
|
|
|
cy.openTableTab("Country", 25); |
|
|
|
}); |
|
|
|
}); |
|
|
@ -46,15 +53,26 @@ export const genTest = (apiType, dbType) => { |
|
|
|
|
|
|
|
|
|
|
|
// create new row using + button in header
|
|
|
|
// create new row using + button in header
|
|
|
|
//
|
|
|
|
//
|
|
|
|
it.skip("Add row using tool header button", () => { |
|
|
|
it("Add row using tool header button", () => { |
|
|
|
// add a row to end of Country table
|
|
|
|
// add a row to end of Country table
|
|
|
|
cy.get(".nc-add-new-row-btn").click(); |
|
|
|
cy.get(".nc-add-new-row-btn").click(); |
|
|
|
cy.get("#data-table-form-Country > input") |
|
|
|
cy.wait(1000); |
|
|
|
.first() |
|
|
|
cy.get(".nc-expand-col-Country").find(".nc-cell > input").first().type("Test Country"); |
|
|
|
.type("Test Country"); |
|
|
|
cy.getActiveDrawer() |
|
|
|
cy.contains("Save row").filter("button").click(); |
|
|
|
.find(".ant-btn-primary") |
|
|
|
|
|
|
|
.contains("Save row") |
|
|
|
|
|
|
|
.click(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// cy.get("#data-table-form-Country > input")
|
|
|
|
|
|
|
|
// .first()
|
|
|
|
|
|
|
|
// .type("Test Country");
|
|
|
|
|
|
|
|
// cy.contains("Save row").filter("button").click();
|
|
|
|
|
|
|
|
|
|
|
|
cy.toastWait("updated successfully"); |
|
|
|
cy.toastWait("updated successfully"); |
|
|
|
|
|
|
|
cy.getActiveDrawer() |
|
|
|
|
|
|
|
.find(".ant-btn") |
|
|
|
|
|
|
|
.contains("Cancel") |
|
|
|
|
|
|
|
.click(); |
|
|
|
|
|
|
|
|
|
|
|
// verify
|
|
|
|
// verify
|
|
|
|
mainPage.getPagination(5).click(); |
|
|
|
mainPage.getPagination(5).click(); |
|
|
@ -68,7 +86,7 @@ export const genTest = (apiType, dbType) => { |
|
|
|
|
|
|
|
|
|
|
|
// delete single row
|
|
|
|
// delete single row
|
|
|
|
//
|
|
|
|
//
|
|
|
|
it.skip("Delete Row", () => { |
|
|
|
it("Delete Row", () => { |
|
|
|
// delete row added in previous step
|
|
|
|
// delete row added in previous step
|
|
|
|
mainPage.getCell("Country", 10).rightclick(); |
|
|
|
mainPage.getCell("Country", 10).rightclick(); |
|
|
|
cy.getActiveMenu().contains("Delete Row").click(); |
|
|
|
cy.getActiveMenu().contains("Delete Row").click(); |
|
|
@ -76,18 +94,18 @@ export const genTest = (apiType, dbType) => { |
|
|
|
// cy.toastWait('Deleted row successfully')
|
|
|
|
// cy.toastWait('Deleted row successfully')
|
|
|
|
|
|
|
|
|
|
|
|
// verify
|
|
|
|
// verify
|
|
|
|
mainPage.getCell("Country", 10).should("not.exist"); |
|
|
|
cy.get(`:nth-child(10) > [data-title="Country"]`).should("not.exist"); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// create new row using right click menu option
|
|
|
|
// create new row using right click menu option
|
|
|
|
//
|
|
|
|
//
|
|
|
|
it("Add row using rightclick menu option", () => { |
|
|
|
it.skip("Add row using rightclick menu option", () => { |
|
|
|
// Temporary
|
|
|
|
// Temporary
|
|
|
|
mainPage.getPagination(5).click(); |
|
|
|
mainPage.getPagination(5).click(); |
|
|
|
|
|
|
|
|
|
|
|
mainPage.getCell("Country", 9).rightclick({ force: true }); |
|
|
|
mainPage.getCell("Country", 9).rightclick({ force: true }); |
|
|
|
cy.getActiveMenu() |
|
|
|
cy.getActiveMenu() |
|
|
|
.contains("Insert new row") |
|
|
|
.contains("Insert New Row") |
|
|
|
.click({ force: true }); |
|
|
|
.click({ force: true }); |
|
|
|
mainPage |
|
|
|
mainPage |
|
|
|
.getCell("Country", 10) |
|
|
|
.getCell("Country", 10) |
|
|
@ -97,7 +115,7 @@ export const genTest = (apiType, dbType) => { |
|
|
|
|
|
|
|
|
|
|
|
mainPage.getCell("Country", 10).rightclick({ force: true }); |
|
|
|
mainPage.getCell("Country", 10).rightclick({ force: true }); |
|
|
|
cy.getActiveMenu() |
|
|
|
cy.getActiveMenu() |
|
|
|
.contains("Insert new row") |
|
|
|
.contains("Insert New Row") |
|
|
|
.click({ force: true }); |
|
|
|
.click({ force: true }); |
|
|
|
mainPage |
|
|
|
mainPage |
|
|
|
.getCell("Country", 11) |
|
|
|
.getCell("Country", 11) |
|
|
@ -107,7 +125,7 @@ export const genTest = (apiType, dbType) => { |
|
|
|
|
|
|
|
|
|
|
|
// GUI-v2 Kludge:
|
|
|
|
// GUI-v2 Kludge:
|
|
|
|
// to move cursor away from input field; enter key is not recognized
|
|
|
|
// to move cursor away from input field; enter key is not recognized
|
|
|
|
mainPage.getCell("Country", 10).click() |
|
|
|
// mainPage.getCell("Country", 10).click()
|
|
|
|
|
|
|
|
|
|
|
|
// verify
|
|
|
|
// verify
|
|
|
|
mainPage |
|
|
|
mainPage |
|
|
@ -122,7 +140,7 @@ export const genTest = (apiType, dbType) => { |
|
|
|
|
|
|
|
|
|
|
|
// delete selected rows (multiple)
|
|
|
|
// delete selected rows (multiple)
|
|
|
|
//
|
|
|
|
//
|
|
|
|
it("Delete Selected", () => { |
|
|
|
it.skip("Delete Selected", () => { |
|
|
|
cy.get(".ant-checkbox").should('exist') |
|
|
|
cy.get(".ant-checkbox").should('exist') |
|
|
|
.eq(10).click({ force: true }); |
|
|
|
.eq(10).click({ force: true }); |
|
|
|
cy.get(".ant-checkbox").should('exist') |
|
|
|
cy.get(".ant-checkbox").should('exist') |
|
|
@ -147,22 +165,21 @@ export const genTest = (apiType, dbType) => { |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// GUI-v2 Kludge: Disable sort isn't disappearing after clear
|
|
|
|
describe(`Sort operations`, () => { |
|
|
|
// describe(`Sort operations`, () => {
|
|
|
|
beforeEach(() => { |
|
|
|
// beforeEach(() => {
|
|
|
|
cy.fileHook(); |
|
|
|
// cy.fileHook();
|
|
|
|
}) |
|
|
|
// })
|
|
|
|
|
|
|
|
//
|
|
|
|
it("Enable sort", () => { |
|
|
|
// it("Enable sort", () => {
|
|
|
|
mainPage.sortField("Country", "Z → A"); |
|
|
|
// mainPage.sortField("Country", "Z → A");
|
|
|
|
cy.contains("Zambia").should("exist"); |
|
|
|
// cy.contains("Zambia").should("exist");
|
|
|
|
}); |
|
|
|
// });
|
|
|
|
|
|
|
|
//
|
|
|
|
it("Disable sort", () => { |
|
|
|
// it("Disable sort", () => {
|
|
|
|
mainPage.clearSort(); |
|
|
|
// mainPage.clearSort();
|
|
|
|
cy.contains("Zambia").should("not.exist"); |
|
|
|
// cy.contains("Zambia").should("not.exist");
|
|
|
|
}); |
|
|
|
// });
|
|
|
|
}); |
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
describe("Field Operation", () => { |
|
|
|
describe("Field Operation", () => { |
|
|
|
beforeEach(() => { |
|
|
|
beforeEach(() => { |
|
|
|