Aishwarya
Aishwarya

Reputation: 41

Is there any way to upload folders using testcafe?

I have to write an e2e test for folder upload by drag-drop functionality in my portal using testcafe. I know there is a method setFilesToUpload() to upload files but is there any method using which we can upload a folder/directory structure?

Upvotes: 3

Views: 435

Answers (1)

mlosev
mlosev

Reputation: 5227

At present, you cannot specify a folder for the setFilesForUpload action. You need to specify all file paths in the folder. Here is an example: await t .setFilesToUpload('#upload-input', [ 'folder1/1.jpg', 'folder1/2.jpg', 'folder1/3.jpg' ]) I've created a suggestion regarding your case - https://github.com/DevExpress/testcafe/issues/3206. You can track it to be notified of our progress.

Upvotes: 4

Related Questions