Skip to content

Commit

Permalink
Update a test to actually change an element's location before checking
Browse files Browse the repository at this point in the history
that the location changed.
  • Loading branch information
jleyba committed Dec 19, 2013
1 parent 411afbb commit d0ee67e
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.interactions.Action;
import org.openqa.selenium.internal.Locatable;

/**
* Tests the basic double tap operations.
Expand All @@ -44,14 +45,13 @@ public void testCanDoubleTapOnAnImageAndAlterLocationOfElementsInScreen() {
driver.get(pages.longContentPage);

WebElement image = driver.findElement(By.id("imagestart"));
int y = image.getLocation().y;
int y = ((Locatable) image).getCoordinates().inViewPort().y;
// The element is located at a certain point, after double tapping,
// the y coordinate must change.
assertTrue(y > 100);

doubleTapOnElement("imagestart");

y = image.getLocation().y;
y = ((Locatable) image).getCoordinates().inViewPort().y;
assertTrue(y < 50);
}

Expand Down

0 comments on commit d0ee67e

Please sign in to comment.