diff --git a/CHANGELOG.md b/CHANGELOG.md index a67b5dded..17d2db39b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ tests. #### iOS - add Tapster support for some more touch methods +- fix moveTo: treat coordinates as relative, instead of absolute - iPhone 6 + 6S support - iOS 9.3 support diff --git a/docs/en/writing-running-appium/touch-actions.md b/docs/en/writing-running-appium/touch-actions.md index 697dcf5bc..3cf2804b0 100644 --- a/docs/en/writing-running-appium/touch-actions.md +++ b/docs/en/writing-running-appium/touch-actions.md @@ -44,10 +44,18 @@ to another position, and removing their finger from the screen. Appium performs the events in sequence. You can add a `wait` event to control the timing of the gesture. +`moveTo` coordinates are *relative* to the current position. For example, dragging from +100,100 to 200,200 can be achieved by: +``` +.press(100,100) // Start at 100,00 +.moveTo(100,100) // Increase X & Y by 100 each, ending up at 200,200 + +``` + The appium client libraries have different ways of implementing this, for example: you can pass in coordinates or an element to a `moveTo` event. Passing both coordinates _and_ an element will treat the coordinates as relative to the -elements position, rather than absolute. +element's position, rather than relative to the current position. Calling the `perform` event sends the entire sequence of events to appium, and the touch gesture is run on your device.