From 6e807fccb8a400d77b7e39f343f6ce634c40a922 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20Kuty=C5=82a?= Date: Thu, 18 Feb 2021 20:34:25 +0100 Subject: [PATCH] 17306: Fixed tests for collections MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Arvados-DCO-1.1-Signed-off-by: Daniel Kutyła --- cypress/integration/favorites.spec.js | 36 +++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/cypress/integration/favorites.spec.js b/cypress/integration/favorites.spec.js index d6055add..eca35bc4 100644 --- a/cypress/integration/favorites.spec.js +++ b/cypress/integration/favorites.spec.js @@ -143,23 +143,49 @@ describe('Favorites tests', function () { }); it('can copy selected into the collection', () => { - cy.loginAs(activeUser); + cy.loginAs(adminUser); cy.createCollection(adminUser.token, { name: `Test source collection ${Math.floor(Math.random() * 999999)}`, - owner_uuid: activeUser.user.uuid, manifest_text: ". 37b51d194a7513e45b56f6524f2d51f2+3 0:3:bar\n" }) - .as('testSourceCollection'); + .as('testSourceCollection').then(function (testSourceCollection) { + cy.contains('Refresh').click(); + cy.get('main').contains(testSourceCollection.name).rightclick(); + cy.get('[data-cy=context-menu]').within(() => { + cy.contains('Share').click(); + }); + cy.get('[id="select-permissions"]').as('selectPermissions'); + cy.get('@selectPermissions').click(); + cy.contains('Write').click(); + cy.get('.sharing-dialog').as('sharingDialog'); + cy.get('[data-cy=invite-people-field]').find('input').type(activeUser.user.email); + cy.get('[role=tooltip]').click(); + cy.get('@sharingDialog').contains('Save').click(); + }); cy.createCollection(adminUser.token, { name: `Test target collection ${Math.floor(Math.random() * 999999)}`, - owner_uuid: activeUser.user.uuid }) - .as('testTargetCollection'); + .as('testTargetCollection').then(function (testTargetCollection) { + cy.contains('Refresh').click(); + cy.get('main').contains(testTargetCollection.name).rightclick(); + cy.get('[data-cy=context-menu]').within(() => { + cy.contains('Share').click(); + }); + cy.get('[id="select-permissions"]').as('selectPermissions'); + cy.get('@selectPermissions').click(); + cy.contains('Write').click(); + cy.get('.sharing-dialog').as('sharingDialog'); + cy.get('[data-cy=invite-people-field]').find('input').type(activeUser.user.email); + cy.get('[role=tooltip]').click(); + cy.get('@sharingDialog').contains('Save').click(); + }); cy.getAll('@testSourceCollection', '@testTargetCollection') .then(function ([testSourceCollection, testTargetCollection]) { + cy.loginAs(activeUser); + cy.get('.layout-pane-primary') .contains('Projects').click(); -- 2.30.2