-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerizeAppium.java
More file actions
27 lines (23 loc) · 1.01 KB
/
Copy pathDockerizeAppium.java
File metadata and controls
27 lines (23 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import io.appium.java_client.MobileBy;
import io.appium.java_client.MobileElement;
import io.appium.java_client.TouchAction;
import org.openqa.selenium.Dimension;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.testng.annotations.Test;
public class DockerizeAppium extends BaseAndroidTest {
@Test
public void horizontalSwipingTest() throws Exception {
login();
driver.findElementByAccessibilityId("slider1").click();
MobileElement slider = (MobileElement) driver.findElementByAccessibilityId("slider");
Dimension size = slider.getSize();
TouchAction swipe = new TouchAction(driver).press(slider, 0, size.height / 2).waitAction(2000)
.moveTo(slider, size.width / 2, size.height / 2).release();
swipe.perform();
}
private void login() {
new WebDriverWait(driver,30).until(ExpectedConditions.
elementToBeClickable(MobileBy.AccessibilityId("login"))).click();
}
}