|
|
@ -42,33 +42,23 @@ export const genTest = (apiType, dbType) => { |
|
|
|
//
|
|
|
|
//
|
|
|
|
before(() => { |
|
|
|
before(() => { |
|
|
|
cy.restoreLocalStorage(); |
|
|
|
cy.restoreLocalStorage(); |
|
|
|
cy.wait(500); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mainPage.tabReset(); |
|
|
|
|
|
|
|
cy.openTableTab("Address", 25); |
|
|
|
cy.openTableTab("Address", 25); |
|
|
|
|
|
|
|
|
|
|
|
// loginPage.loginAndOpenProject(apiType, dbType);
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// // open a table to work on views
|
|
|
|
|
|
|
|
// //
|
|
|
|
|
|
|
|
// cy.openTableTab("Address", 25);
|
|
|
|
|
|
|
|
// mainPage.toggleRightSidebar();
|
|
|
|
|
|
|
|
// //
|
|
|
|
|
|
|
|
// cy.saveLocalStorage();
|
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
beforeEach(() => { |
|
|
|
beforeEach(() => { |
|
|
|
|
|
|
|
cy.restoreLocalStorage(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
afterEach(() => { |
|
|
|
afterEach(() => { |
|
|
|
|
|
|
|
cy.saveLocalStorage(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
after(() => { |
|
|
|
after(() => { |
|
|
|
// close table
|
|
|
|
// close table
|
|
|
|
// mainPage.deleteCreatedViews()
|
|
|
|
// mainPage.deleteCreatedViews()
|
|
|
|
cy.restoreLocalStorage(); |
|
|
|
cy.restoreLocalStorage(); |
|
|
|
cy.wait(500); |
|
|
|
|
|
|
|
cy.closeTableTab("Address"); |
|
|
|
cy.closeTableTab("Address"); |
|
|
|
|
|
|
|
cy.saveLocalStorage(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// Common routine to create/edit/delete GRID & GALLERY view
|
|
|
|
// Common routine to create/edit/delete GRID & GALLERY view
|
|
|
@ -77,9 +67,6 @@ export const genTest = (apiType, dbType) => { |
|
|
|
const viewTest = (viewType) => { |
|
|
|
const viewTest = (viewType) => { |
|
|
|
it(`Create ${viewType.toUpperCase()} view`, () => { |
|
|
|
it(`Create ${viewType.toUpperCase()} view`, () => { |
|
|
|
|
|
|
|
|
|
|
|
cy.restoreLocalStorage(); |
|
|
|
|
|
|
|
cy.wait(500); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// create a normal public view
|
|
|
|
// create a normal public view
|
|
|
|
cy.get(`.nc-create-${viewType}-view`).click(); |
|
|
|
cy.get(`.nc-create-${viewType}-view`).click(); |
|
|
|
cy.getActiveModal(".nc-modal-view-create").find("button:contains(Submit)").click(); |
|
|
|
cy.getActiveModal(".nc-modal-view-create").find("button:contains(Submit)").click(); |
|
|
@ -93,9 +80,6 @@ export const genTest = (apiType, dbType) => { |
|
|
|
|
|
|
|
|
|
|
|
it(`Share ${viewType.toUpperCase()} hide, sort, filter & verify`, () => { |
|
|
|
it(`Share ${viewType.toUpperCase()} hide, sort, filter & verify`, () => { |
|
|
|
|
|
|
|
|
|
|
|
cy.restoreLocalStorage(); |
|
|
|
|
|
|
|
cy.wait(500); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cy.get(`.nc-view-item.nc-${viewType}-view-item`) |
|
|
|
cy.get(`.nc-view-item.nc-${viewType}-view-item`) |
|
|
|
.contains("Grid-1") |
|
|
|
.contains("Grid-1") |
|
|
|
.click(); |
|
|
|
.click(); |
|
|
@ -108,9 +92,6 @@ export const genTest = (apiType, dbType) => { |
|
|
|
|
|
|
|
|
|
|
|
it(`Share GRID view : ensure we have only one link even if shared multiple times`, () => { |
|
|
|
it(`Share GRID view : ensure we have only one link even if shared multiple times`, () => { |
|
|
|
|
|
|
|
|
|
|
|
cy.restoreLocalStorage(); |
|
|
|
|
|
|
|
cy.wait(500); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// generate view link multiple times
|
|
|
|
// generate view link multiple times
|
|
|
|
generateViewLink("combined"); |
|
|
|
generateViewLink("combined"); |
|
|
|
generateViewLink("combined"); |
|
|
|
generateViewLink("combined"); |
|
|
@ -364,11 +345,6 @@ export const genTest = (apiType, dbType) => { |
|
|
|
loginPage.loginAndOpenProject(apiType, dbType); |
|
|
|
loginPage.loginAndOpenProject(apiType, dbType); |
|
|
|
cy.openTableTab("Address", 25); |
|
|
|
cy.openTableTab("Address", 25); |
|
|
|
|
|
|
|
|
|
|
|
mainPage.toggleRightSidebar(); |
|
|
|
|
|
|
|
cy.wait(500); |
|
|
|
|
|
|
|
cy.saveLocalStorage(); |
|
|
|
|
|
|
|
cy.wait(500); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// number of view entries should be 2 before we delete
|
|
|
|
// number of view entries should be 2 before we delete
|
|
|
|
cy.get(".nc-view-item").its("length").should("eq", 2); |
|
|
|
cy.get(".nc-view-item").its("length").should("eq", 2); |
|
|
|
|
|
|
|
|
|
|
@ -387,9 +363,7 @@ export const genTest = (apiType, dbType) => { |
|
|
|
|
|
|
|
|
|
|
|
describe(`${apiType.toUpperCase()} api - Grid view/ row-column update verification`, () => { |
|
|
|
describe(`${apiType.toUpperCase()} api - Grid view/ row-column update verification`, () => { |
|
|
|
before(() => { |
|
|
|
before(() => { |
|
|
|
|
|
|
|
|
|
|
|
cy.restoreLocalStorage(); |
|
|
|
cy.restoreLocalStorage(); |
|
|
|
cy.wait(500); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Address table has belongs to, has many & many-to-many
|
|
|
|
// Address table has belongs to, has many & many-to-many
|
|
|
|
cy.openTableTab("Country", 25); |
|
|
|
cy.openTableTab("Country", 25); |
|
|
@ -401,47 +375,21 @@ export const genTest = (apiType, dbType) => { |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
after(() => { |
|
|
|
beforeEach(() => { |
|
|
|
// close table
|
|
|
|
cy.restoreLocalStorage(); |
|
|
|
// cy.visit(storedURL, {
|
|
|
|
}); |
|
|
|
// baseUrl: null,
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
// cy.wait(5000);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
loginPage.loginAndOpenProject(apiType, dbType); |
|
|
|
afterEach(() => { |
|
|
|
cy.openTableTab("Country", 25) |
|
|
|
|
|
|
|
cy.wait(500); |
|
|
|
|
|
|
|
mainPage.toggleRightSidebar(); |
|
|
|
|
|
|
|
cy.wait(500); |
|
|
|
|
|
|
|
cy.saveLocalStorage(); |
|
|
|
cy.saveLocalStorage(); |
|
|
|
cy.wait(500); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// delete row
|
|
|
|
|
|
|
|
mainPage.getPagination(5).click(); |
|
|
|
|
|
|
|
// kludge: flicker on load
|
|
|
|
|
|
|
|
cy.wait(3000) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// wait for page rendering to complete
|
|
|
|
|
|
|
|
cy.get(".nc-grid-row").should("have.length", 10); |
|
|
|
|
|
|
|
mainPage.getCell("Country", 10).rightclick(); |
|
|
|
|
|
|
|
cy.getActiveMenu(".nc-dropdown-grid-context-menu") |
|
|
|
|
|
|
|
.find('.ant-dropdown-menu-item:contains("Delete Row")') |
|
|
|
|
|
|
|
.first() |
|
|
|
|
|
|
|
.click(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// delete column
|
|
|
|
|
|
|
|
mainPage.deleteColumn("dummy"); |
|
|
|
|
|
|
|
mainPage.deleteCreatedViews(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// close table
|
|
|
|
after(() => { |
|
|
|
|
|
|
|
cy.restoreLocalStorage(); |
|
|
|
cy.closeTableTab("Country"); |
|
|
|
cy.closeTableTab("Country"); |
|
|
|
|
|
|
|
cy.saveLocalStorage(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
it(`Generate default Shared GRID view URL`, () => { |
|
|
|
it(`Generate default Shared GRID view URL`, () => { |
|
|
|
|
|
|
|
|
|
|
|
cy.restoreLocalStorage(); |
|
|
|
|
|
|
|
cy.wait(500); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// add row
|
|
|
|
// add row
|
|
|
|
cy.get(".nc-add-new-row-btn").click(); |
|
|
|
cy.get(".nc-add-new-row-btn").click(); |
|
|
|
cy.get(".nc-expand-col-Country").find(".nc-cell > input") |
|
|
|
cy.get(".nc-expand-col-Country").find(".nc-cell > input") |
|
|
@ -488,6 +436,28 @@ export const genTest = (apiType, dbType) => { |
|
|
|
// verify column headers
|
|
|
|
// verify column headers
|
|
|
|
cy.get('[data-title="dummy"]').should("exist"); |
|
|
|
cy.get('[data-title="dummy"]').should("exist"); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it(`Clean up`, () => { |
|
|
|
|
|
|
|
loginPage.loginAndOpenProject(apiType, dbType); |
|
|
|
|
|
|
|
cy.openTableTab("Country", 25) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// delete row
|
|
|
|
|
|
|
|
mainPage.getPagination(5).click(); |
|
|
|
|
|
|
|
// kludge: flicker on load
|
|
|
|
|
|
|
|
cy.wait(3000) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// wait for page rendering to complete
|
|
|
|
|
|
|
|
cy.get(".nc-grid-row").should("have.length", 10); |
|
|
|
|
|
|
|
mainPage.getCell("Country", 10).rightclick(); |
|
|
|
|
|
|
|
cy.getActiveMenu(".nc-dropdown-grid-context-menu") |
|
|
|
|
|
|
|
.find('.ant-dropdown-menu-item:contains("Delete Row")') |
|
|
|
|
|
|
|
.first() |
|
|
|
|
|
|
|
.click(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// delete column
|
|
|
|
|
|
|
|
mainPage.deleteColumn("dummy"); |
|
|
|
|
|
|
|
mainPage.deleteCreatedViews(); |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|