melodic-apple-72412
12/13/2021, 11:33 AM@4tw/cypress-drag-drop
.move method, unfortunately no success. I have created a simple project with my application. If someone could help me, will be great. https://github.com/mekalag/cypressProj.gitwonderful-match-15836
12/20/2021, 1:35 AMmousemove
event listener actually is... it's not on the original resize-handle. So it's not too surprising that the test code (which looks fine) doesn't do anything in this instance.
So I don't have a solution for you at the moment except to point you in the direction of figuring out how that feature is implemented. Between the resize functionality itself and the list parent + grid snapping, there sure is plenty happening at once, and it seems like it's not the typical drag and drop implementation we might see other places.melodic-apple-72412
12/20/2021, 9:21 AMawait t
.hover(dragEle)
.drag(dragEle, 200, 200);
So now, I wonder if it's my application the way it's implemented or cypress not being able to drag.
I expected atleast @4tw/cypress-drag-drop
plugin will have some methods to get around with this easily. But no success.wonderful-match-15836
12/21/2021, 10:36 PMmelodic-apple-72412
12/22/2021, 2:09 PMmelodic-apple-72412
12/22/2021, 2:10 PMwonderful-match-15836
12/31/2021, 12:28 AMmousemove
event. So this, for example, works for me:
cy.get('.asset-alarms > .resize-handle')
.trigger('mousedown', { eventConstructor: 'MouseEvent', })
.trigger('mousemove', {
clientX: 0,
clientY: 0,
eventConstructor: 'MouseEvent',
})
.trigger('mousemove', {
clientX: 600,
clientY: 600,
eventConstructor: 'MouseEvent',
force: true
})
.trigger('mouseup', {force: true})
Hopefully this unblocks you for the moment. I set the first clientX
and clientY
to 0
, just cause I'm speculating that the first event is used by the library to enter the 'resizing' state, and the position doesn't matter. Only the position for subsequent mousemove
events appears to be used. This also explains why we need to force: true
the later events - in the resizing state, the handle has been hidden.
It gives me a few ideas going forward about maybe suggesting an update to the move
command from cypress-drag-drop
, to fire more than one set of pointermove
and mousemove
events during a move. Which would get it working for this case and presumably other similar drag situations.melodic-apple-72412
01/03/2022, 1:41 PM