Skip to content

Commit

Permalink
Merge branch 'release/2020-11'
Browse files Browse the repository at this point in the history
  • Loading branch information
Enikő Pusztai committed Nov 23, 2020
2 parents ccad788 + 5e2091e commit a0b2b88
Show file tree
Hide file tree
Showing 216 changed files with 8,156 additions and 10,416 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,9 @@ This repository is a monorepo that we manage using [Lerna](https://github.com/le
| [@sensenet/search-react](/packages/sn-search-react) | [![npm](https://img.shields.io/npm/v/@sensenet/search-react.svg?maxAge=3600)](https://www.npmjs.com/package/@sensenet/search-react) |

_This article can also be read in [Brazilian Portuguese](README-pt-BR.md)._

# sensenet as a service (SNaaS) - use sensenet from the cloud

For a monthly subscription fee, we store all your content and data, relieving you of all maintenance-related tasks and installation, ensuring easy onboarding, easy updates, and patches.

https://www.sensenet.com/pricing
6 changes: 6 additions & 0 deletions apps/sensenet/cypress/fixtures/data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"websocket":true,
"origins":["*:*"],
"cookie_needed":false,
"entropy":3320651666
}
60 changes: 60 additions & 0 deletions apps/sensenet/cypress/integration/breadcrumb/breadcrumb.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import { pathWithQueryParams } from '../../../src/services/query-string-builder'

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

describe('Breadcrumb', () => {
before(() => {
cy.login()
cy.visit(pathWithQueryParams({ path: '/', newParams: { repoUrl: Cypress.env('repoUrl') } }))
})
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('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.be.visible')
})
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('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')
})
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ describe('Content types', () => {
beforeEach(() => {
cy.login()
cy.visit(pathWithQueryParams({ path: '/', newParams: { repoUrl: Cypress.env('repoUrl') } }))
.get('[data-test="Content Types"]')
.get('[data-test="drawer-menu-item-content-types"]')
.click()
cy.get('.ReactVirtualized__Table__Grid').scrollTo('bottom')
cy.xpath('//div[text()="Article"]').scrollIntoView({ duration: 500 }).as('articleRow')
Expand All @@ -18,6 +18,6 @@ describe('Content types', () => {
cy.get('@articleRow').dblclick()
cy.get('div').contains('Article').should('be.visible')
cy.get('.monaco-editor').should('be.visible')
cy.get('[data-test="cancel"]').click()
cy.get('[data-test="monaco-editor-cancel"]').click()
})
})
4 changes: 2 additions & 2 deletions apps/sensenet/cypress/integration/dashboard/dashboard.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe('Dashboard', () => {
})

it(`should have title`, () => {
cy.get('[data-test="app-header"]').contains(/Welcome to your [a-z0-9]+ project/)
cy.get('[data-test="app-header"]').contains(/Welcome to your (.)+ project/)
})

it('Subscription section should have the Developer plan text and features list', () => {
Expand All @@ -24,6 +24,6 @@ describe('Dashboard', () => {
it('Current usage section should have correct usage info.', () => {
cy.get('[data-test="usage-users"]').contains(/[0-3] of 3 used/)
cy.get('[data-test="usage-contents"]').contains(/[0-9]|[1-8][0-9]|9[0-9]|[1-4][0-9]{2}|500 of 500 used/)
cy.get('[data-test="usage-storage-space"]').contains(/[0-1] of 1 GB used/)
cy.get('[data-test="usage-storage-space"]').contains(/0.[0-9]*|1 of 1 GB used/)
})
})
Original file line number Diff line number Diff line change
@@ -1,55 +1,55 @@
import { pathWithQueryParams } from '../../../src/services/query-string-builder'

describe('Drawer menu icons', () => {
beforeEach(() => {
before(() => {
cy.login()
cy.visit(pathWithQueryParams({ path: '/', newParams: { repoUrl: Cypress.env('repoUrl') } }))
})

it('clicking on the Search icon on the drawer should open the Search page', () => {
cy.get('[data-test="Search"]').as('searchIcon')
cy.get('[data-test="drawer-menu-item-search"]').as('searchIcon')
cy.get('@searchIcon').should('not.have.class', 'Mui-selected')
cy.get('@searchIcon').click()
cy.get('@searchIcon').should('have.class', 'Mui-selected')
})

it('clicking on the content icon on the drawer should open the Content page', () => {
cy.get('[data-test="Content"]').as('contentIcon')
cy.get('[data-test="drawer-menu-item-content"]').as('contentIcon')
cy.get('@contentIcon').should('not.have.class', 'Mui-selected')
cy.get('@contentIcon').click()
cy.get('@contentIcon').should('have.class', 'Mui-selected')
})

it('clicking on the Users and groups icon on the drawer should open the Users and groups page', () => {
cy.get('[data-test="Users and groups"]').as('UsersAndGroupsIcon')
cy.get('[data-test="drawer-menu-item-users-and-groups"]').as('UsersAndGroupsIcon')
cy.get('@UsersAndGroupsIcon').should('not.have.class', 'Mui-selected')
cy.get('@UsersAndGroupsIcon').click()
cy.get('@UsersAndGroupsIcon').should('have.class', 'Mui-selected')
})

it('clicking on the Trash icon on the drawer should open the Trash page', () => {
cy.get('[data-test="Trash"]').as('trashIcon')
cy.get('[data-test="drawer-menu-item-trash"]').as('trashIcon')
cy.get('@trashIcon').should('not.have.class', 'Mui-selected')
cy.get('@trashIcon').click()
cy.get('@trashIcon').should('have.class', 'Mui-selected')
})

it('clicking on the Content Types icon on the drawer should open the Content Types page', () => {
cy.get('[data-test="Content Types"]').as('contentTypesIcon')
cy.get('[data-test="drawer-menu-item-content-types"]').as('contentTypesIcon')
cy.get('@contentTypesIcon').should('not.have.class', 'Mui-selected')
cy.get('@contentTypesIcon').click()
cy.get('@contentTypesIcon').should('have.class', 'Mui-selected')
})

it('clicking on the Localization icon on the drawer should open the Localization page', () => {
cy.get('[data-test="Localization"]').as('localizationIcon')
cy.get('[data-test="drawer-menu-item-localization"]').as('localizationIcon')
cy.get('@localizationIcon').should('not.have.class', 'Mui-selected')
cy.get('@localizationIcon').click()
cy.get('@localizationIcon').should('have.class', 'Mui-selected')
})

it('clicking on the Setup icon on the drawer should open the Setup page', () => {
cy.get('[data-test="Setup"]').as('setupIcon')
cy.get('[data-test="drawer-menu-item-setup"]').as('setupIcon')
cy.get('@setupIcon').should('not.have.class', 'Mui-selected')
cy.get('@setupIcon').click()
cy.get('@setupIcon').should('have.class', 'Mui-selected')
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import { globals } from '../../../src/globalStyles'
import { pathWithQueryParams } from '../../../src/services/query-string-builder'

describe('Drawer items navigation', () => {
before(() => {
cy.login()
cy.visit(pathWithQueryParams({ path: '/', newParams: { repoUrl: Cypress.env('repoUrl') } }))
})

it('clicking on the search icon on the drawer should navigate to the Saved Queries page', () => {
cy.get('[data-test="drawer-menu-item-search"]').as('searchIcon')
cy.get('@searchIcon').click()
cy.location().should((loc) => {
expect(loc.pathname).to.eq('/saved-queries/')
})
})

it('clicking on the globe icon on the drawer should navigate to the Content page', () => {
cy.get('[data-test="drawer-menu-item-content"]').as('contentIcon')
cy.get('@contentIcon').click()
cy.location().should((loc) => {
expect(loc.pathname).to.eq('/content/explorer/')
})
})

it('clicking on the Users and groups icon on the drawer should navigate to the Users and groups page', () => {
cy.get('[data-test="drawer-menu-item-users-and-groups"]').as('UsersAndGroupsIcon')
cy.get('@UsersAndGroupsIcon').click()
cy.location().should((loc) => {
expect(loc.pathname).to.eq('/users-and-groups/explorer/')
})
})

it('clicking on the Trash icon on the drawer on the drawer should navigate to the Trash page', () => {
cy.get('[data-test="drawer-menu-item-trash"]').as('trashIcon')
cy.get('@trashIcon').click()
cy.location().should((loc) => {
expect(loc.pathname).to.eq('/trash/explorer/')
})
})

it('clicking on the Content Types icon on the drawer should navigate to the Content Types page', () => {
cy.get('[data-test="drawer-menu-item-content-types"]').as('contentTypesIcon')
cy.get('@contentTypesIcon').click()
cy.location().should((loc) => {
expect(loc.pathname).to.eq('/content-types/explorer/')
})
})

it('clicking on the Localization icon on the drawer should navigate to the Localization page', () => {
cy.get('[data-test="drawer-menu-item-localization"]').as('localizationIcon')
cy.get('@localizationIcon').click()
cy.location().should((loc) => {
expect(loc.pathname).to.eq('/localization/explorer/')
})
})

it('clicking on the Setup icon on the drawer should navigate to the Setup page', () => {
cy.get('[data-test="drawer-menu-item-setup"]').as('setupIcon')
cy.get('@setupIcon').click()
cy.location().should((loc) => {
expect(loc.pathname).to.eq('/setup/')
})
})
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { pathWithQueryParams } from '../../../src/services/query-string-builder'

describe('Edit Content', () => {
before(() => {
cy.login()
cy.visit(pathWithQueryParams({ path: '/', newParams: { repoUrl: Cypress.env('repoUrl') } }))
})
it('Test case 1: edit content should work properly.', () => {
cy.get('[data-test="drawer-menu-item-content"]').click()
cy.get('[data-test="menu-item-it-workspace"]')
.rightclick()
.then(() => {
cy.get('[data-test="content-context-menu-edit"]').click()
cy.get('#DisplayName').type(' Test')
cy.contains('Submit').click()
cy.get(`[data-test="table-cell-it-workspace-test"]`).should('have.text', 'IT Workspace Test')
// breadcrumb test
const expectedBreadcrumbItems = ['Content', '/', 'IT Workspace Test']
cy.get('[data-test="drawer-menu-item-content"]').click()
cy.get('[data-test="menu-item-it-workspace-test"]').click()
cy.get('nav[aria-label="breadcrumb"] li').each(($el) => {
expect(expectedBreadcrumbItems).to.include($el.text())
})
})
})
it('Test case 2: edit content should work properly.', () => {
cy.get('[data-test="drawer-menu-item-content"]').click()
cy.get('[data-test="menu-item-it-workspace-test"]')
.rightclick()
.then(() => {
cy.get('[data-test="content-context-menu-edit"]').click()
cy.get('#DisplayName').type('{selectall}IT Workspace')
cy.contains('Submit')
.click()
.then(() => {
const expectedBreadcrumbItems = ['Content', '/', 'IT Workspace']
cy.get('[data-test="drawer-menu-item-content"]').click()
cy.get('[data-test="menu-item-it-workspace"]').click()
cy.get('nav[aria-label="breadcrumb"] li').each(($el) => {
expect(expectedBreadcrumbItems).to.include($el.text())
})
})
})
})
})
36 changes: 36 additions & 0 deletions apps/sensenet/cypress/integration/groups/groups.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { pathWithQueryParams } from '../../../src/services/query-string-builder'

const contextMenuItems = ['browse', 'copyto', 'edit', 'moveto', 'delete']
describe('Groups', () => {
before(() => {
cy.login()
cy.visit(pathWithQueryParams({ path: '/', newParams: { repoUrl: Cypress.env('repoUrl') } }))
})
it('Groups list should have the appropriate data', () => {
const items = ['Administrators', 'Developers', 'Editors']
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')
})
})
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(() => {
contextMenuItems.forEach((item) => {
cy.get(`[data-test="content-context-menu-${item.replace(/\s+/g, '-').toLowerCase()}"]`).should('be.visible')
})
cy.get('body').click()
})
})
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()
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ describe('Localization', () => {
beforeEach(() => {
cy.login()
cy.visit(pathWithQueryParams({ path: '/', newParams: { repoUrl: Cypress.env('repoUrl') } }))
.get('[data-test="Localization"]')
.get('[data-test="drawer-menu-item-localization"]')
.click()
})

Expand All @@ -21,7 +21,7 @@ describe('Localization', () => {
it('should have the correct items in the right click menu', () => {
cy.get('.MuiTableCell-root div').contains('ActionResources.xml').rightclick({ force: true })

const expectedMenuItems = ['Download', 'Browse']
const expectedMenuItems = ['Browse', 'Copy to', 'Edit', 'Move to', 'Check out', 'Download']

cy.get('[role="presentation"] li')
.should('have.length', expectedMenuItems.length)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import { pathWithQueryParams } from '../../../src/services/query-string-builder'

describe('Saved queries', () => {
before(() => {
cy.login()
cy.visit(pathWithQueryParams({ path: '/', newParams: { repoUrl: Cypress.env('repoUrl') } }))
})
it('saving a query should work properly.', () => {
const inputText = "+InFolder:'/Root/Content/IT/Document_Library'"
cy.get('[data-test="drawer-menu-item-search"]').click()
cy.get('a[title="New search"]').click()
cy.get('[data-test="input-search"]').type(inputText)
cy.get('[data-test="table-cell-chicago"]').should('be.visible')
cy.get('[data-test="table-cell-munich"]').should('be.visible')
cy.get('button[aria-label="Save Query"]')
.click()
.then(() => {
cy.get('div[role="dialog"]').find('input[type="text"]').clear().type('test query for IT Doclib')
cy.get('div[role="dialog"]').find('button[aria-label="Save"]').click()
cy.get('[data-test="drawer-menu-item-search"]')
.click()
.then(() => {
cy.get('[data-test="table-cell-test-query-for-it-doclib"]').should('be.visible')
})
cy.get('[data-test="table-cell-test-query-for-it-doclib"]').dblclick()
cy.get('[data-test="input-search"]').find('input[type="text"]').should('have.value', inputText)

cy.get('[data-test="table-cell-chicago"]').should('be.visible')
cy.get('[data-test="table-cell-munich"]').should('be.visible')
})
})
it('delete of a saved query should work properly.', () => {
cy.get('[data-test="drawer-menu-item-search"]').click()
cy.get('[data-test="table-cell-test-query-for-it-doclib"]')
.rightclick()
.then(() => {
cy.get('[data-test="content-context-menu-delete"]')
.click()
.then(() => {
cy.get('[data-test="delete-permanently"]').click()
cy.get('button[aria-label="Delete"]').click()
cy.get('h6').should('have.text', 'There is no query saved yet.')
cy.get('[data-test="table-cell-test-query-for-it-doclib"]').should('not.be.visible')
})
})
})
})
Loading

0 comments on commit a0b2b88

Please sign in to comment.