List of usage examples for org.openqa.selenium.interactions.touch FlickAction SPEED_FAST
int SPEED_FAST
To view the source code for org.openqa.selenium.interactions.touch FlickAction SPEED_FAST.
Click Source Link
From source file:io.selendroid.webviewdrivertests.touch.TouchFlickTest.java
License:Apache License
@Test public void testCanFlickVerticallyFastFromWebElement() { openWebdriverTestPage(HtmlTestData.LONG_CONTENT_PAGE); WebElement link = driver().findElement(By.id("link4")); 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 > 8700);// w ww .ja va 2 s . c om WebElement toFlick = driver().findElement(By.id("imagestart")); Action flick = getBuilder(driver()).flick(toFlick, 0, -600, FlickAction.SPEED_FAST).build(); flick.perform(); y = link.getLocation().y; // After flicking, the element should now be visible on the screen. assertTrue("Expected y < 8700, but got: " + y, y < 8700); }
From source file:org.uiautomation.ios.selenium.interactions.touch.TouchFlickTest.java
License:Apache License
@NeedsFreshDriver @Test/*from w ww . j a v a 2 s. c o m*/ public void testCanFlickHorizontallyFastFromWebElement() { driver.get(pages.longContentPage); WebElement toFlick = driver.findElement(By.id("imagestart")); WebElement link = driver.findElement(By.id("link2")); 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_FAST).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 a2 s. c om*/ public void testCanFlickVerticallyFastFromWebElement() { driver.get(pages.longContentPage); WebElement link = driver.findElement(By.id("link4")); 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_FAST).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); }