use of io.appium.java_client.MultiTouchAction in project java-client by appium.
the class AndroidTouchTest method multiTouchTest.
@Test
public void multiTouchTest() {
Activity activity = new Activity("io.appium.android.apis", ".view.Buttons1");
driver.startActivity(activity);
TouchAction press = new TouchAction(driver).press(element(driver.findElementById("io.appium.android.apis:id/button_toggle"))).waitAction(waitOptions(ofSeconds(1))).release();
new MultiTouchAction(driver).add(press).perform();
assertEquals("ON", driver.findElementById("io.appium.android.apis:id/button_toggle").getText());
}
use of io.appium.java_client.MultiTouchAction in project java-client by appium.
the class IOSTouchTest method multiTouchTest.
@Test
public void multiTouchTest() {
MobileElement e = driver.findElementByAccessibilityId("ComputeSumButton");
MobileElement e2 = driver.findElement(IosUIAutomation(".elements().withName(\"show alert\")"));
TouchAction tap1 = new TouchAction(driver).tap(tapOptions().withElement(element(e)));
TouchAction tap2 = new TouchAction(driver).tap(tapOptions().withElement(element(e2)));
new MultiTouchAction(driver).add(tap1).add(tap2).perform();
WebDriverWait waiting = new WebDriverWait(driver, 10000);
assertNotNull(waiting.until(alertIsPresent()));
driver.switchTo().alert().accept();
}
Aggregations