abramenal / cypress-file-upload

File upload testing made easy
https://npm.im/cypress-file-upload
MIT License
496 stars 89 forks source link

[Bug] I cannot upload large files #273

Open amartinez1558 opened 3 years ago

amartinez1558 commented 3 years ago

Current behavior:

I have a file that's 100MBs in size. It seems that the cy.fixture is trying to load this into memory before attaching to target input. It seems that this plugin doesn't play well with large files. Can you think of any workaround? Thanks!

Desired behavior:

I should be able to upload 100MB to 1GB files without delay.

Steps to reproduce: (app code and test code)

cy.get('#uploadInput') .attachFile('100MB-File');

=> either a timeout issue or the following Invalid string length

image

Versions

Cypress v6.3.0 Cypress File Upload v5.0.2

LoganWlv commented 3 years ago

Having the same issue though the error is slightly different (~500MB .csv file):

image

"@testing-library/cypress": "^7.0.6",
"clipboardy": "^2.3.0",
"cypress": "^7.4.0",
"cypress-cucumber-preprocessor": "^4.1.0",
"cypress-file-upload": "^5.0.7"

The error occurs in Cypress.cy.fixture(filePath, fileEncoding)

Relates to ? https://github.com/cypress-io/cypress/issues/16823

sprotznock85 commented 2 years ago

This is still an issue and has nothing to do with the server side. How can this be down by a workaround? I try it with a one Gb file. This is working well in production but not with cypress. Is it possible to trigger the change event of the input type file?

sprotznock85 commented 2 years ago

Really need a workaround on this bug. Cannot use cypress otherwise. Any help?

adammfrank commented 2 years ago

I also need this.

Wheedman commented 1 year ago

I also stumbled now over this and it would be nice to have a workaround for that

vvip-68 commented 9 months ago

October 2023... Issue still not solved. I need to upload files approx 500 MB... Anybody solved or find workaround?

Ralkage commented 8 months ago

This is likely a Node.js limitation. Node.js serves as the underlying runtime for Cypress and imposes constraints on string sizes to prevent excessive memory consumption. Unfortunately, this limit is not easily adjustable.

To tackle this issue, you might need to consider the following approaches:

Upload Smaller Chunks:

Use an Alternative Method:

My team and I are currently exploring these options, and if we find a workaround for this issue, I will share it here!

Ralkage commented 8 months ago

FYI, we haven't found a workaround for this specific issue yet. A colleague who's assisting us in finding a possible solution came across this StackOverflow post that might shed light on why we're facing challenges when working with large files in Cypress. It's worth noting that this issue doesn't occur on my other colleague's machine, who uses MacOS on his Macbook M1. Our team continues to investigate potential workarounds, but at this moment, we haven't discovered an alternative for handling file uploads of 500 MB or more using Cypress on Windows or Linux machines.