cypress-io / cypress

Fast, easy and reliable testing for anything that runs in a browser.
https://cypress.io
MIT License
46.43k stars 3.14k forks source link

File upload/attaching not working for file size >200MB on Cypress 13 #29668

Open Brestachan opened 3 weeks ago

Brestachan commented 3 weeks ago

Current behavior

In my current test scripts, which were used on Cypress 12 without problems, I have been using and should continue using files over 200MB in size. After updating to 13, Cypress fails to upload them. If I try to upload file of that size, it gets stuck in infinite loop, running indefinitely (18 hours last time, after which I stopped it manually). Additionally, I have tried with >500MB file, which was also being used prior Cypress 13, and in this case, Cypress fails and closes the whole app.

Desired behavior

It should behave like in version 12, and there should be no problems in terms of file size.

Test code to reproduce

    // Upload file Virtual Machine Image
    if (imageName) {
      const virtualMachineImage = imageName
      const fullFileName = 'cypress/fixtures/bin/'.concat(virtualMachineImage)
      cy.get('#iiotUploadFileVmImageInput', { force: true }).selectFile(fullFileName, {
        force: true,
      })
    }

Cypress Version

13.11

Node version

20.14

Operating System

Linux

Debug Logs

No response

Other

No response

jennifer-shehane commented 1 week ago

I can recreate this, just within cypress open within Chrome 126. This passes in v12.17.4 and hangs in 13.0.0.

<html>
<body>
  <label for="avatar">Choose a profile picture:</label>
  <input type="file" id="avatar" name="avatar" />
  <script>
  </script>
</body>
</html>
it('uploads 200MB file', () => {
  cy.visit('index.html')
  cy.get('input[type=file]').selectFile('cypress/fixtures/200MB.bin')
})

12.17.4

Screenshot 2024-06-24 at 12 53 10 PM

13.0.0

Screenshot 2024-06-24 at 12 52 00 PM

jennifer-shehane commented 1 week ago

This bug was introduced in this pull request: https://github.com/cypress-io/cypress/pull/27592