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

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

Open kkdv opened this issue 3 years ago • 2 comments

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 avatar Dec 26 '21 02:12 kkdv

Any update on this?

kkdv avatar Feb 23 '22 04:02 kkdv

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

Workaround: use Cypress' selectFile API

andisan86 avatar Apr 01 '24 13:04 andisan86