cypress icon indicating copy to clipboard operation
cypress copied to clipboard

Add cy.selectFolder for uploading a folder via cypress

Open anark opened this issue 2 years ago • 14 comments

What would you like?

It is great that cypress is gaining native support for file uploads via cy.selectFile.

However, one issue I always had with cypress-file-upload was that it did not support folder uploads. Modern HTML and libraries(such as Uppy) allow you to drag and drop an entire folder and they will handle recursively selecting the files from the dropped folder.

See original issue from cypress-file-upload: https://github.com/abramenal/cypress-file-upload/issues/141.

It would be great if it was possible to simulate dropping folders with cypress.

Why is this needed?

Modern upload drop zones allow for dropping of folders. This can be quite complicated to program and is currently impossible to test via cypress(as there is no way to simulate a folder drop). It would be great if this could be tested using cypress.

Other

No response

anark avatar Jan 13 '22 19:01 anark

Hey! Is there an update on this? We could really use this very much!

Alagaesia93 avatar Aug 09 '22 16:08 Alagaesia93

Hello!! Any update here?

code-qe avatar Oct 18 '22 14:10 code-qe

We could really use this feature too!

redtailryan avatar Oct 28 '22 14:10 redtailryan

We are also in search of this feature. <3 Cypress plzzzzzzz!!

kschmarr avatar Oct 28 '22 16:10 kschmarr

+1 for this request. It'd be really helpful.

leila-c908 avatar Jan 20 '23 02:01 leila-c908

Wow hit this as well. So tired testing this manually... @mjhenkes please please help!

TimPchelintsev avatar Feb 12 '23 06:02 TimPchelintsev

+1 This would be a great addition!

lluisemper avatar Apr 20 '23 14:04 lluisemper

Could really need this as well.

intervall-peter avatar May 26 '23 08:05 intervall-peter

Any update on this feature. Need it to automate stories

Apeksha012 avatar Oct 06 '23 10:10 Apeksha012

Any update on this feature. Need it to automate stories

I simulated the browser APIs for directory listing and file access inside of my Cypress test suite. It's a bit slow and memory consuming, because I have to load all the files etc., but it works.

LubosD avatar Oct 06 '23 10:10 LubosD

@LubosD can you share the code please? I tried and I didn't manage to make it work

Alagaesia93 avatar Nov 07 '23 09:11 Alagaesia93

This feature is helpful for our application too.

csanthoshi avatar Jan 25 '24 11:01 csanthoshi