5

I have a HTML editor which accepts drag and drop file and image uploads. I need to test this is Cucumber (using Capybara and Poltergeist), but I can't find anything saying how to do it. I found that Capybara has drag and drop support, but it only mentions finding existing page elements and dragging them around. I need to send a file to the browser that's not there yet.

The editor has a contenteditable div, which picks up the file and then sends it to S3 via JS.

Matt Gibson
  • 14,616
  • 7
  • 47
  • 79
  • Solved it using the approach here: http://stackoverflow.com/questions/5188240/using-selenium-to-imitate-dragging-a-file-onto-an-upload-element – Matt Gibson Nov 16 '13 at 18:46
  • You know that cucumber doesn't test anything. All the work is being done by Capybara and Poltergeist. – Dave McNulla Nov 17 '13 at 07:13
  • 3
    Does this answer your question? [Using Selenium to imitate dragging a file onto an upload element](https://stackoverflow.com/questions/5188240/using-selenium-to-imitate-dragging-a-file-onto-an-upload-element) – Marit Mar 05 '20 at 07:43

0 Answers0