X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/0fab1ce0739811ff8bc02488d32aa2ad184c7b1e..d8f669aadc5f3d7241395abd6aa764406079d7d3:/cypress/integration/collection.spec.js diff --git a/cypress/integration/collection.spec.js b/cypress/integration/collection.spec.js index fb126af6..31337e28 100644 --- a/cypress/integration/collection.spec.js +++ b/cypress/integration/collection.spec.js @@ -770,4 +770,70 @@ describe('Collection panel tests', function () { .contains(adminUser.user.uuid); }); }); + + describe('file upload', () => { + it('allows to cancel running upload', () => { + cy.createCollection(adminUser.token, { + name: `Test collection ${Math.floor(Math.random() * 999999)}`, + owner_uuid: activeUser.user.uuid, + manifest_text: ". 37b51d194a7513e45b56f6524f2d51f2+3 0:3:bar\n" + }) + .as('testCollection1'); + + cy.getAll('@testCollection1') + .then(function([testCollection1]) { + cy.loginAs(activeUser); + + cy.goToPath(`/collections/${testCollection1.uuid}`); + + cy.get('[data-cy=upload-button]').click(); + + cy.fixture('files/5mb.bin', 'base64').then(content => { + cy.get('[data-cy=drag-and-drop]').upload(content, '5mb_a.bin'); + cy.get('[data-cy=drag-and-drop]').upload(content, '5mb_b.bin'); + + cy.wait(1000); + + cy.get('[data-cy=form-submit-btn]').click(); + + cy.wait(10); + + cy.get('button').contains('Cancel').click(); + + cy.get('[data-cy=form-submit-btn]').should('not.exist'); + }); + }); + }); + + it('allows to cancel single file from the running upload', () => { + cy.createCollection(adminUser.token, { + name: `Test collection ${Math.floor(Math.random() * 999999)}`, + owner_uuid: activeUser.user.uuid, + manifest_text: ". 37b51d194a7513e45b56f6524f2d51f2+3 0:3:bar\n" + }) + .as('testCollection1'); + + cy.getAll('@testCollection1') + .then(function([testCollection1]) { + cy.loginAs(activeUser); + + cy.goToPath(`/collections/${testCollection1.uuid}`); + + cy.get('[data-cy=upload-button]').click(); + + cy.fixture('files/5mb.bin', 'base64').then(content => { + cy.get('[data-cy=drag-and-drop]').upload(content, '5mb_a.bin'); + cy.get('[data-cy=drag-and-drop]').upload(content, '5mb_b.bin'); + + cy.wait(1000); + + cy.get('[data-cy=form-submit-btn]').click(); + + cy.wait(10); + + cy.get('button[aria-label=Remove]').eq(1).click(); + }); + }); + }); + }); })