Example usage for org.openqa.selenium.interactions.touch FlickAction SPEED_NORMAL

List of usage examples for org.openqa.selenium.interactions.touch FlickAction SPEED_NORMAL

Introduction

In this page you can find the example usage for org.openqa.selenium.interactions.touch FlickAction SPEED_NORMAL.

Prototype

int SPEED_NORMAL

To view the source code for org.openqa.selenium.interactions.touch FlickAction SPEED_NORMAL.

Click Source Link

Usage

From source file:io.selendroid.webviewdrivertests.touch.TouchFlickTest.java

License:Apache License

@Test
public void testCanFlickVerticallyFromWebElement() {
    openWebdriverTestPage(HtmlTestData.LONG_CONTENT_PAGE);

    WebElement link = driver().findElement(By.id("link3"));
    int y = link.getLocation().y;
    // The element is located at the bottom of the page,
    // so it is not initially visible on the screen.
    assertTrue(y > 4200);/*from w w  w  . j a  va2 s  . c o  m*/

    WebElement toFlick = driver().findElement(By.id("imagestart"));
    Action flick = getBuilder(driver()).flick(toFlick, 0, -600, FlickAction.SPEED_NORMAL).build();
    flick.perform();
    y = link.getLocation().y;
    // After flicking, the element should now be visible on the screen.
    assertTrue("Expected y < 4000, but got: " + y, y < 4000);
}

From source file:org.auraframework.integration.test.util.WebDriverTestCase.java

License:Apache License

/**
 * Flick starting at on_element, and moving by the xoffset and yoffset with normal speed
 *
 * @param locator/* w w  w  . j a va  2  s . c  o  m*/
 * @param xOffset
 * @param yOffset
 */
public void flick(By locator, int xOffset, int yOffset) {
    getAuraUITestingUtil().waitForElement("Cannot locate element to flick: " + locator, locator);
    WebElement element = getAuraUITestingUtil().findDomElement(locator);
    flick(element, xOffset, yOffset, FlickAction.SPEED_NORMAL);
}

From source file:org.auraframework.test.util.WebDriverTestCase.java

License:Apache License

/**
 * Flick starting at on_element, and moving by the xoffset and yoffset with normal speed
 * /*from  ww w. j  av a  2s. c o m*/
 * @param locator
 * @param xOffset
 * @param yOffset
 */
public void flick(By locator, int xOffset, int yOffset) {
    waitForElementAppear("Cannot locate element to flick: " + locator, locator);
    WebElement element = auraUITestingUtil.findDomElement(locator);
    flick(element, xOffset, yOffset, FlickAction.SPEED_NORMAL);
}

From source file:org.uiautomation.ios.selenium.interactions.touch.TouchFlickTest.java

License:Apache License

@NeedsFreshDriver
@Test/*from   ww w  .j  a v  a 2  s .  c  om*/
public void testCanFlickHorizontallyFromWebElement() {
    driver.get(pages.longContentPage);

    WebElement toFlick = driver.findElement(By.id("imagestart"));
    WebElement link = driver.findElement(By.id("link1"));
    int originalX = link.getLocation().x;
    // The element is located at the right of the page,
    // so it is not initially visible on the screen.
    Action flick = getBuilder(driver).flick(toFlick, -1000, 0, FlickAction.SPEED_NORMAL).build();
    flick.perform();

    int newX = link.getLocation().x;
    // After flicking, the element should now be visible on the screen.
    assertTrue("Expected x < " + originalX + ", but got x = " + newX, newX < originalX);
}

From source file:org.uiautomation.ios.selenium.interactions.touch.TouchFlickTest.java

License:Apache License

@NeedsFreshDriver
@Test//from  w  w w.j  av  a 2  s . c  om
public void testCanFlickVerticallyFromWebElement() {
    driver.get(pages.longContentPage);

    WebElement link = driver.findElement(By.id("link3"));
    int originalY = link.getLocation().y;
    // The element is located at the bottom of the page,
    // so it is not initially visible on the screen.
    WebElement toFlick = driver.findElement(By.id("imagestart"));
    Action flick = getBuilder(driver).flick(toFlick, 0, -600, FlickAction.SPEED_NORMAL).build();
    flick.perform();
    int newY = link.getLocation().y;
    // After flicking, the element should now be visible on the screen.
    assertTrue("Expected y < " + originalY + ", but got y = " + newY, newY < originalY);
}