Browse Source

test: basic framework

Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com>
pull/3796/head
Raju Udava 2 years ago
parent
commit
9acf42a1dc
  1. 50
      scripts/cypress/integration/common/5a_user_role.js
  2. 2
      scripts/cypress/support/commands.js

50
scripts/cypress/integration/common/5a_user_role.js

@ -174,51 +174,67 @@ export const genTest = (apiType, dbType) => {
///////////////////////////////////////////////////////
// Test suite
it(`[${roles[roleType].name}] Left navigation menu, New User add`, () => {
it.skip(`[${roles[roleType].name}] Left navigation menu, New User add`, () => {
// project configuration settings
//
_advSettings(roleType, "userRole");
if (roleType !== "owner") {
_advSettings(roleType, "userRole");
}
});
it(`[${roles[roleType].name}] Access control`, () => {
it.skip(`[${roles[roleType].name}] Access control`, () => {
// Access control validation
//
_accessControl(roleType, "userRole");
if (roleType !== "owner") {
_accessControl(roleType, "userRole");
}
});
it(`[${roles[roleType].name}] Schema: create table, add/modify/delete column`, () => {
it.skip(`[${roles[roleType].name}] Schema: create table, add/modify/delete column`, () => {
// Schema related validations
// - Add/delete table
// - Add/Update/delete column
//
_editSchema(roleType, "userRole");
if (roleType !== "owner") {
_editSchema(roleType, "userRole");
}
});
it(`[${roles[roleType].name}] Data: add/modify/delete row, update cell contents`, () => {
it.skip(`[${roles[roleType].name}] Data: add/modify/delete row, update cell contents`, () => {
// Table data related validations
// - Add/delete/modify row
//
_editData(roleType, "userRole");
if (roleType !== "owner") {
_editData(roleType, "userRole");
}
});
it(`[${roles[roleType].name}] Comments: view/add`, () => {
it.skip(`[${roles[roleType].name}] Comments: view/add`, () => {
// read &/ update comment
// Viewer: only allowed to read
// Everyone else: read &/ update
//
_editComment(roleType, "userRole");
if (roleType !== "owner") {
_editComment(roleType, "userRole");
}
});
it(`[${roles[roleType].name}] Right navigation menu, share view`, () => {
it.skip(`[${roles[roleType].name}] Right navigation menu, share view`, () => {
// right navigation menu bar
// Editor/Viewer/Commenter : can only view 'existing' views
// Rest: can create/edit
_viewMenu(roleType, "userRole");
if (roleType !== "owner") {
_viewMenu(roleType, "userRole");
}
});
it(`[${roles[roleType].name}] Download files`, () => {
it.skip(`[${roles[roleType].name}] Download files`, () => {
// to be fixed
if (roleType === "commenter" || roleType === "viewer") {
if (
roleType === "commenter" ||
roleType === "viewer" ||
roleType === "owner"
) {
} else {
// viewer & commenter doesn't contain hideField option in ncv2
// #ID, City, LastUpdate, City => Address, Country <= City, +
@ -252,11 +268,15 @@ export const genTest = (apiType, dbType) => {
mainPage.unhideField("LastUpdate");
}
});
it(`[${roles[roleType].name}] App store accessiblility`, () => {
cy.visit("/#/apps");
});
});
};
// skip owner validation as rest of the cases pretty much cover the same
// roleValidation('owner')
roleValidation("owner");
roleValidation("creator");
roleValidation("editor");
roleValidation("commenter");

2
scripts/cypress/support/commands.js

@ -479,7 +479,7 @@ Cypress.Commands.add("signOut", () => {
cy.get(".nc-menu-accounts", { timeout: 30000 }).should("exist").click();
cy.getActiveMenu(".nc-dropdown-user-accounts-menu")
.find(".ant-dropdown-menu-item")
.eq(1)
.last()
.click();
// cy.wait(5000);

Loading…
Cancel
Save