summaryrefslogtreecommitdiffstats
path: root/uitest/src/com/vaadin/tests/tb3
diff options
context:
space:
mode:
authorJuuso Valli <juuso@vaadin.com>2014-06-13 15:22:29 +0300
committerVaadin Code Review <review@vaadin.com>2014-06-23 12:49:48 +0000
commitd2b0e97c9fb43c1cf84947b42a6de6d58b2368ca (patch)
treec9cd159ef6511dfdd576c723bde58691b621b37d /uitest/src/com/vaadin/tests/tb3
parent5fe5f05576c166600f6912345f4580b5d0bfa8a1 (diff)
downloadvaadin-framework-d2b0e97c9fb43c1cf84947b42a6de6d58b2368ca.tar.gz
vaadin-framework-d2b0e97c9fb43c1cf84947b42a6de6d58b2368ca.zip
Upgrade tooltip tests from TB2 to TB4 (#14019)
Change-Id: I57fcffc5e9fb463759639c95a6b47fe09bfa268f
Diffstat (limited to 'uitest/src/com/vaadin/tests/tb3')
-rw-r--r--uitest/src/com/vaadin/tests/tb3/TooltipTest.java27
1 files changed, 25 insertions, 2 deletions
diff --git a/uitest/src/com/vaadin/tests/tb3/TooltipTest.java b/uitest/src/com/vaadin/tests/tb3/TooltipTest.java
index 86ac8c1f12..86ea44287a 100644
--- a/uitest/src/com/vaadin/tests/tb3/TooltipTest.java
+++ b/uitest/src/com/vaadin/tests/tb3/TooltipTest.java
@@ -16,11 +16,13 @@
package com.vaadin.tests.tb3;
+import java.util.List;
import java.util.NoSuchElementException;
import org.junit.Assert;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.interactions.Actions;
+import org.openqa.selenium.remote.DesiredCapabilities;
import com.vaadin.testbench.By;
@@ -58,10 +60,20 @@ public abstract class TooltipTest extends MultiBrowserTest {
}
protected void checkTooltip(String value) throws Exception {
+ WebElement body = findElement(By.cssSelector("body"));
WebElement tooltip = getTooltip();
Assert.assertEquals(value, tooltip.getText());
- Assert.assertTrue("Tooltip should be in viewport", tooltip
+ Assert.assertTrue("Tooltip overflowed to the left", tooltip
.getLocation().getX() >= 0);
+ Assert.assertTrue("Tooltip overflowed up",
+ tooltip.getLocation().getY() >= 0);
+ Assert.assertTrue("Tooltip overflowed to the right", tooltip
+ .getLocation().getX() + tooltip.getSize().getWidth() < body
+ .getSize().getWidth());
+ Assert.assertTrue("Tooltip overflowed down", tooltip.getLocation()
+ .getY() + tooltip.getSize().getHeight() < body.getSize()
+ .getHeight());
+
}
protected void moveToRoot() {
@@ -88,7 +100,18 @@ public abstract class TooltipTest extends MultiBrowserTest {
}
protected void moveMouseToTopLeft(WebElement element) {
- new Actions(getDriver()).moveToElement(element, 0, 0).perform();
+ moveMouseTo(element, 0, 0);
+ }
+
+ protected void moveMouseTo(WebElement element, int offsetX, int offsetY) {
+ new Actions(getDriver()).moveToElement(element, offsetX, offsetY)
+ .perform();
}
+ @Override
+ public List<DesiredCapabilities> getBrowsersToTest() {
+ // TODO Once we figure out how to get mouse hovering work with the IE
+ // webdriver, exclude them from these tests (#13854)
+ return getBrowsersExcludingIE();
+ }
}