diff --git a/cypress/support/commands.js b/cypress/support/commands.js index 56c1996a690..1ccd43fd32b 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -61,8 +61,11 @@ Cypress.Commands.add('uploadFile', (fileName, mimeType, target) => { fileName = target } return cy.request('/csrftoken') - .then(({ body }) => body.token) + .then(({ body }) => { + return cy.wrap(body.token) + }) .then(requesttoken => { + cy.wait(1000) return axios.put(`${url}/remote.php/webdav/${fileName}`, file, { headers: { requesttoken,