-
-
Notifications
You must be signed in to change notification settings - Fork 665
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into kris-search-block
* master: (34 commits) Back to development Release 14.0.0-alpha.0 Prepare for release Remove compatibility with older configuration way based on imports (#2516) Locking support (#2594) Back to development Release 13.15.0 Prepare for release feat: add placeholder to wysiwyg widget (#2653) chore(i18n): update ita translations (#2652) Show loading indicator in listing view when content is loading (#2644) Validate touched-only `required` fields in Forms (#2642) Get SchemaWidget field factories from backend (#2651) Change the batch size of folder content (#2654) Show item title and item type when hovering over item title and item type icon in folder content view (#2649) Back to development Release 13.14.0 Prepare for release cypress: user/groups controlpanel tests (#2650) Reimplement the architecture of user/groups controlpanel (#2064) ...
- Loading branch information
Showing
95 changed files
with
3,994 additions
and
1,623 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
export function getIfExists( | ||
selector, | ||
successAction = () => {}, | ||
failAction = () => {}, | ||
) { | ||
cy.get('body').then((body) => { | ||
if (body.find(selector).length > 0 && successAction) { | ||
successAction(); | ||
} else if (failAction) { | ||
failAction(); | ||
} | ||
}); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
describe('Groups Control Panel Test', () => { | ||
beforeEach(() => { | ||
// given a logged in editor | ||
// and a folder that contains a document | ||
// and the folder contents view | ||
cy.visit('/'); | ||
cy.autologin(); | ||
}); | ||
it('Should add a new group to controlPanel', () => { | ||
cy.visit('/controlpanel/groups'); | ||
cy.waitForResourceToLoad('@navigation'); | ||
cy.waitForResourceToLoad('@breadcrumbs'); | ||
cy.waitForResourceToLoad('@actions'); | ||
cy.waitForResourceToLoad('@types'); | ||
cy.waitForResourceToLoad('@groups'); | ||
// when I added a group from controlPanel | ||
cy.get('Button[id="toolbar-add"]').click(); | ||
cy.get('input[id="field-title"]').clear().type('demo-title'); | ||
cy.get('input[id="field-description"]').clear().type('Demo group'); | ||
cy.get('input[id ="field-groupname"]').clear().type('uniquename'); | ||
cy.get('input[id="field-email"]').clear().type('test@gmail.com'); | ||
cy.get('button[title="Save"]').click(-50, -50, { force: true }); | ||
|
||
// then the group section must contains a groupname when I searched the | ||
// same with the same groupname | ||
cy.get('input[id="group-search-input"]').clear().type('uni'); | ||
cy.get('.icon.button:first').click(); | ||
cy.get('tr td').first().should('have.text', 'uniquename'); | ||
}); | ||
|
||
it('Should show error from backend when add Group fails', () => { | ||
cy.intercept('POST', '**groups', { | ||
statusCode: 400, | ||
body: { | ||
message: 'Error from backend.', | ||
}, | ||
}).as('saveGroup'); | ||
cy.visit('/controlpanel/groups'); | ||
// when I added a group from controlPanel | ||
cy.get('Button[id="toolbar-add"]').click(); | ||
cy.get('input[id="field-title"]').clear().type('demo-title'); | ||
cy.get('input[id="field-description"]').clear().type('Demo group'); | ||
cy.get('input[id ="field-groupname"]').clear().type('uniquename'); | ||
cy.get('input[id="field-email"]').clear().type('test@gmail.com'); | ||
cy.get('button[title="Save"]').click(-50, -50, { force: true }); | ||
cy.wait('@saveGroup').then((intercepted) => { | ||
cy.contains(intercepted.response.body.message); | ||
}); | ||
}); | ||
|
||
it('Should delete a group from controlPanel', () => { | ||
cy.visit('/controlpanel/groups'); | ||
cy.waitForResourceToLoad('@navigation'); | ||
cy.waitForResourceToLoad('@breadcrumbs'); | ||
cy.waitForResourceToLoad('@actions'); | ||
cy.waitForResourceToLoad('@types'); | ||
cy.waitForResourceToLoad('@groups'); | ||
|
||
// select first group with name, delete it and search if its exists or not! | ||
cy.get('div[role="listbox"]').first().click(); | ||
cy.get('div[role="option"]').first().click(); | ||
cy.contains('Delete Group'); | ||
cy.get('button.ui.primary.button').should('have.text', 'OK').click(); | ||
cy.get('input[id="group-search-input"]').clear().type('Administrators'); | ||
cy.get('.icon.button:first').click(); | ||
cy.getIfExists('.groupname').should('not.have.text', 'Administrators'); | ||
}); | ||
|
||
it('Should update group roles', () => { | ||
cy.visit('/controlpanel/groups'); | ||
cy.waitForResourceToLoad('@navigation'); | ||
cy.waitForResourceToLoad('@breadcrumbs'); | ||
cy.waitForResourceToLoad('@actions'); | ||
cy.waitForResourceToLoad('@types'); | ||
|
||
cy.get('[data-group="groups"] input[type="checkbox"') | ||
.first() | ||
.check({ force: true }); | ||
cy.get('Button[id="toolbar-save"]').click(); | ||
cy.reload(); | ||
cy.get('[data-group="groups"] div.checkbox') | ||
.first() | ||
.should('have.class', 'checked'); | ||
}); | ||
}); |
Oops, something went wrong.