abramenal / cypress-file-upload

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

cypress-file-upload with subjectType: "drag-n-drop" does not work on Chrome & Electron but works fine with Firefox #352

Open kkdv opened 2 years ago

kkdv commented 2 years ago

Cypress interactive test using cypress-file-upload (v 5.0.8) with subjectType: "drag-n-drop" does not work in Chrome & Electron but works flawlessly in Firefox.

In Chrome and Electron, the command attachFile passes successfully with no error messages produced. Are there any config settings in Chrome to make this work?

image

Environment MacOS 11.6.1 BigSur Cypress 9.0 Browser versions: Chrome 96 ; Firefox 95 ; Electron 94

Cypress Spec file

filepath = "/tmp/index.html"
cy.get('.files-row').attachFile( filepath, {
            subjectType: 'drag-n-drop',
            force: true
 })

filepath = "/tmp/index2.html"
cy.get('.files-row').attachFile( filepath, {
            subjectType: 'drag-n-drop',
            force: true
 })

DOM. (rendered with Ember.js)

<div class="file">
   <div class="files-row">
            <span> Drag file here </span>
     </div>
 </div>
kkdv commented 2 years ago

Any update on this?

andisan86 commented 3 months ago

Able to reproduce this issue in Cypress 11.2.0m Chrome v123.

Workaround: use Cypress' selectFile API