diff --git a/cypress/integration/vault.spec.js b/cypress/integration/vault.spec.js --- a/cypress/integration/vault.spec.js +++ b/cypress/integration/vault.spec.js @@ -129,8 +129,7 @@ statusCode: 500 }).as('checkVaultCookingTask'); - cy.contains('button', 'Download') - .click(); + checkVaultCookingTask('as tarball'); // Check error alert is displayed cy.get('.alert-danger') @@ -157,6 +156,9 @@ cy.contains('button', 'Download') .click(); + cy.contains('button', 'as tarball') + .click(); + // Create a vault cooking task through the GUI cy.get('.modal-dialog') .contains('button:visible', 'Ok') @@ -229,6 +231,9 @@ cy.contains('button', 'Download') .click(); + cy.contains('button', 'as tarball') + .click(); + cy.window().then(win => { const swhIdsContext = win.swh.webapp.getSwhIdsContext(); const browseDirectoryUrl = swhIdsContext.directory.swhid_with_context_url; @@ -393,6 +398,9 @@ cy.contains('button', 'Download') .click(); + cy.contains('button', 'as tarball') + .click(); + // Create a vault cooking task through the GUI cy.get('.modal-dialog') .contains('button:visible', 'Ok') @@ -421,10 +429,7 @@ }).as('createVaultCookingTask'); // Open vault cook directory modal - cy.contains('button', 'Download') - .click(); - - cy.wait('@checkVaultCookingTask'); + checkVaultCookingTask('as tarball'); // Create a vault cooking task through the GUI and fill email input cy.get('#vault-cook-directory-modal input[type="email"]') @@ -518,6 +523,9 @@ cy.contains('button', 'Download') .click(); + cy.contains('button', 'as tarball') + .click(); + // Start archive download through the GUI cy.get('.modal-dialog') .contains('button:visible', 'Ok') @@ -571,6 +579,9 @@ cy.contains('button', 'Download') .click(); + cy.contains('button', 'as tarball') + .click(); + // Check that recooking the directory is offered to user cy.get('.modal-dialog') .contains('button:visible', 'Ok') diff --git a/swh/web/templates/includes/vault-create-tasks.html b/swh/web/templates/includes/vault-create-tasks.html --- a/swh/web/templates/includes/vault-create-tasks.html +++ b/swh/web/templates/includes/vault-create-tasks.html @@ -8,33 +8,26 @@ {% load swh_templatetags %} {% if vault_cooking %} - {% if user.is_authenticated and user.is_staff or "swh.vault.git_bare.ui" in user.get_all_permissions %} -