18594: Added multiple tails display, added tests
[arvados-workbench2.git] / cypress / integration / project.spec.js
index f369330e577090011ffc222837fe4ca214a8904a..96e73bc127d197e81aab1d496ae342a59fe30647 100644 (file)
@@ -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