Cypress can't drag a custom angular cdkDragHandle #18200
Unanswered
gabrielnemeth
asked this question in
Component Testing
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm losing sanity over this one. I have one drag and drop list in my app with a custom drag handle and cypress seems to be unable to drag it. Manually when the user drags it, it works perfectly.
Here is the simple component:
Working stackblitz.
At first, I've tried this approach with cypress:
In this case the cy stops and errors out on the
.trigger("mousemove", {x: 0, y: 230})
step with the following error:I wasn't able to figure out why does the 4th element cover the dragged one.
The second approach I've tried was from this SO post. According to this post, the solution is to query the dragged element via the jQuery selector and to dispatch a MouseEvent. So I did exactly that:
This time no errors, but the item wasn't dragged either. So I removed the custom handle to test it out. This time it worked, the item got dragged successfully, so it confirms that you have to dispatch Events explicitly, but it doesn't work when you have a custom handle. End this is where I got into a dead end.
Beta Was this translation helpful? Give feedback.
All reactions