X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/e64ff06a99c7a22c367602a5311c0636a0cf7dca..6796b44d4934ddff098e1bfcf7b842ec11e4e210:/cypress/integration/group-manage.spec.js diff --git a/cypress/integration/group-manage.spec.js b/cypress/integration/group-manage.spec.js index 969983080e..c4731bb3c6 100644 --- a/cypress/integration/group-manage.spec.js +++ b/cypress/integration/group-manage.spec.js @@ -70,7 +70,14 @@ describe('Group manage tests', function() { cy.get('[data-cy=invite-people-field] input').type("other"); }); cy.get('[role=tooltip]').click(); - cy.get('.sharing-dialog').contains('Save').click(); + // Add admin to the group + cy.get('.sharing-dialog') + .should('contain', 'Sharing settings') + .within(() => { + cy.get('[data-cy=invite-people-field] input').type("admin"); + }); + cy.get('[role=tooltip]').click(); + cy.get('.sharing-dialog').get('[data-cy=add-invited-people]').click(); cy.get('.sharing-dialog').contains('Close').click(); // Check that both users are present with appropriate permissions @@ -109,6 +116,27 @@ describe('Group manage tests', function() { .within(() => { cy.contains('Write'); }); + + // Change admin to manage + cy.get('[data-cy=group-members-data-explorer]') + .contains(adminUser.user.full_name) + .parents('tr') + .within(() => { + cy.contains('Read') + .parents('td') + .within(() => { + cy.get('button').click(); + }); + }); + cy.get('[data-cy=context-menu]') + .contains('Manage') + .click(); + cy.get('[data-cy=group-members-data-explorer]') + .contains(adminUser.user.full_name) + .parents('tr') + .within(() => { + cy.contains('Manage'); + }); }); it('can unhide and re-hide users', function() { @@ -212,6 +240,7 @@ describe('Group manage tests', function() { }); it('renames the group', function() { + cy.loginAs(adminUser); // Navigate to Groups cy.get('[data-cy=side-panel-tree]').contains('Groups').click(); @@ -254,7 +283,7 @@ describe('Group manage tests', function() { .should('not.contain', groupName + ' (renamed)'); }); - it.only('disables group-related controls for built-in groups', function() { + it('disables group-related controls for built-in groups', function() { cy.loginAs(adminUser); ['All users', 'Anonymous users', 'System group'].forEach((builtInGroup) => { @@ -262,20 +291,20 @@ describe('Group manage tests', function() { cy.get('[data-cy=groups-panel-data-explorer]').contains(builtInGroup).click(); // Check group member actions - // cy.get('[data-cy=group-members-data-explorer]') - // .within(() => { + cy.get('[data-cy=group-members-data-explorer]') + .within(() => { cy.get('[data-cy=group-member-add]').should('not.exist'); cy.get('[data-cy=user-visible-checkbox] input').should('be.disabled'); cy.get('[data-cy=resource-delete-button]').should('be.disabled'); - // cy.get('[data-cy=edit-permission-button]').should('not.exist'); - // }); + cy.get('[data-cy=edit-permission-button]').should('not.exist'); + }); // Check permissions actions cy.get('[data-cy=group-details-permissions-tab]').click(); - // cy.get('[data-cy=group-permissions-data-explorer]').within(() => { + cy.get('[data-cy=group-permissions-data-explorer]').within(() => { cy.get('[data-cy=resource-delete-button]').should('be.disabled'); cy.get('[data-cy=edit-permission-button]').should('not.exist'); - // }); + }); }); });