Search in sources :

Example 1 with MultiTouchAction

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());
}
Also used : MultiTouchAction(io.appium.java_client.MultiTouchAction) TouchAction(io.appium.java_client.TouchAction) MultiTouchAction(io.appium.java_client.MultiTouchAction) Test(org.junit.Test)

Example 2 with MultiTouchAction

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();
}
Also used : MultiTouchAction(io.appium.java_client.MultiTouchAction) MobileElement(io.appium.java_client.MobileElement) WebDriverWait(org.openqa.selenium.support.ui.WebDriverWait) TouchAction(io.appium.java_client.TouchAction) MultiTouchAction(io.appium.java_client.MultiTouchAction) Test(org.junit.Test)

Aggregations

MultiTouchAction (io.appium.java_client.MultiTouchAction)2 TouchAction (io.appium.java_client.TouchAction)2 Test (org.junit.Test)2 MobileElement (io.appium.java_client.MobileElement)1 WebDriverWait (org.openqa.selenium.support.ui.WebDriverWait)1