|
|
@ -19,9 +19,18 @@ export const genTest = (type, xcdb) => { |
|
|
|
|
|
|
|
|
|
|
|
const addUser = (user) => { |
|
|
|
const addUser = (user) => { |
|
|
|
it(`RoleType: ${user.name}`, () => { |
|
|
|
it(`RoleType: ${user.name}`, () => { |
|
|
|
//let cred = { username: 'user4@nocodb.com', password: 'Password123.' }
|
|
|
|
// for first project, users need to be added explicitly using "New User" button
|
|
|
|
//mainPage.addNewUserToProject(cred, user.name)
|
|
|
|
// for subsequent projects, they will be required to just add to this project
|
|
|
|
mainPage.addNewUserToProject(user.credentials, user.name) |
|
|
|
// using ROW count to identify if its former or latter scenario
|
|
|
|
|
|
|
|
// 5 users (owner, creator, editor, viewer, commenter) + row header = 6
|
|
|
|
|
|
|
|
cy.get(`tr`).then((obj) => { |
|
|
|
|
|
|
|
cy.log(obj.length) |
|
|
|
|
|
|
|
if (obj.length == 6) { |
|
|
|
|
|
|
|
mainPage.addExistingUserToProject(user.credentials.username, user.name) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
mainPage.addNewUserToProject(user.credentials, user.name) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -30,9 +39,9 @@ export const genTest = (type, xcdb) => { |
|
|
|
addUser(roles.commenter) |
|
|
|
addUser(roles.commenter) |
|
|
|
addUser(roles.viewer)
|
|
|
|
addUser(roles.viewer)
|
|
|
|
|
|
|
|
|
|
|
|
it(`Logging purpose`, () => { |
|
|
|
// it(`Logging purpose`, () => {
|
|
|
|
cy.log(mainPage.roleURL) |
|
|
|
// cy.log(mainPage.roleURL)
|
|
|
|
}) |
|
|
|
// })
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
const roleValidation = (roleType) => { |
|
|
|
const roleValidation = (roleType) => { |
|
|
|