Open sammiwei911 opened 6 years ago
I get a similar problem with cypress, I can't drag and drop the element (using mousedown, mousemove and mouseup).
Did anyone find solution for it ?
I was able to get around it with cypress by initiating the mousedown event and the clicking somewhere else on the screen. That will trick the mouse to move there which will cause a drag, and then trigger a mouse down event again ending the transition.
cy.get('[data-testid="draghandle3"]')
.trigger("mousedown")
cy.getTestElement('somewhereElseOnThePage').click();
Ideal, nope, but it got the job done and correctly tested the list I was trying to test.
NOTE: To prevent unexpected side effects, click on something without an event listener, I grabbed some text on the page above my list and clicked on that. Nothing happened except my item got moved to the top of the list.
We are trying to simulate the drag and drop event, but when one item is selected(mouse on hold to it) the visibility is set to hidden. We were able to simulate drag and drop because of this reason. Is there a walk around to it. FYI, we are using
driver.execute_script(js + "$('#one').simulateDragDrop({ dropTarget: '#bin'});")