I am attempting to test a Dropzone.js form using Protractor. This method of uploading to a file input using Protractor is not working for me.
Dropzone does create a hidden <input type="file">
element to handle the upload, but when I sendKeys
to it, I get the error:
Server responded with 0 code.
It also shows that 0 bytes were sent. I opened up Charles and confirmed that no POST
request is made to the upload route defined on my dropzone form.
I found this question/answer, which suggests adding a second <input type="file">
and then creating a drop event, but I don't have a window
element when running Protractor tests, so I'm not really sure that it translates.
How can I trigger a Dropzone.js upload in a Protractor/Jasmine test session?