-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into feature/settings
- Loading branch information
Showing
9 changed files
with
252 additions
and
17 deletions.
There are no files selected for viewing
61 changes: 61 additions & 0 deletions
61
apps/sensenet/cypress/integration/content-crud/link-list.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import { PATHS, resolvePathParams } from '../../../src/application-paths' | ||
import { pathWithQueryParams } from '../../../src/services/query-string-builder' | ||
|
||
describe('Link list', () => { | ||
beforeEach(() => { | ||
cy.login() | ||
cy.visit( | ||
pathWithQueryParams({ | ||
path: resolvePathParams({ path: PATHS.content.appPath, params: { browseType: 'explorer' } }), | ||
newParams: { repoUrl: Cypress.env('repoUrl'), path: '/IT' }, | ||
}), | ||
) | ||
}) | ||
|
||
it('should create a content with the link list type', () => { | ||
cy.get('[data-test="add-button"]').should('not.be.disabled').click() | ||
cy.get('[data-test="listitem-link-list"]') | ||
.click() | ||
.then(() => { | ||
cy.get('#DisplayName').type('Test Link List') | ||
cy.contains('Submit').click() | ||
|
||
cy.get(`[data-test="table-cell-test-link-list"]`).should('exist') | ||
}) | ||
cy.get('[data-test="menu-item-test-link-list"]').click({ force: true }) | ||
cy.get('[data-test="add-button"]') | ||
.click() | ||
.then(() => { | ||
const expetcedMenuItems = ['Link'] | ||
cy.get('[data-test="list-items"]') | ||
.children() | ||
.should('have.length', expetcedMenuItems.length) | ||
.each(($span) => { | ||
const text = $span.text() | ||
if (text) { | ||
expect(expetcedMenuItems).to.include(text) | ||
} | ||
}) | ||
}) | ||
}) | ||
|
||
it('should edit the link list', () => { | ||
cy.get('[data-test="table-cell-test-link-list"]').rightclick({ force: true }) | ||
cy.get('[data-test="content-context-menu-edit"]').click() | ||
cy.get('#DisplayName').clear().type('Changed Test Link List') | ||
cy.contains('Submit').click() | ||
|
||
cy.get('[data-test="table-cell-changed-test-link-list').should('exist') | ||
cy.get('[data-test="table-cell-test-link-list"]').should('not.exist') | ||
}) | ||
|
||
it('should delete the link', () => { | ||
cy.get('[data-test="table-cell-changed-test-link-list').rightclick({ force: true }) | ||
cy.get('[data-test="content-context-menu-delete"]').click() | ||
cy.get('[data-test="delete-permanently"] input[type="checkbox"]').check() | ||
|
||
cy.get('[data-test="button-delete-confirm"]').click() | ||
|
||
cy.get('[data-test="table-cell-changed-test-link-list').should('not.exist') | ||
}) | ||
}) |
63 changes: 63 additions & 0 deletions
63
apps/sensenet/cypress/integration/content-crud/memo-list.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import { PATHS, resolvePathParams } from '../../../src/application-paths' | ||
import { pathWithQueryParams } from '../../../src/services/query-string-builder' | ||
|
||
describe('Memo list', () => { | ||
beforeEach(() => { | ||
cy.login() | ||
cy.visit( | ||
pathWithQueryParams({ | ||
path: resolvePathParams({ path: PATHS.content.appPath, params: { browseType: 'explorer' } }), | ||
newParams: { repoUrl: Cypress.env('repoUrl'), path: '/IT' }, | ||
}), | ||
) | ||
}) | ||
|
||
it('should create a content with the memo list type', () => { | ||
cy.get('[data-test="add-button"]').should('not.be.disabled').click() | ||
cy.get('[data-test="listitem-memo-list"]') | ||
.click() | ||
.then(() => { | ||
cy.get('#Name').type('Test Memo List') | ||
cy.get('#DisplayName').type('Test Memo List') | ||
cy.contains('Submit').click() | ||
|
||
cy.get(`[data-test="table-cell-test-memo-list"]`).should('exist') | ||
}) | ||
cy.get('[data-test="menu-item-test-memo-list"]').click({ force: true }) | ||
cy.get('[data-test="add-button"]') | ||
.click() | ||
.then(() => { | ||
const expetcedMenuItems = ['Memo'] | ||
cy.get('[data-test="list-items"]') | ||
.children() | ||
.should('have.length', expetcedMenuItems.length) | ||
.each(($span) => { | ||
const text = $span.text() | ||
if (text) { | ||
expect(expetcedMenuItems).to.include(text) | ||
} | ||
}) | ||
}) | ||
}) | ||
|
||
it('should edit the memo list', () => { | ||
cy.get('[data-test="table-cell-test-memo-list"]').rightclick({ force: true }) | ||
cy.get('[data-test="content-context-menu-edit"]').click() | ||
cy.get('#Name').clear().type('Changed Test Memo List') | ||
cy.get('#DisplayName').clear().type('Changed Test Memo List') | ||
cy.contains('Submit').click() | ||
|
||
cy.get('[data-test="table-cell-changed-test-memo-list').should('exist') | ||
cy.get('[data-test="table-cell-test-memo-list"]').should('not.exist') | ||
}) | ||
|
||
it('should delete the memo', () => { | ||
cy.get('[data-test="table-cell-changed-test-memo-list').rightclick({ force: true }) | ||
cy.get('[data-test="content-context-menu-delete"]').click() | ||
cy.get('[data-test="delete-permanently"] input[type="checkbox"]').check() | ||
|
||
cy.get('[data-test="button-delete-confirm"]').click() | ||
|
||
cy.get('[data-test="table-cell-changed-test-memo-list').should('not.exist') | ||
}) | ||
}) |
27 changes: 27 additions & 0 deletions
27
apps/sensenet/cypress/integration/permission-editor/dialog_buttons.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { pathWithQueryParams } from '../../../src/services/query-string-builder' | ||
|
||
describe('Permission editor dialog buttons', () => { | ||
before(() => { | ||
cy.login() | ||
cy.visit(pathWithQueryParams({ path: '/', newParams: { repoUrl: Cypress.env('repoUrl') } })) | ||
}) | ||
|
||
it('opens the permission editor dialog and clicking on Submit closes it', () => { | ||
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="permission-dialog-title"]').should('have.text', 'Visitors') | ||
cy.get('[data-test="permission-editor-submit"]').click() | ||
cy.get('[data-test="permission-dialog-title"]').should('not.exist') | ||
}) | ||
|
||
it('opens the permission editor dialog and clicking on Cancel closes it', () => { | ||
cy.get('[data-test="permission-inherited-list"]').click() | ||
cy.get('[data-test="inherited-editors"]').click() | ||
cy.get('[data-test="permission-dialog-title"]').should('have.text', 'Editors') | ||
cy.get('[data-test="permission-editor-cancel"]').click() | ||
cy.get('[data-test="permission-dialog-title"]').should('not.exist') | ||
}) | ||
}) |
42 changes: 42 additions & 0 deletions
42
apps/sensenet/cypress/integration/permission-editor/main_page_lists.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { pathWithQueryParams } from '../../../src/services/query-string-builder' | ||
|
||
const inheritedItems = ['Administrators', 'Developers', 'Editors'] | ||
const setOnThisItems = ['Members', 'Owners', 'Visitors'] | ||
describe('Permission editor main page lists', () => { | ||
before(() => { | ||
cy.login() | ||
cy.visit(pathWithQueryParams({ path: '/', newParams: { repoUrl: Cypress.env('repoUrl') } })) | ||
cy.viewport(1340, 890) | ||
}) | ||
|
||
it('appears from the context-menu', () => { | ||
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="permission-view-title-first"]').should('have.text', 'Set permissions for ') | ||
cy.get('[data-test="permission-view-title-second"]').should('have.text', 'IT Workspace') | ||
}) | ||
|
||
it('Inherited from ancestor list has the expected child items', () => { | ||
inheritedItems.forEach((item) => | ||
cy.get(`[data-test="inherited-${item.replace(/\s+/g, '-').toLowerCase()}"]`).should('not.exist'), | ||
) | ||
cy.get('[data-test="permission-inherited-list"]').should('be.visible').click() | ||
|
||
inheritedItems.forEach((item) => | ||
cy.get(`[data-test="inherited-${item.replace(/\s+/g, '-').toLowerCase()}"]`).should('exist'), | ||
) | ||
}) | ||
|
||
it('Set on this content list has the expected child items', () => { | ||
setOnThisItems.forEach((item) => | ||
cy.get(`[data-test="set-on-this-${item.replace(/\s+/g, '-').toLowerCase()}"]`).should('exist'), | ||
) | ||
|
||
cy.get('[data-test="permission-set-on-this-list"]').should('be.visible').click() | ||
|
||
inheritedItems.forEach((item) => | ||
cy.get(`[data-test="set-on-this-${item.replace(/\s+/g, '-').toLowerCase()}"]`).should('not.exist'), | ||
) | ||
}) | ||
}) |
22 changes: 22 additions & 0 deletions
22
apps/sensenet/cypress/integration/permission-editor/public_private_content.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { pathWithQueryParams } from '../../../src/services/query-string-builder' | ||
|
||
describe('Permission editor - public/private content', () => { | ||
before(() => { | ||
cy.login() | ||
cy.visit(pathWithQueryParams({ path: '/', newParams: { repoUrl: Cypress.env('repoUrl') } })) | ||
}) | ||
|
||
it('Make content public should work properly', () => { | ||
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="make-content-public-or-private"]').click() | ||
cy.get('[data-test="set-on-this-visitor"]').should('be.visible') | ||
}) | ||
|
||
it('Make content private should work properly', () => { | ||
cy.get('[data-test="make-content-public-or-private"]').click() | ||
cy.get('[data-test="set-on-this-visitor"]').should('not.exist') | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters