Skip to content

Commit

Permalink
Merge branch 'release/2021-06'
Browse files Browse the repository at this point in the history
  • Loading branch information
pusztaienike committed Jun 14, 2021
2 parents f86c713 + b94b61c commit 702a66a
Show file tree
Hide file tree
Showing 288 changed files with 7,792 additions and 4,177 deletions.
88 changes: 36 additions & 52 deletions apps/sensenet/cypress/integration/breadcrumb/breadcrumb.spec.ts
Original file line number Diff line number Diff line change
@@ -1,60 +1,44 @@
import { PATHS, resolvePathParams } from '../../../src/application-paths'
import { pathWithQueryParams } from '../../../src/services/query-string-builder'

const expectedBreadcrumbItems = ['Content', '/', 'IT Workspace', '/', 'Document library']

describe('Breadcrumb', () => {
before(() => {
describe('breadcrumb', () => {
beforeEach(() => {
cy.login()
cy.visit(pathWithQueryParams({ path: '/', newParams: { repoUrl: Cypress.env('repoUrl') } }))
cy.visit(
pathWithQueryParams({
path: resolvePathParams({ path: PATHS.content.appPath, params: { browseType: 'explorer' } }),
newParams: { repoUrl: Cypress.env('repoUrl'), path: '/IT/Document_Library' },
}),
)
})
it('breadcrumb after navigating to IT Workspace, breadcrumb should be displayed as it should.', () => {
cy.get('[data-test="drawer-menu-item-content"]').click()
cy.get('[data-test="menu-item-it-workspace"]')
.click()
.then(() => {
cy.get('[data-test="table-cell-calendar"]').should('be.visible')
})

cy.get('[data-test="menu-item-document-library"]').click({ force: true })
cy.get('nav[aria-label="breadcrumb"] li')
.should('have.length', expectedBreadcrumbItems.length)
.each(($el) => {
expect(expectedBreadcrumbItems).to.include($el.text())
})

it('should contain the expected items', () => {
const expectedItems = ['Content', 'IT Workspace', 'Document library']

cy.get('[data-test^="breadcrumb-item-"]').should('have.length', expectedItems.length)

cy.get('[data-test^="breadcrumb-item-"]').each(($el, index) => {
expect(expectedItems[index]).to.equal($el.text())
})
})
it('clicking on parent item in the breadcrumb should open the chosen container', () => {
cy.get('[data-test="drawer-menu-item-content"]').click()
cy.get('[data-test="menu-item-it-workspace"]')
.click()
.then(() => {
cy.get('[data-test="table-cell-calendar"]').should('be.visible')
})
cy.get('[data-test="menu-item-document-library"]')
.click({ force: true })
.then(() => {
cy.get('[data-test="table-cell-calendar"]').should('not.exist')
})
cy.get('nav[aria-label="breadcrumb"] li')
.find('button[aria-label="IT Workspace"]')
.click()
.then(() => {
cy.get('[data-test="table-cell-calendar"]').should('be.visible')
})

it('should navigate in the target folder on click', () => {
const documentLibrarySelector = '[data-test="breadcrumb-item-document-library"]'

cy.get(documentLibrarySelector).should('exist')
cy.get('[data-test="breadcrumb-item-it-workspace"]').click()
cy.get('[data-test="breadcrumb-item-it-workspace"]').should('exist')
cy.get(documentLibrarySelector).should('not.exist')

cy.location().should((loc) => {
const query = new URLSearchParams(loc.search)
expect(query.get('path')).to.eq('/IT')
})
})
it('right click on a breadcrumb item should open its actionmenu.', () => {
cy.get('[data-test="drawer-menu-item-content"]').click()
cy.get('[data-test="menu-item-it-workspace"]')
.click()
.then(() => {
cy.get('[data-test="table-cell-calendar"]').should('be.visible')
})
cy.get('[data-test="menu-item-document-library"]').click({ force: true })
cy.get('nav[aria-label="breadcrumb"] li')
.should('have.length', expectedBreadcrumbItems.length)
.find('button[aria-label="IT Workspace"]')
.rightclick()
.then(() => {
cy.get('ul[role="menu"]').should('be.visible')
})

it('right click on a breadcrumb item should open its action menu', () => {
cy.get('[data-test^="content-context-menu-"]').should('not.exist')
cy.get('[data-test="breadcrumb-item-it-workspace"]').rightclick()
cy.get('[data-test^="content-context-menu-"]').should('have.length.of.at.least', 1)
})
})
52 changes: 40 additions & 12 deletions apps/sensenet/cypress/integration/groups/groups.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ describe('Groups', () => {
before(() => {
cy.login()
cy.visit(pathWithQueryParams({ path: '/', newParams: { repoUrl: Cypress.env('repoUrl') } }))
cy.get('[data-test="drawer-menu-item-users-and-groups"]').click()
cy.get('[data-test="groups"]').click()
})
it('Groups list should have the appropriate data', () => {
const items = ['Administrators', 'Developers', 'Editors']
const columns = ['DisplayName', 'Description', 'Members', 'Actions']
cy.get('[data-test="drawer-menu-item-users-and-groups"]').click()
cy.get('[data-test="groups"]').click()

items.forEach((item) => {
cy.get(`[data-test="table-cell-${item.replace(/\s+/g, '-').toLowerCase()}"]`).should('be.visible')
})
Expand All @@ -19,8 +20,6 @@ describe('Groups', () => {
})
})
it('right click on a group should open context-menu', () => {
cy.get('[data-test="drawer-menu-item-users-and-groups"]').click()
cy.get('[data-test="groups"]').click()
cy.get('[data-test="table-cell-editors"]')
.rightclick()
.then(() => {
Expand All @@ -31,8 +30,6 @@ describe('Groups', () => {
})
})
it('Double click on group should open a edit form of the content', () => {
cy.get('[data-test="drawer-menu-item-users-and-groups"]').click()
cy.get('[data-test="groups"]').click()
cy.get('[data-test="table-cell-editors"]').dblclick()
cy.get('[data-test="viewtitle"').should('have.text', 'Edit Editors')
cy.get('[data-test="cancel"]').click()
Expand All @@ -41,9 +38,6 @@ describe('Groups', () => {
it('ensures that creation of a new group is working properly', () => {
const groupName = 'test'

cy.get('[data-test="drawer-menu-item-users-and-groups"]').click()

cy.get('[data-test="groups"]').click()
cy.get('[data-test="add-button"]').should('not.be.disabled').click()

cy.get('[data-test="listitem-group"]')
Expand All @@ -66,9 +60,6 @@ describe('Groups', () => {
url: 'odata.svc/Root/Trash?*',
}).as('getTrashChildren')

cy.get('[data-test="drawer-menu-item-users-and-groups"]').click()

cy.get('[data-test="groups"]').click()
cy.get('[data-test="table-cell-test"]')
.rightclick()
.then(() => {
Expand All @@ -84,4 +75,41 @@ describe('Groups', () => {
})
})
})

it('ensures that we can add a new member to a group', () => {
const expectedSuggestions = ['Developers', 'Developer Dog']

cy.get('[data-test="drawer-menu-item-users-and-groups"]').click()
cy.get('[data-test="groups"]').click()

cy.get('[data-test="administrators-members"]').click()

cy.get('[data-test="reference-input"]').type('deve')

cy.get('[data-test^="suggestion-"] > span.MuiTypography-root')
.should('have.length', 2)
.each(($el) => {
expect(expectedSuggestions).to.include($el.text())
})

cy.get('[data-test="suggestion-developer-dog"]').click()

cy.get('[data-test="reference-item-developer-dog"]').should('not.exist')
cy.get('[data-test="reference-add-button"]').click()
cy.get('[data-test="reference-item-developer-dog"]').should('exist')

cy.get('[data-test="reference-content-list-dialog-close"]').click()
cy.get('[data-test="administrators-members"]').should('have.text', '2 Members')
})

it('ensures that we can remove a member from a group', () => {
cy.get('[data-test="administrators-members"]').click()

cy.get('[data-test="reference-item-developer-dog"]').should('exist')
cy.get('[data-test="reference-item-remove-developer-dog"]').click()
cy.get('[data-test="reference-item-developer-dog"]').should('not.exist')

cy.get('[data-test="reference-content-list-dialog-close"]').click()
cy.get('[data-test="administrators-members"]').should('have.text', '1 Members')
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe('Add new permission entry', () => {
cy.get('[data-test="drawer-menu-item-content"]').click()
cy.get('[data-test="menu-item-it-workspace"]').rightclick()
cy.get('[data-test="content-context-menu-setpermissions"]').click()
cy.get('[data-test="assing-new-permission"]').click()
cy.get('[data-test="assign-new-permission"]').click()
cy.get('[data-test="member-select-dialog"]').should('contain.text', 'New permission entry')

cy.get('[data-test="reference-input"]').type('Developer D')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe('Editing group member in permission editor', () => {
.each(($el) => {
expect(expectedMembersAfterAdditon).to.include($el.children().eq(0).children().eq(1).text())
})
cy.get(`[data-test="business-cat-delete"]`).click()
cy.get(`[data-test="reference-item-remove-business-cat"]`).click()
})

it('contains the appropriate values', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { pathWithQueryParams } from '../../../src/services/query-string-builder'

describe('LocalOnly permission setting', () => {
before(() => {
cy.login()
cy.visit(pathWithQueryParams({ path: '/', newParams: { repoUrl: Cypress.env('repoUrl') } }))
})

it('creates a new permsission entry', () => {
cy.get('[data-test="drawer-menu-item-content"]').click()
cy.get('[data-test="menu-item-it-workspace"]').rightclick()
cy.get('[data-test="content-context-menu-setpermissions"]').click()
cy.get('[data-test="set-on-this-visitors"]').click()
cy.get('[data-test="switcher-see"]').should('be.visible')
cy.get('[data-test="switcher-full-access"]').should('be.visible').click()
cy.get('[data-test="switcher-full-access"]').should('be.visible').click()
cy.get('[data-test="switcher-local-only"]').should('be.visible').click()
cy.get('[data-test="switcher-see"]').should('be.visible').click()
cy.get('[data-test="permission-editor-submit"]').click()
cy.get('[data-test="set-on-this-visitors"]').should('exist')
cy.get('[data-test="set-on-this-visitors-local-only"]').should('exist')
})

it('reverting removes the localonly entry from the list', () => {
cy.get('[data-test="set-on-this-visitors-local-only"]').click()
cy.get('[data-test="switcher-see"]').should('be.visible').click()
cy.get('[data-test="permission-editor-submit"]').click()
cy.get('[data-test="set-on-this-visitors"]').should('exist')
cy.get('[data-test="set-on-this-visitors-local-only"]').should('not.exist')
})
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { pathWithQueryParams } from '../../../src/services/query-string-builder'

const makeContentText = 'Make content public'
const assignNewText = 'Assign new permission'
const makeContentTooltip =
'Clicking this button makes the content and the below sub-tree public for non-authenticated (Visitor) users'

describe('Permission editor main page links', () => {
beforeEach(() => {
cy.login()
cy.visit(pathWithQueryParams({ path: '/', newParams: { repoUrl: Cypress.env('repoUrl') } }))
cy.get('[data-test="drawer-menu-item-content"]').click()
cy.get('[data-test="menu-item-it-workspace"]').rightclick()
cy.get('[data-test="content-context-menu-setpermissions"]').click()
})

it('should display the appropriate buttons', () => {
cy.viewport(1840, 890)
cy.get('[data-test="make-content-public-or-private"]').should('be.visible').should('have.text', makeContentText)
cy.get('[data-test="assign-new-permission"]').should('be.visible').should('have.text', assignNewText)
cy.get('[data-test="make-content-public-or-private"]').trigger('mouseover')
cy.get('[role="tooltip"]').should('have.text', makeContentTooltip)
})

it('should navigate to the permission editor screen of its parent', () => {
cy.get('[data-test="permission-inherited-list"]').click()
cy.get('[data-test="inherited-developers-link"]').click()
cy.get('[data-test="permission-view-title-first"]').should('have.text', 'Set permissions for ')
cy.get('[data-test="permission-view-title-second"]').should('have.text', 'Content')
})
})
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { pathWithQueryParams } from '../../../src/services/query-string-builder'

const expedtedSearchItems = ['Sample workspace', 'Sample link', 'Sample memo', 'Sample task', 'Sample event']
const expedtedSearchItems = ['Sample workspace']

describe('Saved queries', () => {
before(() => {
Expand Down
15 changes: 1 addition & 14 deletions apps/sensenet/cypress/integration/users-and-groups.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ describe('Users menu', () => {
beforeEach(() => {
cy.login()
cy.visit(pathWithQueryParams({ path: '/', newParams: { repoUrl: Cypress.env('repoUrl') } }))
cy.get('[data-test="drawer-menu-item-users-and-groups"]').click()
})

it('ensures that users list has the appropriate data', () => {
cy.get('[data-test="drawer-menu-item-users-and-groups"]').as('UsersAndGroupsIcon')
cy.get('@UsersAndGroupsIcon').click()
cy.get('.ReactVirtualized__Table>.ReactVirtualized__Table__headerRow>.ReactVirtualized__Table__headerColumn').as(
'ColumnHeaders',
)
Expand All @@ -27,9 +26,6 @@ describe('Users menu', () => {
})

it('ensures that right click on a user opens context-menu', () => {
cy.get('[data-test="drawer-menu-item-users-and-groups"]').as('UsersAndGroupsIcon')
cy.get('@UsersAndGroupsIcon').click()

// Checks for users
cy.get('.ReactVirtualized__Table .ReactVirtualized__Table__Grid .ReactVirtualized__Table__row').as('UserRows')

Expand All @@ -48,9 +44,6 @@ describe('Users menu', () => {
})

it('ensures that double click on a user opens an edit form of the content', () => {
cy.get('[data-test="drawer-menu-item-users-and-groups"]').as('UsersAndGroupsIcon')
cy.get('@UsersAndGroupsIcon').click()

// Checks for users
cy.get('.ReactVirtualized__Table .ReactVirtualized__Table__Grid .ReactVirtualized__Table__row').as('UserRows')

Expand All @@ -71,8 +64,6 @@ describe('Users menu', () => {
url: 'odata.svc/Root/Trash?*',
}).as('getTrashChildren')

cy.get('[data-test="drawer-menu-item-users-and-groups"]').click()

cy.get('[data-test="table-cell-developer-dog"]')
.rightclick()
.then(() => {
Expand All @@ -97,8 +88,6 @@ describe('Users menu', () => {
password: 'devdog',
}

cy.get('[data-test="drawer-menu-item-users-and-groups"]').click()

cy.get('[data-test="add-button"]').should('not.be.disabled').click()

cy.get('[data-test="listitem-user"]')
Expand All @@ -122,8 +111,6 @@ describe('Users menu', () => {
})

it('ensures that we can enable a user by clicking on its status checkbox in the User list', () => {
cy.get('[data-test="drawer-menu-item-users-and-groups"]').click()

cy.get(`[data-test="switcher-${'Developer Dog'.replace(/\s+/g, '-').toLowerCase()}`).as('StatusSwitcher')
cy.get('@StatusSwitcher').click()
cy.get('@StatusSwitcher').find('.MuiSwitch-input').first().should('be.checked')
Expand Down
Loading

0 comments on commit 702a66a

Please sign in to comment.