Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] File upload unsuccessful in Firefox, but successful in Chrome #319

Open
symon-skelly opened this issue Jul 27, 2021 · 1 comment
Open
Assignees
Labels
bug Something isn't working

Comments

@symon-skelly
Copy link

Current behavior:

I am able to successfully use this plugin to upload photos & videos using Chrome Browser for e2e tests, however when the same tests are run in Firefox, the Video upload test will fail at the point where I am waiting for the video to finish uploading (it never does when using this plugin).

Desired behavior:

Firefox Browser should be able to successfully upload and process Videos in Cypress.

Steps to reproduce: (app code and test code)

Function used to upload Videos to our app:

function uploadVideo(fileName) { // Works for Chrome, not for Firefox?
  cy.fixture('Images/' + fileName, 'binary').then((fileContent) => {
    cy.get('.upload-area input', { timeout: 60000 }).attachFile({
      fileContent,
      fileName,
      mimeType: 'video/mp4',
      encoding: 'binary',
    }
  })
  cy.wait('@fileUploaded', { timeout: 60000 })
}

cy.intercept({
  method: 'POST',
  url: awsUrl
}).as('fileUploaded')

uploadVideo('Casino-14721.mp4')

The POST XHR to awsUrl, which is our Amazon AWS S3 bucket URL never resolves, causing the fileUploaded Route alias to never be matched, which in turn causes the timeout.

The video seemingly does get some way through uploading as I can click the 'loading' thumbnail that appears in our app and it displays the video, however it is not fully uploaded as it never progresses past this loading state.

image

If I upload the file manually using Firefox (via cypress) it uploads successfully and matches the Route as expected.

File that fails in Firefox but is successful in Chrome:
https://user-images.githubusercontent.com/60613068/127124349-1db4b4b2-6fe0-4090-a652-ce728b8f5072.mp4

Versions

Cypress@8.0
cypress-file-upload@5.0.8
Chrome 91
Firefox 89

@KleisKlasKluss
Copy link

I'm experiencing the same thing using Firefox. The test works without problems in Edge and Chrome.
In FF my test freeze at some point during upload, and the route doesn't match.
I bit annoying.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants