diff --git a/cypress/support/commands.js b/cypress/support/commands.js index 0c4f46fdfd8..303fada5532 100644 --- a/cypress/support/commands.js +++ b/cypress/support/commands.js @@ -62,17 +62,18 @@ Cypress.Commands.add('uploadFile', (fileName, mimeType, target) => { } cy.request('/csrftoken') .then(({ body }) => { - cy.wait(1000) return cy.wrap(body.token) }) .then(async (requesttoken) => { - const response = await axios.put(`${url}/remote.php/webdav/${fileName}`, file, { + return cy.request({ + url: `${url}/remote.php/webdav/${fileName}`, + method: 'put', + body: file, headers: { requesttoken, 'Content-Type': mimeType, - }, - }) - return cy.wrap(response) + } + }); }).then(response => { const fileId = Number( response.headers['oc-fileid']?.split('oc')?.[0]