summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeemu Suo-Anttila <teemusa@vaadin.com>2015-05-19 13:29:56 +0300
committerVaadin Code Review <review@vaadin.com>2015-05-20 09:40:02 +0000
commitda1fa57418c0d29908aedca4f06c7b3536d19d18 (patch)
tree75baddd4ce8fe869a78355afdb39af31092b266b
parentc778f5b859b05f8c9c89322147b4f78b3454d493 (diff)
downloadvaadin-framework-da1fa57418c0d29908aedca4f06c7b3536d19d18.tar.gz
vaadin-framework-da1fa57418c0d29908aedca4f06c7b3536d19d18.zip
Fix GridDetailsLocationTest SubPixel issues with IE8 and IE9
This patch also changes the way this test handles CheckBoxes making the test more stable. Change-Id: I1b6c2b987dbe69bd1fc7b8cdc14adbbe206ed484
-rw-r--r--uitest/src/com/vaadin/tests/components/grid/GridDetailsLocationTest.java20
1 files changed, 9 insertions, 11 deletions
diff --git a/uitest/src/com/vaadin/tests/components/grid/GridDetailsLocationTest.java b/uitest/src/com/vaadin/tests/components/grid/GridDetailsLocationTest.java
index c14503fb8d..f20cc0f6f4 100644
--- a/uitest/src/com/vaadin/tests/components/grid/GridDetailsLocationTest.java
+++ b/uitest/src/com/vaadin/tests/components/grid/GridDetailsLocationTest.java
@@ -28,7 +28,6 @@ import org.openqa.selenium.Keys;
import org.openqa.selenium.StaleElementReferenceException;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
-import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.support.ui.ExpectedCondition;
import com.vaadin.testbench.TestBenchElement;
@@ -36,7 +35,7 @@ import com.vaadin.testbench.elements.ButtonElement;
import com.vaadin.testbench.elements.CheckBoxElement;
import com.vaadin.testbench.elements.GridElement.GridRowElement;
import com.vaadin.testbench.elements.TextFieldElement;
-import com.vaadin.testbench.parallel.Browser;
+import com.vaadin.testbench.parallel.BrowserUtil;
import com.vaadin.testbench.parallel.TestCategory;
import com.vaadin.tests.components.grid.basicfeatures.element.CustomGridElement;
import com.vaadin.tests.tb3.MultiBrowserTest;
@@ -194,6 +193,11 @@ public class GridDetailsLocationTest extends MultiBrowserTest {
WebElement detailsDecoElement = getDetailsDecoElement(visibleIndexOfDeco);
GridRowElement rowElement = getGrid().getRow(row);
+ int diff = 0;
+ if (isIE8() || BrowserUtil.isIE(getDesiredCapabilities(), 9)) {
+ diff = 1;
+ }
+
Assert.assertEquals(
"Details deco top position does not match row top pos",
rowElement.getLocation().getY(), detailsDecoElement
@@ -203,7 +207,7 @@ public class GridDetailsLocationTest extends MultiBrowserTest {
detailsElement.getLocation().getY()
+ detailsElement.getSize().getHeight(),
detailsDecoElement.getLocation().getY()
- + detailsDecoElement.getSize().getHeight());
+ + detailsDecoElement.getSize().getHeight() + diff);
}
private void verifyLocation(Param param) {
@@ -295,13 +299,7 @@ public class GridDetailsLocationTest extends MultiBrowserTest {
}
private boolean isIE8() {
- DesiredCapabilities desiredCapabilities = getDesiredCapabilities();
- DesiredCapabilities ie8Capabilities = Browser.IE8
- .getDesiredCapabilities();
- return desiredCapabilities.getBrowserName().equals(
- ie8Capabilities.getBrowserName())
- && desiredCapabilities.getVersion().equals(
- ie8Capabilities.getVersion());
+ return BrowserUtil.isIE8(getDesiredCapabilities());
}
@SuppressWarnings("boxing")
@@ -312,7 +310,7 @@ public class GridDetailsLocationTest extends MultiBrowserTest {
}
private void clickValo(CheckBoxElement checkBoxElement) {
- checkBoxElement.findElement(By.tagName("label")).click();
+ checkBoxElement.click(5, 5);
}
private Object executeScript(String string, Object... param) {