Search code examples
javascriptdrag-and-dropautomated-teststestcafeui-testing

TestCafe DragNDrop Not Working When DropZone Appears After DragStart


I recently started to use TestCafe and I'm trying to utilize t.dragToElement(selector, destinationSelector) method.

The problem is, the dropzone does not appear until I start dragging. It is hidden using display: none and appears onDragStart. Therefore TestCafe fails with

The element that matches the specified "destinationSelector" is not visible.

Q: Any ideas, how to make TestCafe click & hold & drag a little bit & then drag to destination & then release?


Solution

  • Unfortunately now it is quite complicated (if possible at all). But it looks that dragToElement definitely should be implemented in the way allowing your use case, so I created an issue at our GitHub: #1374, and it will work out-of-the box. Feel free to comment it on GitHub, add some details, etc.