|
|
|
@ -5,24 +5,29 @@ import { isTestSuiteActive } from "../../support/page_objects/projectConstants";
|
|
|
|
|
export const genTest = (apiType, dbType) => { |
|
|
|
|
if (!isTestSuiteActive(apiType, dbType)) return; |
|
|
|
|
|
|
|
|
|
describe(`${apiType.toUpperCase()} api - Filter, Fields, Sort`, () => { |
|
|
|
|
before(() => { |
|
|
|
|
// loginPage.loginAndOpenProject(apiType, dbType);
|
|
|
|
|
|
|
|
|
|
// open country table
|
|
|
|
|
cy.openTableTab("Country", 25); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
after(() => { |
|
|
|
|
cy.closeTableTab("Country"); |
|
|
|
|
}); |
|
|
|
|
describe(`${apiType.toUpperCase()} api - Grid operations`, () => { |
|
|
|
|
// before(() => {
|
|
|
|
|
// // loginPage.loginAndOpenProject(apiType, dbType);
|
|
|
|
|
//
|
|
|
|
|
// // open country table
|
|
|
|
|
// cy.openTableTab("Country", 25);
|
|
|
|
|
// });
|
|
|
|
|
//
|
|
|
|
|
// after(() => {
|
|
|
|
|
// cy.closeTableTab("Country");
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
describe(`Pagination`, () => { |
|
|
|
|
beforeEach(() => { |
|
|
|
|
cy.restoreLocalStorage(); |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
afterEach(() => { |
|
|
|
|
cy.saveLocalStorage(); |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
// check pagination
|
|
|
|
|
it("Check country table - Pagination", () => { |
|
|
|
|
cy.openTableTab("Country", 25); |
|
|
|
|
|
|
|
|
|
cy.get(".nc-pagination").should("exist"); |
|
|
|
|
|
|
|
|
|
// verify > pagination option
|
|
|
|
@ -37,12 +42,6 @@ export const genTest = (apiType, dbType) => {
|
|
|
|
|
.getPagination(1) |
|
|
|
|
.should("have.class", "ant-pagination-item-active"); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
describe(`Row operations`, () => { |
|
|
|
|
beforeEach(() => { |
|
|
|
|
cy.fileHook(); |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
// create new row using + button in header
|
|
|
|
|
//
|
|
|
|
@ -158,12 +157,7 @@ export const genTest = (apiType, dbType) => {
|
|
|
|
|
|
|
|
|
|
mainPage.getPagination(1).click(); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
describe(`Sort operations`, () => { |
|
|
|
|
beforeEach(() => { |
|
|
|
|
cy.fileHook(); |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
it("Enable sort", () => { |
|
|
|
|
mainPage.sortField("Country", "Z → A"); |
|
|
|
@ -174,12 +168,6 @@ export const genTest = (apiType, dbType) => {
|
|
|
|
|
mainPage.clearSort(); |
|
|
|
|
cy.contains("Zambia").should("not.exist"); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
describe("Field Operation", () => { |
|
|
|
|
beforeEach(() => { |
|
|
|
|
cy.fileHook(); |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
it("Hide field", () => { |
|
|
|
|
mainPage.hideField("LastUpdate"); |
|
|
|
@ -188,12 +176,6 @@ export const genTest = (apiType, dbType) => {
|
|
|
|
|
it("Show field", () => { |
|
|
|
|
mainPage.unhideField("LastUpdate"); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
describe("Filter operations", () => { |
|
|
|
|
beforeEach(() => { |
|
|
|
|
cy.fileHook(); |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
it("Create Filter", () => { |
|
|
|
|
mainPage.filterField("Country", "is equal", "India"); |
|
|
|
@ -210,7 +192,8 @@ export const genTest = (apiType, dbType) => {
|
|
|
|
|
.contains("India") |
|
|
|
|
.should("not.exist"); |
|
|
|
|
// cy.contains("td:contains(India)").should("not.exist");
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
cy.closeTableTab("Country"); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}; |
|
|
|
|