mirror of
https://github.com/nocodb/nocodb.git
synced 2026-04-25 04:35:09 +00:00
test: role validation
Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com>
This commit is contained in:
committed by
Muhammed Mustafa
parent
8df41a6296
commit
02676f597a
@@ -16,7 +16,7 @@ let roleDb = [
|
||||
];
|
||||
|
||||
async function roleSignup(roleIdx: number, db: any) {
|
||||
console.log(roleDb[roleIdx].url);
|
||||
let projIdx = process.env.TEST_PARALLEL_INDEX;
|
||||
await db.signOut();
|
||||
|
||||
await db.rootPage.goto(roleDb[roleIdx].url);
|
||||
@@ -25,7 +25,7 @@ async function roleSignup(roleIdx: number, db: any) {
|
||||
password: "Password123.",
|
||||
});
|
||||
|
||||
await db.openProject({ title: "externalREST0" });
|
||||
await db.openProject({ title: `externalREST${projIdx}` });
|
||||
|
||||
// close 'Team & Auth' tab
|
||||
if (roleDb[roleIdx].role === "creator") {
|
||||
@@ -74,6 +74,12 @@ test.describe("User roles", () => {
|
||||
await settings.acl.toggle({ table: "CustomerList", role: "viewer" });
|
||||
await settings.acl.save();
|
||||
await settings.close();
|
||||
|
||||
// Role test
|
||||
for (let i = 0; i < roleDb.length; i++) {
|
||||
console.log("Role: ", roleDb[i].role);
|
||||
await roleTest(i, dashboard);
|
||||
}
|
||||
});
|
||||
|
||||
async function roleTest(roleIdx: number, db: any) {
|
||||
@@ -115,10 +121,4 @@ test.describe("User roles", () => {
|
||||
exists: roleDb[roleIdx].role === "creator" ? true : false,
|
||||
});
|
||||
}
|
||||
|
||||
test("Role Test", async () => {
|
||||
for (let i = 0; i < roleDb.length; i++) {
|
||||
await roleTest(i, dashboard);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user