|
|
|
@ -66,10 +66,11 @@ export const genTest = (apiType, dbType) => {
|
|
|
|
|
//
|
|
|
|
|
const viewTest = (viewType) => { |
|
|
|
|
it(`Create ${viewType.toUpperCase()} view`, () => { |
|
|
|
|
|
|
|
|
|
// create a normal public view
|
|
|
|
|
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(); |
|
|
|
|
cy.toastWait("View created successfully"); |
|
|
|
|
|
|
|
|
|
// store base URL- to re-visit and delete form view later
|
|
|
|
@ -79,6 +80,7 @@ export const genTest = (apiType, dbType) => {
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
it(`Share ${viewType.toUpperCase()} hide, sort, filter & verify`, () => { |
|
|
|
|
cy.intercept("/api/v1/db/meta/audits/comments/*").as("waitForPageLoad"); |
|
|
|
|
|
|
|
|
|
cy.get(`.nc-view-item.nc-${viewType}-view-item`) |
|
|
|
|
.contains("Grid-1") |
|
|
|
@ -88,10 +90,11 @@ export const genTest = (apiType, dbType) => {
|
|
|
|
|
mainPage.filterField("Address", "is like", "Ab"); |
|
|
|
|
generateViewLink("combined"); |
|
|
|
|
cy.log(viewURL["combined"]); |
|
|
|
|
|
|
|
|
|
cy.wait(["@waitForPageLoad"]); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
it(`Share GRID view : ensure we have only one link even if shared multiple times`, () => { |
|
|
|
|
|
|
|
|
|
// generate view link multiple times
|
|
|
|
|
generateViewLink("combined"); |
|
|
|
|
generateViewLink("combined"); |
|
|
|
@ -109,7 +112,7 @@ export const genTest = (apiType, dbType) => {
|
|
|
|
|
.its("length") |
|
|
|
|
.should("eq", 1) |
|
|
|
|
.then(() => { |
|
|
|
|
cy.get('button.ant-modal-close:visible').click(); |
|
|
|
|
cy.get("button.ant-modal-close:visible").click(); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
cy.signOut(); |
|
|
|
@ -142,14 +145,8 @@ export const genTest = (apiType, dbType) => {
|
|
|
|
|
.getCell("District", 1) |
|
|
|
|
.contains("West Bengali") |
|
|
|
|
.should("exist"); |
|
|
|
|
mainPage |
|
|
|
|
.getCell("District", 2) |
|
|
|
|
.contains("Tutuila") |
|
|
|
|
.should("exist"); |
|
|
|
|
mainPage |
|
|
|
|
.getCell("District", 3) |
|
|
|
|
.contains("Tamil Nadu") |
|
|
|
|
.should("exist"); |
|
|
|
|
mainPage.getCell("District", 2).contains("Tutuila").should("exist"); |
|
|
|
|
mainPage.getCell("District", 3).contains("Tamil Nadu").should("exist"); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
it(`Share ${viewType.toUpperCase()} view : verify download CSV`, () => { |
|
|
|
@ -204,10 +201,7 @@ export const genTest = (apiType, dbType) => {
|
|
|
|
|
mainPage.filterField("District", "is like", "Tamil"); |
|
|
|
|
// wait for page rendering to complete
|
|
|
|
|
cy.get(".nc-grid-row").should("have.length", 2); |
|
|
|
|
mainPage |
|
|
|
|
.getCell("District", 1) |
|
|
|
|
.contains("Tamil") |
|
|
|
|
.should("exist"); |
|
|
|
|
mainPage.getCell("District", 1).contains("Tamil").should("exist"); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
it(`Share ${viewType.toUpperCase()} view : verify download CSV after local filter`, () => { |
|
|
|
@ -349,7 +343,9 @@ export const genTest = (apiType, dbType) => {
|
|
|
|
|
cy.get(".nc-view-item").its("length").should("eq", 2); |
|
|
|
|
|
|
|
|
|
cy.get(".nc-view-delete-icon").eq(0).click({ force: true }); |
|
|
|
|
cy.getActiveModal(".nc-modal-view-delete").find(".ant-btn-dangerous").click(); |
|
|
|
|
cy.getActiveModal(".nc-modal-view-delete") |
|
|
|
|
.find(".ant-btn-dangerous") |
|
|
|
|
.click(); |
|
|
|
|
cy.toastWait("View deleted successfully"); |
|
|
|
|
|
|
|
|
|
// confirm if the number of veiw entries is reduced by 1
|
|
|
|
@ -392,20 +388,15 @@ export const genTest = (apiType, dbType) => {
|
|
|
|
|
it(`Generate default Shared GRID view URL`, () => { |
|
|
|
|
// add row
|
|
|
|
|
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") |
|
|
|
|
.should("exist") |
|
|
|
|
.first() |
|
|
|
|
.clear({ force: true }) |
|
|
|
|
.type("a"); |
|
|
|
|
cy.getActiveDrawer() |
|
|
|
|
.find("button") |
|
|
|
|
.contains("Save row") |
|
|
|
|
.click(); |
|
|
|
|
cy.getActiveDrawer().find("button").contains("Save row").click(); |
|
|
|
|
cy.toastWait("updated successfully"); |
|
|
|
|
cy.getActiveDrawer() |
|
|
|
|
.find("button") |
|
|
|
|
.contains("Cancel") |
|
|
|
|
.click(); |
|
|
|
|
cy.getActiveDrawer().find("button").contains("Cancel").click(); |
|
|
|
|
// add column
|
|
|
|
|
mainPage.addColumn("dummy", "Country"); |
|
|
|
|
|
|
|
|
@ -426,7 +417,9 @@ export const genTest = (apiType, dbType) => {
|
|
|
|
|
it(`Share GRID view : new row visible`, () => { |
|
|
|
|
// verify row
|
|
|
|
|
// cy.get(`.v-pagination > li:contains('5') button`).click();
|
|
|
|
|
cy.get(`.nc-pagination > .ant-pagination-item.ant-pagination-item-5`).click(); |
|
|
|
|
cy.get( |
|
|
|
|
`.nc-pagination > .ant-pagination-item.ant-pagination-item-5` |
|
|
|
|
).click(); |
|
|
|
|
// wait for page rendering to complete
|
|
|
|
|
cy.get(".nc-grid-row").should("have.length", 10); |
|
|
|
|
mainPage.getCell("Country", 10).contains("a").should("exist"); |
|
|
|
@ -439,12 +432,12 @@ export const genTest = (apiType, dbType) => {
|
|
|
|
|
|
|
|
|
|
it(`Clean up`, () => { |
|
|
|
|
loginPage.loginAndOpenProject(apiType, dbType); |
|
|
|
|
cy.openTableTab("Country", 25) |
|
|
|
|
cy.openTableTab("Country", 25); |
|
|
|
|
|
|
|
|
|
// delete row
|
|
|
|
|
mainPage.getPagination(5).click(); |
|
|
|
|
// kludge: flicker on load
|
|
|
|
|
cy.wait(3000) |
|
|
|
|
cy.wait(3000); |
|
|
|
|
|
|
|
|
|
// wait for page rendering to complete
|
|
|
|
|
cy.get(".nc-grid-row").should("have.length", 10); |
|
|
|
|