X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/c797ff39572137b5552f76f29d39b94c7554b1a0..261201611113224f4a61b3979f6cd9992c4aa6c6:/cypress/integration/project.spec.js diff --git a/cypress/integration/project.spec.js b/cypress/integration/project.spec.js index f369330e..96e73bc1 100644 --- a/cypress/integration/project.spec.js +++ b/cypress/integration/project.spec.js @@ -200,7 +200,10 @@ describe('Project tests', function() { cy.createGroup(activeUser.token, { name: `Test root project ${Math.floor(Math.random() * 999999)}`, group_class: 'project', - }).as('testProject1'); + }).as('testProject1').then((testProject1) => { + + cy.shareWith(adminUser.token, activeUser.user.uuid, testCollection2.uuid, 'can_write'); + }); cy.getAll('@testProject1').then(function([testProject1]) { cy.loginAs(activeUser); @@ -216,29 +219,46 @@ describe('Project tests', function() { }); it('opens advanced popup for project with username', () => { - const projectName = `Test root project ${Math.floor(Math.random() * 999999)}`; - - cy.createProject({ - owningUser: adminUser, - targetUser: activeUser, - projectName, - canWrite: true, - addToFavorites: true - }).as('mySharedProject'); - - cy.getAll('@mySharedProject') - .then(function ([mySharedProject]) { - cy.loginAs(activeUser); + const projectName = `Test project ${Math.floor(Math.random() * 999999)}`; + + cy.createGroup(adminUser.token, { + name: projectName, + group_class: 'project', + }).as('mainProject') + + cy.getAll('@mainProject') + .then(function ([mainProject]) { + cy.loginAs(adminUser); - cy.get('[data-cy=side-panel-tree]').contains('Shared with me').click(); + cy.get('[data-cy=side-panel-tree]').contains('Groups').click(); + + cy.get('[data-cy=uuid]').eq(0).invoke('text').then(uuid => { + cy.createLink(adminUser.token, { + name: 'can_write', + link_class: 'permission', + head_uuid: mainProject.uuid, + tail_uuid: uuid + }); - cy.get('main').contains(projectName).rightclick(); + cy.createLink(adminUser.token, { + name: 'can_write', + link_class: 'permission', + head_uuid: mainProject.uuid, + tail_uuid: activeUser.user.uuid + }); + + cy.get('[data-cy=side-panel-tree]').contains('Projects').click(); + + cy.get('main').contains(projectName).rightclick(); - cy.get('[data-cy=context-menu]').contains('Advanced').click(); + cy.get('[data-cy=context-menu]').contains('Advanced').click(); - cy.get('[role=tablist]').contains('METADATA').click(); + cy.get('[role=tablist]').contains('METADATA').click(); - cy.get('td').contains('User: Active User').should('exist'); + cy.get('td').contains(uuid).should('exist'); + + cy.get('td').contains('Active User').should('exist'); + }); }); }); }); \ No newline at end of file