|
|
|
@ -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,355 +14,361 @@ 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) => { |
|
|
|
|
|
|
|
|
|
cy.log(`##### advancedSettings: ${roleType}`) |
|
|
|
|
|
|
|
|
|
let validationString = (true == roles[roleType].validations.advSettings) ? 'exist' : 'not.exist' |
|
|
|
|
|
|
|
|
|
// restricted mode has only 3 lists & 3 items
|
|
|
|
|
let vListLength = (true == roles[roleType].validations.advSettings) ? 4 : 3 |
|
|
|
|
let vListItemLength = (true == roles[roleType].validations.advSettings) ? 6 : 3 |
|
|
|
|
|
|
|
|
|
cy.get('.nc-nav-drawer').find('.v-list').should('has.length', vListLength) |
|
|
|
|
cy.get('.nc-nav-drawer').find('.v-list > .v-list-item').should('has.length', vListItemLength) |
|
|
|
|
|
|
|
|
|
cy.get('.nc-nav-drawer').find('.v-list > .v-list-item').contains('Audit').should('exist') |
|
|
|
|
cy.get('.nc-nav-drawer').find('.v-list > .v-list-item').contains('App Store').should(validationString) |
|
|
|
|
cy.get('.nc-nav-drawer').find('.v-list > .v-list-item').contains('Team & Auth').should(validationString) |
|
|
|
|
cy.get('.nc-nav-drawer').find('.v-list > .v-list-item').contains('Project Metadata').should(validationString) |
|
|
|
|
|
|
|
|
|
// preview mode- common across all
|
|
|
|
|
cy.get('.nc-nav-drawer').find('.v-list').last().contains('editor').should('exist') |
|
|
|
|
cy.get('.nc-nav-drawer').find('.v-list').last().contains('commenter').should('exist') |
|
|
|
|
cy.get('.nc-nav-drawer').find('.v-list').last().contains('viewer').should('exist') |
|
|
|
|
|
|
|
|
|
// Reset preview option available only in 'preview mode'
|
|
|
|
|
// Open team & auth after reset-preview to ensure 'New User' button is visible again
|
|
|
|
|
// project configuration settings
|
|
|
|
|
//
|
|
|
|
|
if (true == roles[roleType].validations.advSettings) { |
|
|
|
|
cy.get('.nc-nav-drawer').find('.v-list').last().contains('Reset Preview').should('not.exist') |
|
|
|
|
cy.get('.nc-nav-drawer').find('.v-list > .v-list-item').contains('Team & Auth').click() |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
cy.get('.nc-nav-drawer').find('.v-list').last().contains('Reset Preview').should('exist') |
|
|
|
|
} |
|
|
|
|
const advancedSettings = (roleType) => { |
|
|
|
|
|
|
|
|
|
cy.get('button:contains("New User")').should(validationString) |
|
|
|
|
} |
|
|
|
|
cy.log(`##### advancedSettings: ${roleType}`) |
|
|
|
|
|
|
|
|
|
let validationString = (true == roles[roleType].validations.advSettings) ? 'exist' : 'not.exist' |
|
|
|
|
|
|
|
|
|
// Table data related validations
|
|
|
|
|
// - Add/delete/modify row
|
|
|
|
|
//
|
|
|
|
|
const editData = (roleType) => { |
|
|
|
|
// restricted mode has only 3 lists & 3 items
|
|
|
|
|
let vListLength = (true == roles[roleType].validations.advSettings) ? 4 : 3 |
|
|
|
|
let vListItemLength = (true == roles[roleType].validations.advSettings) ? 6 : 3 |
|
|
|
|
|
|
|
|
|
cy.log(`##### editData: ${roleType}`) |
|
|
|
|
cy.get('.nc-nav-drawer').find('.v-list').should('has.length', vListLength) |
|
|
|
|
cy.get('.nc-nav-drawer').find('.v-list > .v-list-item').should('has.length', vListItemLength) |
|
|
|
|
|
|
|
|
|
// TODO: to be fixed for roleType = 'editor'
|
|
|
|
|
// Some of the expected buttons are invisible
|
|
|
|
|
if (roleType == 'editor') |
|
|
|
|
return false |
|
|
|
|
cy.get('.nc-nav-drawer').find('.v-list > .v-list-item').contains('Audit').should('exist') |
|
|
|
|
cy.get('.nc-nav-drawer').find('.v-list > .v-list-item').contains('App Store').should(validationString) |
|
|
|
|
cy.get('.nc-nav-drawer').find('.v-list > .v-list-item').contains('Team & Auth').should(validationString) |
|
|
|
|
cy.get('.nc-nav-drawer').find('.v-list > .v-list-item').contains('Project Metadata').should(validationString) |
|
|
|
|
|
|
|
|
|
// TODO: to be fixed for roleType = 'editor'
|
|
|
|
|
// Unhandled exception
|
|
|
|
|
if (roleType == 'viewer') |
|
|
|
|
return false |
|
|
|
|
// preview mode- common across all
|
|
|
|
|
cy.get('.nc-nav-drawer').find('.v-list').last().contains('editor').should('exist') |
|
|
|
|
cy.get('.nc-nav-drawer').find('.v-list').last().contains('commenter').should('exist') |
|
|
|
|
cy.get('.nc-nav-drawer').find('.v-list').last().contains('viewer').should('exist') |
|
|
|
|
|
|
|
|
|
let columnName = 'City' |
|
|
|
|
let validationString = (true == roles[roleType].validations.editData) ? 'exist' : 'not.exist' |
|
|
|
|
// Reset preview option available only in 'preview mode'
|
|
|
|
|
// Open team & auth after reset-preview to ensure 'New User' button is visible again
|
|
|
|
|
//
|
|
|
|
|
if (true == roles[roleType].validations.advSettings) { |
|
|
|
|
cy.get('.nc-nav-drawer').find('.v-list').last().contains('Reset Preview').should('not.exist') |
|
|
|
|
cy.get('.nc-nav-drawer').find('.v-list > .v-list-item').contains('Team & Auth').click() |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
cy.get('.nc-nav-drawer').find('.v-list').last().contains('Reset Preview').should('exist') |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
cy.get('button:contains("New User")').should(validationString) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
cy.openTableTab(columnName) |
|
|
|
|
|
|
|
|
|
// add new row option (from menu header)
|
|
|
|
|
// Table data related validations
|
|
|
|
|
// - Add/delete/modify row
|
|
|
|
|
//
|
|
|
|
|
cy.get('.nc-add-new-row-btn').should(validationString) |
|
|
|
|
const editData = (roleType) => { |
|
|
|
|
|
|
|
|
|
// update row option (right click)
|
|
|
|
|
//
|
|
|
|
|
cy.log(`##### editData: ${roleType}`) |
|
|
|
|
|
|
|
|
|
// TODO: roleType = viewer has an unhandled exception for rightClick
|
|
|
|
|
if (roleType != 'viewer') { |
|
|
|
|
cy.get(`tbody > :nth-child(4) > [data-col="City"]`).rightclick() |
|
|
|
|
cy.get('.menuable__content__active').should(validationString) |
|
|
|
|
} |
|
|
|
|
// TODO: to be fixed for roleType = 'editor'
|
|
|
|
|
// Some of the expected buttons are invisible
|
|
|
|
|
if (roleType == 'editor') |
|
|
|
|
return false |
|
|
|
|
|
|
|
|
|
if (validationString == 'exist') { |
|
|
|
|
// TODO: to be fixed for roleType = 'editor'
|
|
|
|
|
// Unhandled exception
|
|
|
|
|
if (roleType == 'viewer') |
|
|
|
|
return false |
|
|
|
|
|
|
|
|
|
// right click options will exist (only for 'exist' case)
|
|
|
|
|
//
|
|
|
|
|
cy.getActiveMenu().contains('Insert New Row').should(validationString) |
|
|
|
|
cy.getActiveMenu().contains('Delete Row').should(validationString) |
|
|
|
|
cy.getActiveMenu().contains('Delete Selected Rows').should(validationString) |
|
|
|
|
cy.get('body').type('{esc}') |
|
|
|
|
let columnName = 'City' |
|
|
|
|
let validationString = (true == roles[roleType].validations.editData) ? 'exist' : 'not.exist' |
|
|
|
|
|
|
|
|
|
// update cell contents option using row expander should be enabled
|
|
|
|
|
//
|
|
|
|
|
//cy.get('.nc-row-expand-icon').eq(4).click({ force: true })
|
|
|
|
|
cy.get('.v-input.row-checkbox').eq(4).next().next().click({ force: true }) |
|
|
|
|
cy.getActiveModal().find('button').contains('Save Row').should('exist') |
|
|
|
|
cy.get('body').type('{esc}') |
|
|
|
|
cy.openTableTab(columnName) |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
// update cell contents option using row expander should be disabled
|
|
|
|
|
// add new row option (from menu header)
|
|
|
|
|
//
|
|
|
|
|
//cy.get('.nc-row-expand-icon').eq(4).click({ force: true })
|
|
|
|
|
cy.get('.v-input.row-checkbox').eq(4).next().next().click({ force: true }) |
|
|
|
|
cy.getActiveModal().find('button:disabled').contains('Save Row').should('exist') |
|
|
|
|
cy.getActiveModal().find('button').contains('Cancel').click() |
|
|
|
|
cy.get('body').type('{esc}') |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// double click cell entries to edit
|
|
|
|
|
//
|
|
|
|
|
cy.get(`tbody > :nth-child(4) > [data-col="City"]`).dblclick().find('input').should(validationString) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
cy.get('.nc-add-new-row-btn').should(validationString) |
|
|
|
|
|
|
|
|
|
// Schema related validations
|
|
|
|
|
// - Add/delete table
|
|
|
|
|
// - Add/Update/delete column
|
|
|
|
|
//
|
|
|
|
|
const editSchema = (roleType) => { |
|
|
|
|
// update row option (right click)
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
cy.log(`##### editSchema: ${roleType}`) |
|
|
|
|
// TODO: roleType = viewer has an unhandled exception for rightClick
|
|
|
|
|
if (roleType != 'viewer') { |
|
|
|
|
cy.get(`tbody > :nth-child(4) > [data-col="City"]`).rightclick() |
|
|
|
|
cy.get('.menuable__content__active').should(validationString) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
let columnName = 'City' |
|
|
|
|
let validationString = (true == roles[roleType].validations.editSchema) ? 'exist' : 'not.exist' |
|
|
|
|
if (validationString == 'exist') { |
|
|
|
|
|
|
|
|
|
// create table options
|
|
|
|
|
//
|
|
|
|
|
cy.get('.add-btn').should(validationString) |
|
|
|
|
cy.get('.v-tabs-bar').eq(0).find('button.mdi-plus-box').should(validationString) |
|
|
|
|
// right click options will exist (only for 'exist' case)
|
|
|
|
|
//
|
|
|
|
|
cy.getActiveMenu().contains('Insert New Row').should(validationString) |
|
|
|
|
cy.getActiveMenu().contains('Delete Row').should(validationString) |
|
|
|
|
cy.getActiveMenu().contains('Delete Selected Rows').should(validationString) |
|
|
|
|
cy.get('body').type('{esc}') |
|
|
|
|
|
|
|
|
|
// delete table option
|
|
|
|
|
//
|
|
|
|
|
cy.get('.nc-table-delete-btn').should(validationString) |
|
|
|
|
// update cell contents option using row expander should be enabled
|
|
|
|
|
//
|
|
|
|
|
//cy.get('.nc-row-expand-icon').eq(4).click({ force: true })
|
|
|
|
|
cy.get('.v-input.row-checkbox').eq(4).next().next().click({ force: true }) |
|
|
|
|
cy.getActiveModal().find('button').contains('Save Row').should('exist') |
|
|
|
|
cy.get('body').type('{esc}') |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
// update cell contents option using row expander should be disabled
|
|
|
|
|
//
|
|
|
|
|
//cy.get('.nc-row-expand-icon').eq(4).click({ force: true })
|
|
|
|
|
cy.get('.v-input.row-checkbox').eq(4).next().next().click({ force: true }) |
|
|
|
|
cy.getActiveModal().find('button:disabled').contains('Save Row').should('exist') |
|
|
|
|
cy.getActiveModal().find('button').contains('Cancel').click() |
|
|
|
|
cy.get('body').type('{esc}') |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// double click cell entries to edit
|
|
|
|
|
//
|
|
|
|
|
cy.get(`tbody > :nth-child(4) > [data-col="City"]`).dblclick().find('input').should(validationString) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// add new column option
|
|
|
|
|
//
|
|
|
|
|
cy.get('.new-column-header').should(validationString) |
|
|
|
|
|
|
|
|
|
// update column (edit/ delete menu)
|
|
|
|
|
// Schema related validations
|
|
|
|
|
// - Add/delete table
|
|
|
|
|
// - Add/Update/delete column
|
|
|
|
|
//
|
|
|
|
|
cy.get(`th:contains(${columnName}) .mdi-menu-down`).should(validationString) |
|
|
|
|
const editSchema = (roleType) => { |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
cy.log(`##### editSchema: ${roleType}`) |
|
|
|
|
|
|
|
|
|
let columnName = 'City' |
|
|
|
|
let validationString = (true == roles[roleType].validations.editSchema) ? 'exist' : 'not.exist' |
|
|
|
|
|
|
|
|
|
// read &/ update comment
|
|
|
|
|
// Viewer: only allowed to read
|
|
|
|
|
// Everyone else: read &/ update
|
|
|
|
|
//
|
|
|
|
|
const editComment = (roleType) => { |
|
|
|
|
// create table options
|
|
|
|
|
//
|
|
|
|
|
cy.get('.add-btn').should(validationString) |
|
|
|
|
cy.get('.v-tabs-bar').eq(0).find('button.mdi-plus-box').should(validationString) |
|
|
|
|
|
|
|
|
|
cy.log(`##### editComment: ${roleType}`) |
|
|
|
|
// delete table option
|
|
|
|
|
//
|
|
|
|
|
cy.get('.nc-table-delete-btn').should(validationString) |
|
|
|
|
|
|
|
|
|
// TODO: to be fixed for roleType = 'editor'
|
|
|
|
|
// Unhandled exception
|
|
|
|
|
if (roleType == 'viewer') |
|
|
|
|
return false |
|
|
|
|
// add new column option
|
|
|
|
|
//
|
|
|
|
|
cy.get('.new-column-header').should(validationString) |
|
|
|
|
|
|
|
|
|
// update column (edit/ delete menu)
|
|
|
|
|
//
|
|
|
|
|
cy.get(`th:contains(${columnName}) .mdi-menu-down`).should(validationString) |
|
|
|
|
|
|
|
|
|
let columnName = 'City' |
|
|
|
|
let validationString = (true == roles[roleType].validations.editComment) ? 'Comment added successfully' : 'Not allowed' |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
cy.openTableTab(columnName) |
|
|
|
|
|
|
|
|
|
// click on comment icon & type comment
|
|
|
|
|
// read &/ update comment
|
|
|
|
|
// Viewer: only allowed to read
|
|
|
|
|
// Everyone else: read &/ update
|
|
|
|
|
//
|
|
|
|
|
const editComment = (roleType) => { |
|
|
|
|
|
|
|
|
|
cy.get('.v-input.row-checkbox').eq(4).next().next().click({ force: true }) |
|
|
|
|
//cy.get('.nc-row-expand-icon').eq(4).click({ force: true })
|
|
|
|
|
cy.getActiveModal().find('.mdi-comment-multiple-outline').should('exist').click() |
|
|
|
|
cy.getActiveModal().find('.comment-box').type('Comment-1{enter}') |
|
|
|
|
cy.getActiveModal().find('.mdi-door-open').click() |
|
|
|
|
cy.log(`##### editComment: ${roleType}`) |
|
|
|
|
|
|
|
|
|
// Expected response:
|
|
|
|
|
// Viewer: Not allowed
|
|
|
|
|
// Everyone else: Comment added successfully
|
|
|
|
|
//
|
|
|
|
|
cy.get('body').contains(validationString, { timeout: 2000 }).should('exist') |
|
|
|
|
cy.wait(1000) |
|
|
|
|
cy.getActiveModal().find('button').contains('Cancel').click() |
|
|
|
|
cy.get('body').type('{esc}') |
|
|
|
|
} |
|
|
|
|
// TODO: to be fixed for roleType = 'editor'
|
|
|
|
|
// Unhandled exception
|
|
|
|
|
if (roleType == 'viewer') |
|
|
|
|
return false |
|
|
|
|
|
|
|
|
|
// right navigation menu bar
|
|
|
|
|
// Editor/Viewer/Commenter : can only view 'existing' views
|
|
|
|
|
// Rest: can create/edit
|
|
|
|
|
const viewMenu = (roleType) => { |
|
|
|
|
|
|
|
|
|
cy.log(`##### viewMenu: ${roleType}`) |
|
|
|
|
let columnName = 'City' |
|
|
|
|
let validationString = (true == roles[roleType].validations.editComment) ? 'Comment added successfully' : 'Not allowed' |
|
|
|
|
|
|
|
|
|
// TODO: to be fixed for roleType = 'editor'
|
|
|
|
|
// Unhandled exception
|
|
|
|
|
if (roleType == 'viewer') |
|
|
|
|
return false |
|
|
|
|
cy.openTableTab(columnName) |
|
|
|
|
|
|
|
|
|
let columnName = 'City' |
|
|
|
|
let navDrawListCnt = 2 |
|
|
|
|
let navDrawListItemCnt = 5 |
|
|
|
|
cy.openTableTab(columnName) |
|
|
|
|
let validationString = (true == roles[roleType].validations.shareView) ? 'exist' : 'not.exist' |
|
|
|
|
// click on comment icon & type comment
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
// validate if Share button is visible at header tool bar
|
|
|
|
|
cy.get('header.v-toolbar').eq(0).find('button:contains("Share")').should(validationString) |
|
|
|
|
cy.get('.v-input.row-checkbox').eq(4).next().next().click({ force: true }) |
|
|
|
|
//cy.get('.nc-row-expand-icon').eq(4).click({ force: true })
|
|
|
|
|
cy.getActiveModal().find('.mdi-comment-multiple-outline').should('exist').click() |
|
|
|
|
cy.getActiveModal().find('.comment-box').type('Comment-1{enter}') |
|
|
|
|
cy.getActiveModal().find('.mdi-door-open').click() |
|
|
|
|
|
|
|
|
|
// Owner, Creator will have two navigation drawer (on each side of center panel)
|
|
|
|
|
if (validationString == 'exist') { |
|
|
|
|
navDrawListCnt = 4 |
|
|
|
|
navDrawListItemCnt = 16 |
|
|
|
|
// Expected response:
|
|
|
|
|
// Viewer: Not allowed
|
|
|
|
|
// Everyone else: Comment added successfully
|
|
|
|
|
//
|
|
|
|
|
cy.get('body').contains(validationString, { timeout: 2000 }).should('exist') |
|
|
|
|
cy.wait(1000) |
|
|
|
|
cy.getActiveModal().find('button').contains('Cancel').click() |
|
|
|
|
cy.get('body').type('{esc}') |
|
|
|
|
} |
|
|
|
|
cy.get('.v-navigation-drawer__content').eq(1).find('[role="list"]').should('have.length', navDrawListCnt) |
|
|
|
|
cy.get('.v-navigation-drawer__content').eq(1).find('.v-list-item').should('have.length', navDrawListItemCnt) |
|
|
|
|
|
|
|
|
|
// redundant
|
|
|
|
|
// cy.get('.v-navigation-drawer__content').eq(1).find('.v-list-item').eq(0).contains('Views').should('exist')
|
|
|
|
|
// cy.get('.v-navigation-drawer__content').eq(1).find('.v-list-item').eq(1).contains('City').should('exist')
|
|
|
|
|
|
|
|
|
|
// cy.get(`.nc-create-grid-view`).should(validationString)
|
|
|
|
|
// cy.get(`.nc-create-gallery-view`).should(validationString)
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// right navigation menu bar
|
|
|
|
|
// Editor/Viewer/Commenter : can only view 'existing' views
|
|
|
|
|
// Rest: can create/edit
|
|
|
|
|
const viewMenu = (roleType) => { |
|
|
|
|
|
|
|
|
|
cy.log(`##### viewMenu: ${roleType}`) |
|
|
|
|
|
|
|
|
|
// TODO: to be fixed for roleType = 'editor'
|
|
|
|
|
// Unhandled exception
|
|
|
|
|
if (roleType == 'viewer') |
|
|
|
|
return false |
|
|
|
|
|
|
|
|
|
let columnName = 'City' |
|
|
|
|
let navDrawListCnt = 2 |
|
|
|
|
let navDrawListItemCnt = 5 |
|
|
|
|
cy.openTableTab(columnName) |
|
|
|
|
let validationString = (true == roles[roleType].validations.shareView) ? 'exist' : 'not.exist' |
|
|
|
|
|
|
|
|
|
// validate if Share button is visible at header tool bar
|
|
|
|
|
cy.get('header.v-toolbar').eq(0).find('button:contains("Share")').should(validationString) |
|
|
|
|
|
|
|
|
|
// Owner, Creator will have two navigation drawer (on each side of center panel)
|
|
|
|
|
if (validationString == 'exist') { |
|
|
|
|
navDrawListCnt = 4 |
|
|
|
|
navDrawListItemCnt = 16 |
|
|
|
|
} |
|
|
|
|
cy.get('.v-navigation-drawer__content').eq(1).find('[role="list"]').should('have.length', navDrawListCnt) |
|
|
|
|
cy.get('.v-navigation-drawer__content').eq(1).find('.v-list-item').should('have.length', navDrawListItemCnt) |
|
|
|
|
|
|
|
|
|
// redundant
|
|
|
|
|
// cy.get('.v-navigation-drawer__content').eq(1).find('.v-list-item').eq(0).contains('Views').should('exist')
|
|
|
|
|
// cy.get('.v-navigation-drawer__content').eq(1).find('.v-list-item').eq(1).contains('City').should('exist')
|
|
|
|
|
|
|
|
|
|
// cy.get(`.nc-create-grid-view`).should(validationString)
|
|
|
|
|
// cy.get(`.nc-create-gallery-view`).should(validationString)
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////
|
|
|
|
|
//// Test Suite
|
|
|
|
|
|
|
|
|
|
describe('Role preview validations', () => { |
|
|
|
|
///////////////////////////////////////////////////////////
|
|
|
|
|
//// Test Suite
|
|
|
|
|
|
|
|
|
|
// Sign in/ open project
|
|
|
|
|
before(() => { |
|
|
|
|
loginPage.signIn(roles.owner.credentials) |
|
|
|
|
projectsPage.openProject('externalREST') |
|
|
|
|
}) |
|
|
|
|
describe('Role preview validations', () => { |
|
|
|
|
|
|
|
|
|
const genTest = (roleType) => { |
|
|
|
|
// Sign in/ open project
|
|
|
|
|
before(() => { |
|
|
|
|
loginPage.signIn(roles.owner.credentials) |
|
|
|
|
projectsPage.openProject('externalREST') |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
it(`Role type: ${roleType} > Advanced settings validation`, () => { |
|
|
|
|
const genTestSub = (roleType) => { |
|
|
|
|
|
|
|
|
|
if (true == baseVerificationBeforePreview) |
|
|
|
|
advancedSettings('owner') |
|
|
|
|
it(`Role type: ${roleType} > Advanced settings validation`, () => { |
|
|
|
|
|
|
|
|
|
// click on preview <role> & wait for page to switch over
|
|
|
|
|
mainPage.navigationDraw(mainPage.ROLE_VIEW).contains(roleType).click() |
|
|
|
|
cy.wait(3000) |
|
|
|
|
if (true == baseVerificationBeforePreview) |
|
|
|
|
advancedSettings('owner') |
|
|
|
|
|
|
|
|
|
advancedSettings(roleType) |
|
|
|
|
// click on preview <role> & wait for page to switch over
|
|
|
|
|
mainPage.navigationDraw(mainPage.ROLE_VIEW).contains(roleType).click() |
|
|
|
|
cy.wait(3000) |
|
|
|
|
|
|
|
|
|
// reset preview to rollback to owner/creator mode
|
|
|
|
|
mainPage.navigationDraw(mainPage.ROLE_VIEW).contains('Reset Preview').click() |
|
|
|
|
cy.wait(3000) |
|
|
|
|
advancedSettings(roleType) |
|
|
|
|
|
|
|
|
|
if (reVerificationAfterReset == true) |
|
|
|
|
advancedSettings('owner') |
|
|
|
|
// reset preview to rollback to owner/creator mode
|
|
|
|
|
mainPage.navigationDraw(mainPage.ROLE_VIEW).contains('Reset Preview').click() |
|
|
|
|
cy.wait(3000) |
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
if (reVerificationAfterReset == true) |
|
|
|
|
advancedSettings('owner') |
|
|
|
|
|
|
|
|
|
it(`Role type: ${roleType} > Edit schema validation`, (done) => { |
|
|
|
|
// known issue: to be fixed
|
|
|
|
|
// right click raising alarm 'not allowed' for viewer
|
|
|
|
|
//
|
|
|
|
|
cy.on('uncaught:exception', (err, runnable) => { |
|
|
|
|
expect(err.message).to.include('Not allowed') |
|
|
|
|
done() |
|
|
|
|
return false |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
// open existing table-column
|
|
|
|
|
//
|
|
|
|
|
cy.openTableTab('City') |
|
|
|
|
it(`Role type: ${roleType} > Edit schema validation`, (done) => { |
|
|
|
|
// known issue: to be fixed
|
|
|
|
|
// right click raising alarm 'not allowed' for viewer
|
|
|
|
|
//
|
|
|
|
|
cy.on('uncaught:exception', (err, runnable) => { |
|
|
|
|
expect(err.message).to.include('Not allowed') |
|
|
|
|
done() |
|
|
|
|
return false |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
if (true == baseVerificationBeforePreview) |
|
|
|
|
editSchema('owner') |
|
|
|
|
// open existing table-column
|
|
|
|
|
//
|
|
|
|
|
cy.openTableTab('City') |
|
|
|
|
|
|
|
|
|
// click on preview <role> & wait for page to switch over
|
|
|
|
|
mainPage.navigationDraw(mainPage.ROLE_VIEW).contains(roleType).click() |
|
|
|
|
cy.wait(10000) |
|
|
|
|
if (true == baseVerificationBeforePreview) |
|
|
|
|
editSchema('owner') |
|
|
|
|
|
|
|
|
|
editSchema(roleType) |
|
|
|
|
// click on preview <role> & wait for page to switch over
|
|
|
|
|
mainPage.navigationDraw(mainPage.ROLE_VIEW).contains(roleType).click() |
|
|
|
|
cy.wait(10000) |
|
|
|
|
|
|
|
|
|
// reset preview to rollback to owner/creator mode
|
|
|
|
|
mainPage.navigationDraw(mainPage.ROLE_VIEW).contains('Reset Preview').click() |
|
|
|
|
cy.wait(10000) |
|
|
|
|
editSchema(roleType) |
|
|
|
|
|
|
|
|
|
if (reVerificationAfterReset == true) |
|
|
|
|
editSchema('owner') |
|
|
|
|
// reset preview to rollback to owner/creator mode
|
|
|
|
|
mainPage.navigationDraw(mainPage.ROLE_VIEW).contains('Reset Preview').click() |
|
|
|
|
cy.wait(10000) |
|
|
|
|
|
|
|
|
|
cy.wait(100).then(() => { |
|
|
|
|
done() |
|
|
|
|
if (reVerificationAfterReset == true) |
|
|
|
|
editSchema('owner') |
|
|
|
|
|
|
|
|
|
cy.wait(100).then(() => { |
|
|
|
|
done() |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
it(`Role type: ${roleType} > Edit data validations`, () => { |
|
|
|
|
it(`Role type: ${roleType} > Edit data validations`, () => { |
|
|
|
|
|
|
|
|
|
if (true == baseVerificationBeforePreview) |
|
|
|
|
editData('owner') |
|
|
|
|
if (true == baseVerificationBeforePreview) |
|
|
|
|
editData('owner') |
|
|
|
|
|
|
|
|
|
// click on preview <role> & wait for page to switch over
|
|
|
|
|
mainPage.navigationDraw(mainPage.ROLE_VIEW).contains(roleType).click() |
|
|
|
|
cy.wait(3000) |
|
|
|
|
// click on preview <role> & wait for page to switch over
|
|
|
|
|
mainPage.navigationDraw(mainPage.ROLE_VIEW).contains(roleType).click() |
|
|
|
|
cy.wait(3000) |
|
|
|
|
|
|
|
|
|
editData(roleType) |
|
|
|
|
editData(roleType) |
|
|
|
|
|
|
|
|
|
// reset preview to rollback to owner/creator mode
|
|
|
|
|
mainPage.navigationDraw(mainPage.ROLE_VIEW).contains('Reset Preview').click() |
|
|
|
|
cy.wait(3000) |
|
|
|
|
// reset preview to rollback to owner/creator mode
|
|
|
|
|
mainPage.navigationDraw(mainPage.ROLE_VIEW).contains('Reset Preview').click() |
|
|
|
|
cy.wait(3000) |
|
|
|
|
|
|
|
|
|
if (reVerificationAfterReset == true) |
|
|
|
|
editData('owner') |
|
|
|
|
}) |
|
|
|
|
if (reVerificationAfterReset == true) |
|
|
|
|
editData('owner') |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it(`Role type: ${roleType} > Edit comment validations`, () => { |
|
|
|
|
it(`Role type: ${roleType} > Edit comment validations`, () => { |
|
|
|
|
|
|
|
|
|
if (true == baseVerificationBeforePreview) |
|
|
|
|
editComment('owner') |
|
|
|
|
if (true == baseVerificationBeforePreview) |
|
|
|
|
editComment('owner') |
|
|
|
|
|
|
|
|
|
// click on preview <role> & wait for page to switch over
|
|
|
|
|
mainPage.navigationDraw(mainPage.ROLE_VIEW).contains(roleType).click() |
|
|
|
|
cy.wait(3000) |
|
|
|
|
// click on preview <role> & wait for page to switch over
|
|
|
|
|
mainPage.navigationDraw(mainPage.ROLE_VIEW).contains(roleType).click() |
|
|
|
|
cy.wait(3000) |
|
|
|
|
|
|
|
|
|
editComment(roleType) |
|
|
|
|
editComment(roleType) |
|
|
|
|
|
|
|
|
|
// reset preview to rollback to owner/creator mode
|
|
|
|
|
mainPage.navigationDraw(mainPage.ROLE_VIEW).contains('Reset Preview').click() |
|
|
|
|
cy.wait(3000) |
|
|
|
|
// reset preview to rollback to owner/creator mode
|
|
|
|
|
mainPage.navigationDraw(mainPage.ROLE_VIEW).contains('Reset Preview').click() |
|
|
|
|
cy.wait(3000) |
|
|
|
|
|
|
|
|
|
if (reVerificationAfterReset == true) |
|
|
|
|
editComment('owner') |
|
|
|
|
}) |
|
|
|
|
if (reVerificationAfterReset == true) |
|
|
|
|
editComment('owner') |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
it(`Role type: ${roleType} > View menu validations`, () => { |
|
|
|
|
it(`Role type: ${roleType} > View menu validations`, () => { |
|
|
|
|
|
|
|
|
|
if (true == baseVerificationBeforePreview) |
|
|
|
|
viewMenu('owner') |
|
|
|
|
if (true == baseVerificationBeforePreview) |
|
|
|
|
viewMenu('owner') |
|
|
|
|
|
|
|
|
|
// click on preview <role> & wait for page to switch over
|
|
|
|
|
mainPage.navigationDraw(mainPage.ROLE_VIEW).contains(roleType).click() |
|
|
|
|
cy.wait(3000) |
|
|
|
|
// click on preview <role> & wait for page to switch over
|
|
|
|
|
mainPage.navigationDraw(mainPage.ROLE_VIEW).contains(roleType).click() |
|
|
|
|
cy.wait(3000) |
|
|
|
|
|
|
|
|
|
viewMenu(roleType) |
|
|
|
|
viewMenu(roleType) |
|
|
|
|
|
|
|
|
|
// reset preview to rollback to owner/creator mode
|
|
|
|
|
mainPage.navigationDraw(mainPage.ROLE_VIEW).contains('Reset Preview').click() |
|
|
|
|
cy.wait(3000) |
|
|
|
|
// reset preview to rollback to owner/creator mode
|
|
|
|
|
mainPage.navigationDraw(mainPage.ROLE_VIEW).contains('Reset Preview').click() |
|
|
|
|
cy.wait(3000) |
|
|
|
|
|
|
|
|
|
if (reVerificationAfterReset == true) |
|
|
|
|
viewMenu('owner') |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
if (reVerificationAfterReset == true) |
|
|
|
|
viewMenu('owner') |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
genTest('editor') |
|
|
|
|
genTest('commenter') |
|
|
|
|
genTestSub('editor') |
|
|
|
|
genTestSub('commenter') |
|
|
|
|
|
|
|
|
|
// enable post xcAuditModeCommentsCount fix
|
|
|
|
|
// genTestSub('viewer')
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// enable post xcAuditModeCommentsCount fix
|
|
|
|
|
// genTest('viewer')
|
|
|
|
|
}) |
|
|
|
|
genTest('rest', false) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|