mperitz
Content Type
Profiles
Forums
Store
Blog
Product
Showcase
FAQ
Downloads
Posts posted by mperitz
-
-
Hello,
I am working on assisting a colleague in automation testing of our product. We use GSAP Draggable to drag a video in the x direction to close it. The automation library he uses (Appium) has deprecated its "swipe" mimicking functionality, so it is up to me to write a javascript script to simulate the swipe event. So far I have been able to simulate the drag start and drag end events by creating pointerdown and pointerup events and calling draggable.startDrag/endDrag with the pointer events as arguments (we have the Draggable class saved on our window - I use Draggable.get(element) to find the draggable instance). I know this is working because the onPress, onDragStart, and onDragEnd events are firing. However, I do not know how to simulate the dragging itself. I must do this, because in our onDrag callback, we are changing state which the onDragEnd event uses to determine whether or not to close the video. My question is, how can I force the onDrag event to fire?
Unfortunately I cant really reproduce this in a codepen because our code is not open source
I have tried using the draggable.drag() method, but that does not work....
HAAALP!
Thanks!
Mike
Force onDrag to Fire
in GSAP
Posted
@GreenSock, we are using Draggable because we want the video to stay with the user's finger as they swipe it. If they don't drag it far enough to the left, it will not close the video, but it will reset to its original position. Maybe if I post the script I am using, it will help. Here is a repl with my code: https://repl.it/repls/InsignificantSpottedConferences. Let me know if you need more comments - note that the code will not work if you run it. It has to be run in the context of our product....
@OSUblake, I sent our test engineer that page, so we will see what he says
Thanks for the responses!