|
17 | 17 |
|
18 | 18 | package io.appium.java_client.android; |
19 | 19 |
|
20 | | -import static org.junit.Assert.assertEquals; |
21 | | -import static org.junit.Assert.assertNotEquals; |
22 | | -import io.appium.java_client.MobileBy; |
23 | | -import io.appium.java_client.MobileElement; |
24 | | -import io.appium.java_client.MultiTouchAction; |
25 | | -import io.appium.java_client.SwipeElementDirection; |
26 | | -import io.appium.java_client.TouchAction; |
27 | | -import io.appium.java_client.android.AndroidDriver; |
| 20 | +import io.appium.java_client.*; |
28 | 21 | import io.appium.java_client.remote.MobileCapabilityType; |
29 | | - |
30 | | -import java.io.File; |
31 | | -import java.net.URL; |
32 | | -import java.util.concurrent.TimeUnit; |
33 | | - |
34 | 22 | import org.junit.After; |
35 | 23 | import org.junit.Before; |
36 | 24 | import org.junit.Test; |
37 | 25 | import org.openqa.selenium.By; |
38 | 26 | import org.openqa.selenium.WebElement; |
39 | 27 | import org.openqa.selenium.remote.DesiredCapabilities; |
40 | 28 |
|
| 29 | +import java.io.File; |
| 30 | +import java.net.URL; |
| 31 | +import java.util.concurrent.TimeUnit; |
| 32 | + |
| 33 | +import static org.junit.Assert.assertEquals; |
| 34 | +import static org.junit.Assert.assertNotEquals; |
| 35 | + |
41 | 36 | /** |
42 | 37 | * Test Mobile Driver features |
43 | 38 | */ |
@@ -103,15 +98,20 @@ public void elementGestureTest(){ |
103 | 98 | driver.manage().timeouts().implicitlyWait(2, TimeUnit.SECONDS); |
104 | 99 | MobileElement e = (MobileElement) driver.findElement(MobileBy.AccessibilityId("App")); |
105 | 100 | e.tap(1, 1500); |
106 | | - MobileElement e2 = (MobileElement) driver.findElement(MobileBy.AccessibilityId("Activity")); |
| 101 | + System.out.println("tap"); |
| 102 | + MobileElement e2 = (MobileElement) driver.findElementByClassName("android.widget.TextView"); |
107 | 103 | e2.zoom(); |
108 | | - e2.swipe(SwipeElementDirection.UP,2000); |
109 | | - e2.swipe(SwipeElementDirection.DOWN,2000); |
110 | | - e2.swipe(SwipeElementDirection.RIGHT,1000); |
111 | | - MobileElement e3 = (MobileElement) driver.findElement(MobileBy.AccessibilityId("Custom Title")); |
112 | | - e3.swipe(SwipeElementDirection.RIGHT,1000); |
113 | | - MobileElement e4 = (MobileElement) driver.findElement(MobileBy.AccessibilityId("Change Left")); |
114 | | - e4.pinch(); |
115 | | - e4.swipe(SwipeElementDirection.LEFT,2000); |
| 104 | + System.out.println("zoom"); |
| 105 | + e2.swipe(SwipeElementDirection.RIGHT,1000); |
| 106 | + System.out.println("RIGHT"); |
| 107 | + driver.sendKeyEvent(AndroidKeyCode.BACK); |
| 108 | + e2 = (MobileElement) driver.findElementByClassName("android.widget.TextView"); |
| 109 | + e2.swipe(SwipeElementDirection.LEFT, 1000); |
| 110 | + System.out.println("LEFT"); |
| 111 | + e2 = (MobileElement) driver.findElementByClassName("android.widget.TextView"); |
| 112 | + e2.swipe(SwipeElementDirection.DOWN,1000); |
| 113 | + System.out.println("DOWN"); |
| 114 | + e2.swipe(SwipeElementDirection.UP,1000); |
| 115 | + System.out.println("UP"); |
116 | 116 | } |
117 | 117 | } |
0 commit comments