cypress-file-upload icon indicating copy to clipboard operation
cypress-file-upload copied to clipboard

can't upload video file - encoding fail

Open adventmedia opened this issue 5 years ago • 4 comments

I cannot upload a video file with the current version (3.4.0) e2e-test 2019-11-04 09-37-37

The code:

      cy.get('input.uppy-Dashboard-input').upload(
        { fileContent, fileName: 'sample_video.mp4', mimeType: 'video/mp4' },
        { subjectType: 'input' }
      );
    });

Also tried with 'binary' for encoding, same error.

cypress: 3.6.0 cypress-file-upload: 3.4.0 MacOS 10.14.6 Chrome v.78

adventmedia avatar Nov 04 '19 14:11 adventmedia

Hi @adventmedia Thanks for submitting the issue!

Can you please share the code snippet you used with binary encoding? It should work properly as we had similar issue with videos a while ago.

abramenal avatar Nov 05 '19 14:11 abramenal

I have the same issue I'm using latest version of Cypress, also want to double check what should be the value of fileContent?

RadwaSaleh avatar Nov 16 '20 22:11 RadwaSaleh

@RadwaSaleh it should be a resulting value from cy.fixture

abramenal avatar Nov 17 '20 07:11 abramenal

FWIW I thought had this issue, but I did not. I just did this to get it working. Trying to read the file directly with cy.fixture failed.

cy.get('input[type="file"]').attachFile({
    filePath: 'test-video.mp4',
    encoding: 'binary',
    mimeType: 'video/mp4'
})

xdumaine avatar Mar 26 '21 14:03 xdumaine