X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/4860e74d347552476c77e313c85502787b6d7dfe..8297f0f273e326e64145a48266805b0b3d073c32:/cypress/integration/favorites.spec.js diff --git a/cypress/integration/favorites.spec.js b/cypress/integration/favorites.spec.js index beee7618f6..eca35bc4e0 100644 --- a/cypress/integration/favorites.spec.js +++ b/cypress/integration/favorites.spec.js @@ -128,10 +128,10 @@ describe('Favorites tests', function () { }); cy.get('[data-cy=form-dialog]').within(function () { - cy.get('[data-cy=projects-tree-favourites-tree-pciker]').find('i').click(); + cy.get('[data-cy=projects-tree-favourites-tree-picker]').find('i').click(); cy.contains(myProject1.name); cy.contains(mySharedWritableProject.name); - cy.get('[data-cy=projects-tree-favourites-tree-pciker]') + cy.get('[data-cy=projects-tree-favourites-tree-picker]') .should('not.contain', mySharedReadonlyProject.name); cy.contains(mySharedWritableProject.name).click(); cy.get('[data-cy=form-submit-btn]').click(); @@ -143,20 +143,44 @@ 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]) { @@ -172,16 +196,16 @@ describe('Favorites tests', function () { cy.get('main').contains(testSourceCollection.name).click(); cy.get('[data-cy=collection-files-panel]').contains('bar'); - cy.get('[data-cy=collection-files-panel]').find('input[type=checkbox]').click(); + cy.get('[data-cy=collection-files-panel]').find('input[type=checkbox]').click({ force: true }); cy.get('[data-cy=collection-files-panel-options-btn]').click(); cy.get('[data-cy=context-menu]') .contains('Copy selected into the collection').click(); - cy.get('[data-cy=projects-tree-favourites-tree-pciker]') + cy.get('[data-cy=projects-tree-favourites-tree-picker]') .find('i') .click(); - cy.get('[data-cy=projects-tree-favourites-tree-pciker]') + cy.get('[data-cy=projects-tree-favourites-tree-picker]') .contains(testTargetCollection.name) .click();