Dropzone uploads
DrevOps\BehatSteps\Steps\Web\DropzoneTrait - Source, Example, Helpers
Simulate a real multi-file drag-and-drop gesture onto a Dropzone target.
- Drop 1 or more files on a CSS-selected target in a single native event.
- Fixture paths resolve against the Mink
files_pathparameter.- Works on any element that handles native
dropevents (Dropzone.js, custom drop targets, framework widgets).
Mink'sattachFilewrites each file to a hidden<input type="file">sequentially, so file A finishes uploading before file B starts. Real users release multiple files together, so a singledropevent carries all of them indataTransfer.filesand triggers concurrent uploads.
Race conditions in dedup maps, status indicators, error handlers and server-side queues reproduce only under the multi-file path.
@javascript-only: requires a headless browser session.
Steps
@When I drop the file :filename on the dropzone :selector
Drop a single file on the target element
When I drop the file "document.pdf" on the dropzone ".dropzone"
@When I drop the following files on the dropzone :selector:
Drop 1 or more files on the target element in a single native event
When I drop the following files on the dropzone ".dropzone":
| document.pdf |
| image.png |
| text.txt |