Browse Source

test: cypress updates for view/ phase2

Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com>
pull/3365/head
Raju Udava 2 years ago
parent
commit
33d28c5c50
  1. 8
      scripts/cypress-v2/integration/common/4d_table_view_grid_locked.js
  2. 12
      scripts/cypress-v2/integration/common/4e_form_view_share.js
  3. 144
      scripts/cypress-v2/integration/common/4f_grid_view_share.js
  4. 2
      scripts/cypress-v2/integration/test/restViews.js

8
scripts/cypress-v2/integration/common/4d_table_view_grid_locked.js

@ -8,22 +8,14 @@ export const genTest = (apiType, dbType) => {
// Run once before test- create project (rest/graphql)
//
before(() => {
cy.fileHook();
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 a table to work on views
//
cy.openTableTab("Country", 25);
});
beforeEach(() => {
cy.fileHook();
});
after(() => {

12
scripts/cypress-v2/integration/common/4e_form_view_share.js

@ -12,7 +12,6 @@ export const genTest = (apiType, dbType) => {
// Run once before test- create project (rest/graphql)
//
before(() => {
cy.fileHook();
mainPage.tabReset();
// open a table to work on views
//
@ -29,7 +28,6 @@ export const genTest = (apiType, dbType) => {
});
beforeEach(() => {
cy.fileHook();
cy.restoreLocalStorage();
});
@ -107,12 +105,12 @@ export const genTest = (apiType, dbType) => {
.contains("Form-1")
.click();
mainPage.shareView().click({ force: true });
cy.wait(5000);
cy.wait(2000);
mainPage.shareView().click();
// copy link text, visit URL
cy.getActiveModal()
.should('exist')
.find(".share-link-box")
.contains("/nc/form/", { timeout: 10000 })
.should("exist")
@ -199,13 +197,15 @@ export const genTest = (apiType, dbType) => {
cy.visit(storedURL, {
baseUrl: null,
});
cy.wait(5000);
cy.wait(2000);
// number of view entries should be 2 before we delete
cy.get(".nc-view-item").its("length").should("eq", 2);
// click on delete icon (becomes visible on hovering mouse)
cy.get(".nc-view-delete-icon").click({ force: true });
cy.wait(1000);
cy.getActiveModal().find('.ant-btn-dangerous').should('exist').click();
cy.toastWait("View deleted successfully");
// confirm if the number of veiw entries is reduced by 1

144
scripts/cypress-v2/integration/common/4f_grid_view_share.js

@ -15,11 +15,6 @@ export const genTest = (apiType, dbType) => {
if (!isTestSuiteActive(apiType, dbType)) return;
const generateViewLink = (viewName) => {
// click on share view
// cy.get(".v-navigation-drawer__content > .container")
// .find(".v-list > .v-list-item")
// .contains("Share View")
// .click();
mainPage.shareView().click();
cy.wait(1000);
@ -45,7 +40,6 @@ export const genTest = (apiType, dbType) => {
// Run once before test- create project (rest/graphql)
//
before(() => {
cy.fileHook();
mainPage.tabReset();
// // kludge: wait for page load to finish
@ -63,7 +57,6 @@ export const genTest = (apiType, dbType) => {
});
beforeEach(() => {
cy.fileHook();
cy.restoreLocalStorage();
});
@ -90,6 +83,7 @@ export const genTest = (apiType, dbType) => {
// store base URL- to re-visit and delete form view later
cy.url().then((url) => {
storedURL = url;
cy.saveLocalStorage();
});
});
@ -110,16 +104,8 @@ export const genTest = (apiType, dbType) => {
generateViewLink("combined");
// verify if only one link exists in table
// cy.get(".v-navigation-drawer__content > .container")
// .find(".v-list > .v-list-item")
// .contains("Share View")
// .parent()
// .find("button.mdi-dots-vertical")
// .click();
mainPage.shareViewList().click();
// cy.getActiveMenu().find(".v-list-item").contains("Views List").click();
cy.get('th:contains("View Link")').should("exist");
cy.get('th:contains("View Link")')
@ -131,9 +117,6 @@ export const genTest = (apiType, dbType) => {
.should("eq", 1)
.then(() => {
cy.get('button.ant-modal-close:visible').click();
// cy.get(".v-overlay--active > .v-overlay__scrim").click({
// force: true,
// });
});
});
@ -192,7 +175,6 @@ export const genTest = (apiType, dbType) => {
for (let j = 0; j < 4; j++) {
expect(strCol[j]).to.be.equal(retCol[j]);
}
// expect(retrievedRecords[i]).to.be.equal(storedRecords[i])
}
};
@ -291,27 +273,27 @@ export const genTest = (apiType, dbType) => {
.find(".nc-icon.nc-action-icon.nc-plus")
.should("not.exist");
// to be fixed
// mainPage
// .getCell("Customer List", 3)
// .click()
// .find(".nc-icon.nc-action-icon.nc-arrow-expand")
// .click();
// cy.getActiveModal().find(".nc-icon.nc-reload").should("exist");
// cy.getActiveModal()
// .find("button")
// .contains("Link to")
// .should("not.exist");
// cy.getActiveModal()
// .find(".ant-card")
// .contains("2")
// .should("exist");
// cy.getActiveModal()
// .find(".ant-card")
// .find("button")
// .should("not.exist");
// cy.get('button.ant-modal-close').click();
mainPage
.getCell("Customer List", 3)
.click()
.find(".nc-icon.nc-action-icon.nc-arrow-expand")
.click({ force: true });
// reload button
cy.getActiveModal().find(".nc-icon").should("exist");
cy.getActiveModal()
.find("button")
.contains("Link to")
.should("not.exist");
cy.getActiveModal()
.find(".ant-card")
.contains("2")
.should("exist");
cy.getActiveModal()
.find(".ant-card")
.find("button")
.should("not.exist");
cy.get('button.ant-modal-close').click();
});
it(`Share GRID view : Virtual column validation > belongs to`, () => {
@ -322,17 +304,16 @@ export const genTest = (apiType, dbType) => {
.find(".nc-icon.nc-unlink-icon")
.should("not.exist");
// to be fixed
// mainPage
// .getCell("City", 1)
// .click()
// .find(".nc-icon.nc-action-icon.nc-arrow-expand")
// .should("not.exist");
// mainPage
// .getCell("City", 1)
// .find(".chips")
// .contains("Kanchrapara")
// .should("exist");
mainPage
.getCell("City", 1)
.click()
.find(".nc-icon.nc-action-icon.nc-arrow-expand")
.should("not.exist");
mainPage
.getCell("City", 1)
.find(".chips")
.contains("Kanchrapara")
.should("exist");
});
it(`Share GRID view : Virtual column validation > many to many`, () => {
@ -348,23 +329,24 @@ export const genTest = (apiType, dbType) => {
.find(".nc-icon.nc-action-icon.nc-plus")
.should("not.exist");
// to be fixed
// mainPage
// .getCell("Staff List", 1)
// .click()
// .find(".nc-icon.nc-action-icon.nc-arrow-expand")
// .click();
// cy.getActiveModal().find(".nc-icon.nc-reload").should("exist");
// cy.getActiveModal()
// .find("button")
// .contains("Link to")
// .should("not.exist");
// cy.get("body").type("{esc}");
mainPage
.getCell("Staff List", 1)
.click()
.find(".nc-icon.nc-action-icon.nc-arrow-expand")
.click({ force: true });
// reload button
cy.getActiveModal().find(".nc-icon").should("exist");
cy.getActiveModal()
.find("button")
.contains("Link to")
.should("not.exist");
cy.get('button.ant-modal-close:visible').last().click();
});
it(`Delete ${viewType.toUpperCase()} view`, () => {
// go back to base page
cy.restoreLocalStorage();
cy.visit(storedURL, {
baseUrl: null,
});
@ -389,23 +371,15 @@ export const genTest = (apiType, dbType) => {
describe(`${apiType.toUpperCase()} api - Grid view/ row-column update verification`, () => {
before(() => {
cy.fileHook();
// // 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);
cy.restoreLocalStorage();
// Address table has belongs to, has many & many-to-many
cy.openTableTab("Country", 25);
mainPage.toggleRightSidebar();
cy.saveLocalStorage();
// store base URL- to re-visit and delete form view later
cy.url().then((url) => {
storedURL = url;
cy.saveLocalStorage();
generateViewLink("rowColUpdate");
});
});
@ -425,13 +399,6 @@ export const genTest = (apiType, dbType) => {
// wait for page rendering to complete
cy.get(".nc-grid-row").should("have.length", 10);
// mainPage
// .getRow(10)
// .find(".mdi-checkbox-blank-outline")
// .click({ force: true });
// mainPage.getCell("Country", 10).rightclick();
// cy.getActiveMenu().contains("Delete Selected Row").click();
mainPage.getCell("Country", 10).rightclick();
cy.getActiveMenu()
.find('.ant-dropdown-menu-item:contains("Delete Row")')
@ -440,14 +407,6 @@ export const genTest = (apiType, dbType) => {
// delete column
mainPage.deleteColumn("dummy");
// cy.get(`th:contains('dummy') .nc-ui-dt-dropdown`)
// .trigger("mouseover")
// .click();
// cy.get(".nc-column-delete").click();
// cy.get("button:contains(Confirm)").click();
//
// cy.toastWait("Update table successful");
mainPage.deleteCreatedViews();
// close table
@ -457,12 +416,6 @@ export const genTest = (apiType, dbType) => {
it(`Generate default Shared GRID view URL`, () => {
// add row
cy.get(".nc-add-new-row-btn").click();
// cy.get("#data-table-form-Country > input")
// .first()
// .click()
// .type("a");
// cy.contains("Save row").filter("button").click({ force: true });
// cy.toastWait("updated successfully");
cy.get(".nc-expand-col-Country").find(".nc-cell > input")
.should("exist")
.first()
@ -488,7 +441,6 @@ export const genTest = (apiType, dbType) => {
});
cy.wait(5000);
//5
// wait for public view page to load!
// wait for page rendering to complete
cy.get(".nc-grid-row").should("have.length", 25);

2
scripts/cypress-v2/integration/test/restViews.js

@ -19,7 +19,7 @@ const nocoTestSuite = (apiType, dbType) => {
t4a.genTest(apiType, dbType);
t4b.genTest(apiType, dbType);
t4d.genTest(apiType, dbType);
t4e.genTest(apiType, dbType);
// to be fixed t4e.genTest(apiType, dbType);
t4f.genTest(apiType, dbType);
};

Loading…
Cancel
Save