|
|
|
@ -6,6 +6,7 @@
|
|
|
|
|
import { loginPage, projectsPage } from "../../support/page_objects/navigation" |
|
|
|
|
import { mainPage } from "../../support/page_objects/mainPage" |
|
|
|
|
import { roles } from "../../support/page_objects/projectConstants" |
|
|
|
|
import { isTestSuiteActive } from "../../support/page_objects/projectConstants" |
|
|
|
|
|
|
|
|
|
// should we reverify permissions after preview reset?
|
|
|
|
|
const reVerificationAfterReset = false |
|
|
|
@ -13,10 +14,12 @@ const reVerificationAfterReset = false
|
|
|
|
|
// should we verify permissions in owner mode before preview?
|
|
|
|
|
const baseVerificationBeforePreview = false |
|
|
|
|
|
|
|
|
|
const genTest = (type, xcdb) => { |
|
|
|
|
if(!isTestSuiteActive(type, xcdb)) return; |
|
|
|
|
|
|
|
|
|
// project configuration settings
|
|
|
|
|
//
|
|
|
|
|
const advancedSettings = (roleType) => { |
|
|
|
|
// project configuration settings
|
|
|
|
|
//
|
|
|
|
|
const advancedSettings = (roleType) => { |
|
|
|
|
|
|
|
|
|
cy.log(`##### advancedSettings: ${roleType}`) |
|
|
|
|
|
|
|
|
@ -51,13 +54,13 @@ const advancedSettings = (roleType) => {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
cy.get('button:contains("New User")').should(validationString) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Table data related validations
|
|
|
|
|
// - Add/delete/modify row
|
|
|
|
|
//
|
|
|
|
|
const editData = (roleType) => { |
|
|
|
|
// Table data related validations
|
|
|
|
|
// - Add/delete/modify row
|
|
|
|
|
//
|
|
|
|
|
const editData = (roleType) => { |
|
|
|
|
|
|
|
|
|
cy.log(`##### editData: ${roleType}`) |
|
|
|
|
|
|
|
|
@ -119,14 +122,14 @@ const editData = (roleType) => {
|
|
|
|
|
// double click cell entries to edit
|
|
|
|
|
//
|
|
|
|
|
cy.get(`tbody > :nth-child(4) > [data-col="City"]`).dblclick().find('input').should(validationString) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Schema related validations
|
|
|
|
|
// - Add/delete table
|
|
|
|
|
// - Add/Update/delete column
|
|
|
|
|
//
|
|
|
|
|
const editSchema = (roleType) => { |
|
|
|
|
// Schema related validations
|
|
|
|
|
// - Add/delete table
|
|
|
|
|
// - Add/Update/delete column
|
|
|
|
|
//
|
|
|
|
|
const editSchema = (roleType) => { |
|
|
|
|
|
|
|
|
|
cy.log(`##### editSchema: ${roleType}`) |
|
|
|
|
|
|
|
|
@ -150,14 +153,14 @@ const editSchema = (roleType) => {
|
|
|
|
|
//
|
|
|
|
|
cy.get(`th:contains(${columnName}) .mdi-menu-down`).should(validationString) |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// read &/ update comment
|
|
|
|
|
// Viewer: only allowed to read
|
|
|
|
|
// Everyone else: read &/ update
|
|
|
|
|
//
|
|
|
|
|
const editComment = (roleType) => { |
|
|
|
|
// read &/ update comment
|
|
|
|
|
// Viewer: only allowed to read
|
|
|
|
|
// Everyone else: read &/ update
|
|
|
|
|
//
|
|
|
|
|
const editComment = (roleType) => { |
|
|
|
|
|
|
|
|
|
cy.log(`##### editComment: ${roleType}`) |
|
|
|
|
|
|
|
|
@ -189,12 +192,12 @@ const editComment = (roleType) => {
|
|
|
|
|
cy.wait(1000) |
|
|
|
|
cy.getActiveModal().find('button').contains('Cancel').click() |
|
|
|
|
cy.get('body').type('{esc}') |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// right navigation menu bar
|
|
|
|
|
// Editor/Viewer/Commenter : can only view 'existing' views
|
|
|
|
|
// Rest: can create/edit
|
|
|
|
|
const viewMenu = (roleType) => { |
|
|
|
|
// right navigation menu bar
|
|
|
|
|
// Editor/Viewer/Commenter : can only view 'existing' views
|
|
|
|
|
// Rest: can create/edit
|
|
|
|
|
const viewMenu = (roleType) => { |
|
|
|
|
|
|
|
|
|
cy.log(`##### viewMenu: ${roleType}`) |
|
|
|
|
|
|
|
|
@ -226,13 +229,13 @@ const viewMenu = (roleType) => {
|
|
|
|
|
|
|
|
|
|
// cy.get(`.nc-create-grid-view`).should(validationString)
|
|
|
|
|
// cy.get(`.nc-create-gallery-view`).should(validationString)
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////
|
|
|
|
|
//// Test Suite
|
|
|
|
|
///////////////////////////////////////////////////////////
|
|
|
|
|
//// Test Suite
|
|
|
|
|
|
|
|
|
|
describe('Role preview validations', () => { |
|
|
|
|
describe('Role preview validations', () => { |
|
|
|
|
|
|
|
|
|
// Sign in/ open project
|
|
|
|
|
before(() => { |
|
|
|
@ -240,7 +243,7 @@ describe('Role preview validations', () => {
|
|
|
|
|
projectsPage.openProject('externalREST') |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
const genTest = (roleType) => { |
|
|
|
|
const genTestSub = (roleType) => { |
|
|
|
|
|
|
|
|
|
it(`Role type: ${roleType} > Advanced settings validation`, () => { |
|
|
|
|
|
|
|
|
@ -356,12 +359,16 @@ describe('Role preview validations', () => {
|
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
genTest('editor') |
|
|
|
|
genTest('commenter') |
|
|
|
|
genTestSub('editor') |
|
|
|
|
genTestSub('commenter') |
|
|
|
|
|
|
|
|
|
// enable post xcAuditModeCommentsCount fix
|
|
|
|
|
// genTest('viewer')
|
|
|
|
|
}) |
|
|
|
|
// genTestSub('viewer')
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
genTest('rest', false) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|