abramenal / cypress-file-upload

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

[ERROR FILE VIDEO] #322

Closed edgarbarcenas closed 2 years ago

edgarbarcenas commented 2 years ago

Current behavior:

Problem encoding a video

Desired behavior:

When uploading a video from an input file it does not encode it

Versions

"cypress": "^8.2.0",
"cypress-file-upload": "^5.0.8"
edgarbarcenas commented 2 years ago

I solved the problem by editing the plugin directly on line: 174 at the end of the object's plugin object MP4: 'mp4' -at line: 281 of the bundle.js file Add below [FILE_EXTENSION.MP3]: ENCODING.BINARY

-add the following line of code inside the object EXTENSION_TO_ENCODING [FILE_EXTENSION.MP4]: ENCODING.BINARY

With that the plugin encoded mp4 files

abramenal commented 2 years ago

@edgarbarcenas please note that once you do npm install these changes will be overwritten. There is an API exposed for that matters:

el.attachFile({/* other params you need */, encoding: 'binary' });