@@ -19,16 +19,15 @@ appium plugin install --source=npm appium-gestures-plugin
1919The plugin will not be active unless turned on when invoking the Appium server:
2020
2121```
22- appium --plugins=gestures
22+ appium --use- plugins=gestures
2323```
2424
2525# Drag and Drop test without plugin
26+
2627```
27- MobileElement dragMe = (MobileElement) new WebDriverWait(driver, 30)
28- .until(elementToBeClickable(MobileBy.AccessibilityId("dragMe")));
28+ WebElement dragMe = wait.until(elementToBeClickable(AppiumBy.accessibilityId("dragMe")));
2929Point source = dragMe.getCenter();
30- MobileElement dropzone = (MobileElement) new WebDriverWait(driver, 30)
31- .until(elementToBeClickable(MobileBy.AccessibilityId("dropzone")));
30+ WebElement dropzone = wait.until(elementToBeClickable(AppiumBy.accessibilityId("dropzone")));
3231Point target = dropzone.getCenter();
3332PointerInput finger = new PointerInput(PointerInput.Kind.TOUCH, "finger");
3433Sequence dragNDrop = new Sequence(finger, 1);
@@ -46,28 +45,29 @@ driver.perform(singletonList(dragNDrop));
4645# Usage
4746
4847# Drag and Drop
48+
4949```
50- MobileElement source = (MobileElement) new WebDriverWait(driver, 30)
51- .until(elementToBeClickable(MobileBy.AccessibilityId ("dragMe")));
52- MobileElement destination = (MobileElement) new WebDriverWait(driver, 30)
53- .until(elementToBeClickable(MobileBy.AccessibilityId ("dropzone")));
50+ RemoteWebElement source = (RemoteWebElement) wait
51+ .until(elementToBeClickable(AppiumBy.accessibilityId ("dragMe")));
52+ RemoteWebElement destination = (RemoteWebElement) wait
53+ .until(elementToBeClickable(AppiumBy.accessibilityId ("dropzone")));
5454
55- driver.addCommand(HttpMethod.POST, String.format("/session/%s/plugin/actions/dragAndDrop",
56- driver.getSessionId()), "dragAndDrop");
55+ driver.addCommand(HttpMethod.POST, String.format("/session/%s/plugin/actions/dragAndDrop",
56+ driver.getSessionId()), "dragAndDrop");
5757driver.execute("dragAndDrop", ImmutableMap.of("sourceId", source.getId(), "destinationId", destination.getId()));
5858```
59+
5960# Horizontal Swipe
61+
6062```
61- MobileElement source = (MobileElement) new WebDriverWait(driver, 30)
62- .until(elementToBeClickable(MobileBy.AccessibilityId("slider")));
63+ RemoteWebElement source = (RemoteWebElement) wait.until(elementToBeClickable(AppiumBy.accessibilityId("slider")));
6364
65+ driver.addCommand(HttpMethod.POST, String.format("/session/%s/plugin/actions/swipe", driver.getSessionId()), "swipe");
6466
65- driver.addCommand(HttpMethod.POST, String.format("/session/%s/plugin/actions/swipe",
66- driver.getSessionId()), "swipe");
67- driver.execute("dragAndDrop", ImmutableMap.of("elementId", source.getId(), "percentage", 50));
67+ driver.execute("swipe", ImmutableMap.of("elementId", source.getId(), "percentage", 50));
6868```
6969
70- # WDIO
70+ # WDIO
7171
7272```
7373driver.addCommand(
@@ -91,18 +91,18 @@ driver.addCommand(
9191 })
9292 );
9393 await driver.dragAndDrop(sourceId, destinationId);
94-
94+
9595```
96- ## Supported
9796
98- * Horizontal Swipe
99- * Drag and Drop
100- ### TODO
97+ ## Supported
10198
102- * swipe vertically
103- * double click
104- * longpress
105- * zoom
106- * multi finger swipe
99+ - Horizontal Swipe
100+ - Drag and Drop
107101
102+ ### TODO
108103
104+ - swipe vertically
105+ - double click
106+ - longpress
107+ - zoom
108+ - multi finger swipe
0 commit comments