|
|
@ -1,13 +1,49 @@ |
|
|
|
|
|
|
|
|
|
|
|
import { mainPage } from "../../support/page_objects/mainPage" |
|
|
|
import { mainPage } from "../../support/page_objects/mainPage" |
|
|
|
import { projectsPage } from "../../support/page_objects/navigation" |
|
|
|
import { projectsPage } from "../../support/page_objects/navigation" |
|
|
|
|
|
|
|
import { loginPage } from "../../support/page_objects/navigation" |
|
|
|
import { isTestSuiteActive } from "../../support/page_objects/projectConstants" |
|
|
|
import { isTestSuiteActive } from "../../support/page_objects/projectConstants" |
|
|
|
import { _advSettings, _editSchema, _editData, _editComment, _viewMenu, _topRightMenu } from "../spec/roleValidation.spec" |
|
|
|
import { _advSettings, _editSchema, _editData, _editComment, _viewMenu, _topRightMenu } from "../spec/roleValidation.spec" |
|
|
|
|
|
|
|
|
|
|
|
let linkText = '' |
|
|
|
let linkText = '' |
|
|
|
|
|
|
|
|
|
|
|
export const genTest = (type, xcdb) => { |
|
|
|
export const genTest = (type, xcdb) => { |
|
|
|
if(!isTestSuiteActive(type, xcdb)) return; |
|
|
|
if (!isTestSuiteActive(type, xcdb)) return; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const permissionValidation = (roleType) => { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it(`${roleType}: Visit base shared URL`, () => { |
|
|
|
|
|
|
|
cy.log(linkText) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// visit URL & wait for page load to complete
|
|
|
|
|
|
|
|
cy.visit(linkText, { |
|
|
|
|
|
|
|
baseUrl: null |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
projectsPage.waitHomePageLoad() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cy.closeTableTab('Actor') |
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it(`${roleType}: Validate access permissions: advance menu`, () => { |
|
|
|
|
|
|
|
_advSettings(roleType, false) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it(`${roleType}: Validate access permissions: edit schema`, () => { |
|
|
|
|
|
|
|
_editSchema(roleType, false) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it(`${roleType}: Validate access permissions: edit data`, () => { |
|
|
|
|
|
|
|
_editData(roleType, false) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it(`${roleType}: Validate access permissions: edit comments`, () => { |
|
|
|
|
|
|
|
_editComment(roleType, false) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
it(`${roleType}: Validate access permissions: view's menu`, () => { |
|
|
|
|
|
|
|
_viewMenu(roleType, false) |
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
describe(`${type.toUpperCase()} Base VIEW share`, () => { |
|
|
|
describe(`${type.toUpperCase()} Base VIEW share`, () => { |
|
|
|
// before(() => {
|
|
|
|
// before(() => {
|
|
|
@ -64,28 +100,28 @@ style="background: transparent; "></iframe> |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
it(`Visit base shared URL`, () => { |
|
|
|
permissionValidation('viewer') |
|
|
|
cy.log(linkText) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// visit URL & wait for page load to complete
|
|
|
|
|
|
|
|
cy.visit(linkText, { |
|
|
|
|
|
|
|
baseUrl: null |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
projectsPage.waitHomePageLoad() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cy.closeTableTab('Actor') |
|
|
|
it('Update to EDITOR base share link', () => { |
|
|
|
}) |
|
|
|
loginPage.loginAndOpenProject(type) |
|
|
|
|
|
|
|
|
|
|
|
it(`Validate access permissions`, () => { |
|
|
|
// click SHARE
|
|
|
|
let roleType = 'viewer' |
|
|
|
cy.get('.nc-topright-menu') |
|
|
|
|
|
|
|
.find('.nc-menu-share') |
|
|
|
|
|
|
|
.click() |
|
|
|
|
|
|
|
|
|
|
|
_advSettings(roleType, false) |
|
|
|
cy.getActiveModal() |
|
|
|
_editSchema(roleType, false) |
|
|
|
.find('.nc-shared-base-role') |
|
|
|
_editData(roleType, false) |
|
|
|
.click() |
|
|
|
_editComment(roleType, false) |
|
|
|
|
|
|
|
_viewMenu(roleType, false) |
|
|
|
cy.getActiveMenu() |
|
|
|
|
|
|
|
.find('[role="menuitem"]') |
|
|
|
|
|
|
|
.contains('Editor') |
|
|
|
|
|
|
|
.click()
|
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
permissionValidation('editor') |
|
|
|
|
|
|
|
|
|
|
|
it('Generate & verify embed HTML IFrame', { baseUrl: null }, () => { |
|
|
|
it('Generate & verify embed HTML IFrame', { baseUrl: null }, () => { |
|
|
|
// open iFrame html
|
|
|
|
// open iFrame html
|
|
|
|
cy.visit('scripts/cypress/fixtures/sampleFiles/iFrame.html') |
|
|
|
cy.visit('scripts/cypress/fixtures/sampleFiles/iFrame.html') |
|
|
@ -108,7 +144,7 @@ style="background: transparent; "></iframe> |
|
|
|
// validate data (row-1)
|
|
|
|
// validate data (row-1)
|
|
|
|
mainPage.getIFrameCell('FirstName', 1).contains("PENELOPE").should('exist') |
|
|
|
mainPage.getIFrameCell('FirstName', 1).contains("PENELOPE").should('exist') |
|
|
|
mainPage.getIFrameCell('LastName', 1).contains("GUINESS").should('exist') |
|
|
|
mainPage.getIFrameCell('LastName', 1).contains("GUINESS").should('exist') |
|
|
|
}) |
|
|
|
})
|
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|