The Appium Java client version 6.0.0 removed the driver.swipe(fromX, toX, fromY, toY, duration) API. From what I can tell, we are now supposed to use the TouchAction class to achieve the same, using the following code:
(new TouchAction(driver))
.press(PointOption.point(fromX, fromY))
.waitAction(WaitOptions.waitOptions(Duration.ofMillis(1000)))
.moveTo(PointOption.point(offsetX, offsetY))
.release()
.perform();
I think we have a gap there, because the duration of the swipe sounds like something that should be passed along in the moveTo() call and there is no method overload to achieve that.
The code I pasted above performs the actions: press, wait, move, release. What I would like to do is: press, then immediately start moving and make sure the swipe gesture spans exactly 1 second, then release. What would be the proper way to achieve this?