summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeemu Suo-Anttila <tsuoanttila@users.noreply.github.com>2018-07-03 21:32:38 +0300
committerTeemu Suo-Anttila <tsuoanttila@users.noreply.github.com>2018-07-10 12:50:43 +0300
commitdcf56f1af330d55c0054158649e31101ffcbad71 (patch)
treebb829c81349a0862955f49a9ab36f2d3589145d1
parent3d92d95529b60a483579c99199c44cca97a034e1 (diff)
downloadvaadin-framework-dcf56f1af330d55c0054158649e31101ffcbad71.tar.gz
vaadin-framework-dcf56f1af330d55c0054158649e31101ffcbad71.zip
Fix Firefox coordinates, add missing screenshots (#11022)
-rwxr-xr-xuitest/reference-screenshots/firefox/AccordionClipsContentTest-testAccordionClipsContent_ANY_Firefox__button-clicked.pngbin0 -> 17708 bytes
-rwxr-xr-xuitest/reference-screenshots/firefox/ComboBoxBorderTest-testComboBoxArrow_ANY_Firefox__arrow.pngbin0 -> 11906 bytes
-rwxr-xr-xuitest/reference-screenshots/firefox/ComboBoxLargeIconsTest-testComboBoxIcons_ANY_Firefox__icons-64x64-page1-highlight-first.pngbin0 -> 51947 bytes
-rw-r--r--uitest/reference-screenshots/firefox/DragStartModesTest-testDragStartModes_ANY_Firefox__dragImageModeCOMPONENT.pngbin0 -> 25339 bytes
-rw-r--r--uitest/reference-screenshots/firefox/DragStartModesTest-testDragStartModes_ANY_Firefox__dragImageModeCOMPONENT_OTHER.pngbin0 -> 30820 bytes
-rw-r--r--uitest/reference-screenshots/firefox/DragStartModesTest-testDragStartModes_ANY_Firefox__dragImageModeWRAPPER.pngbin0 -> 25818 bytes
-rw-r--r--uitest/reference-screenshots/firefox/GridCaptionTest-LayoutCaption_ANY_Firefox__caption.pngbin46882 -> 46881 bytes
-rw-r--r--uitest/reference-screenshots/firefox/GridIconTest-LayoutIcon_ANY_Firefox__icon.pngbin61711 -> 61735 bytes
-rw-r--r--uitest/reference-screenshots/firefox/ResponsiveStylesTest-testValoMenuResponsiveHover_ANY_Firefox__collapsedMenu.pngbin0 -> 11317 bytes
-rw-r--r--uitest/reference-screenshots/firefox/ResponsiveStylesTest-testValoMenuResponsiveHover_ANY_Firefox__expandedMenu.pngbin0 -> 12587 bytes
-rw-r--r--uitest/reference-screenshots/firefox/ResponsiveUITest-testResizingSplitPanelReflowsLayout_ANY_Firefox__responsive.pngbin0 -> 40569 bytes
-rw-r--r--uitest/reference-screenshots/firefox/TableContextMenuAndIconsTest-tableContextMenuWithIcons_ANY_Firefox__caption-only-and-has-icon.pngbin0 -> 38682 bytes
-rw-r--r--uitest/reference-screenshots/firefox/TableContextMenuAndIconsTest-tableContextMenuWithIcons_ANY_Firefox__contextmenu-empty.pngbin0 -> 35253 bytes
-rw-r--r--uitest/reference-screenshots/firefox/TableContextMenuAndIconsTest-tableContextMenuWithIcons_ANY_Firefox__contextmenu-noicon.pngbin0 -> 37261 bytes
-rw-r--r--uitest/reference-screenshots/firefox/TableContextMenuAndIconsTest-tableContextMenuWithIcons_ANY_Firefox__large-icon.pngbin0 -> 41319 bytes
-rw-r--r--uitest/reference-screenshots/firefox/TableDropIndicatorValoTest-indicator_ANY_Firefox__indicator.pngbin0 -> 16687 bytes
-rw-r--r--uitest/reference-screenshots/firefox/WindowZIndexTest-removingUpdatesZIndices_ANY_Firefox__win4-on-top.pngbin0 -> 39996 bytes
-rw-r--r--uitest/src/test/java/com/vaadin/tests/VerifyBrowserVersionTest.java3
-rw-r--r--uitest/src/test/java/com/vaadin/tests/components/abstractcomponent/ContextClickUITest.java5
-rw-r--r--uitest/src/test/java/com/vaadin/tests/components/draganddropwrapper/DragStartModesTest.java10
-rw-r--r--uitest/src/test/java/com/vaadin/tests/components/embedded/EmbeddedClickListenerRelativeCoordinatesTest.java11
-rw-r--r--uitest/src/test/java/com/vaadin/tests/components/grid/GridColumnResizingTest.java5
-rw-r--r--uitest/src/test/java/com/vaadin/tests/components/grid/GridComponentsTest.java12
-rw-r--r--uitest/src/test/java/com/vaadin/tests/components/grid/GridHeightTest.java6
-rw-r--r--uitest/src/test/java/com/vaadin/tests/components/grid/GridResizeHiddenColumnTest.java5
-rw-r--r--uitest/src/test/java/com/vaadin/tests/components/table/ColumnReorderingWithManyColumnsTest.java6
-rw-r--r--uitest/src/test/java/com/vaadin/tests/components/table/ContextMenuSizeTest.java8
-rw-r--r--uitest/src/test/java/com/vaadin/tests/components/textarea/TextAreaSizeResettedTest.java8
-rw-r--r--uitest/src/test/java/com/vaadin/tests/components/upload/UploadImmediateButtonWidthChameleonTest.java2
-rw-r--r--uitest/src/test/java/com/vaadin/tests/components/window/MaximizedWindowOrderTest.java13
-rwxr-xr-xuitest/src/test/java/com/vaadin/tests/components/window/ModalWindowRefocusTest.java3
-rw-r--r--uitest/src/test/java/com/vaadin/tests/components/window/WindowZIndexTest.java3
-rw-r--r--uitest/src/test/java/com/vaadin/tests/contextclick/AbstractContextClickTest.java4
-rw-r--r--uitest/src/test/java/com/vaadin/tests/contextclick/TreeContextClickTest.java5
-rw-r--r--uitest/src/test/java/com/vaadin/tests/dd/DnDOnSubtreeTest.java15
-rw-r--r--uitest/src/test/java/com/vaadin/tests/extensions/ResponsiveUITest.java1
-rw-r--r--uitest/src/test/java/com/vaadin/tests/fieldgroup/BasicPersonFormTest.java5
-rw-r--r--uitest/src/test/java/com/vaadin/tests/layouts/TestLayoutClickListenersTest.java53
-rw-r--r--uitest/src/test/java/com/vaadin/tests/resources/FrontendInitialResourceUITest.java4
-rw-r--r--uitest/src/test/java/com/vaadin/tests/resources/FrontendLaterLoadedResourceUITest.java4
-rw-r--r--uitest/src/test/java/com/vaadin/tests/tb3/AbstractTB3Test.java42
-rw-r--r--uitest/src/test/java/com/vaadin/tests/themes/valo/ContrastFontColorTest.java4
42 files changed, 172 insertions, 65 deletions
diff --git a/uitest/reference-screenshots/firefox/AccordionClipsContentTest-testAccordionClipsContent_ANY_Firefox__button-clicked.png b/uitest/reference-screenshots/firefox/AccordionClipsContentTest-testAccordionClipsContent_ANY_Firefox__button-clicked.png
new file mode 100755
index 0000000000..61ea766329
--- /dev/null
+++ b/uitest/reference-screenshots/firefox/AccordionClipsContentTest-testAccordionClipsContent_ANY_Firefox__button-clicked.png
Binary files differ
diff --git a/uitest/reference-screenshots/firefox/ComboBoxBorderTest-testComboBoxArrow_ANY_Firefox__arrow.png b/uitest/reference-screenshots/firefox/ComboBoxBorderTest-testComboBoxArrow_ANY_Firefox__arrow.png
new file mode 100755
index 0000000000..a81614c564
--- /dev/null
+++ b/uitest/reference-screenshots/firefox/ComboBoxBorderTest-testComboBoxArrow_ANY_Firefox__arrow.png
Binary files differ
diff --git a/uitest/reference-screenshots/firefox/ComboBoxLargeIconsTest-testComboBoxIcons_ANY_Firefox__icons-64x64-page1-highlight-first.png b/uitest/reference-screenshots/firefox/ComboBoxLargeIconsTest-testComboBoxIcons_ANY_Firefox__icons-64x64-page1-highlight-first.png
new file mode 100755
index 0000000000..30073c6993
--- /dev/null
+++ b/uitest/reference-screenshots/firefox/ComboBoxLargeIconsTest-testComboBoxIcons_ANY_Firefox__icons-64x64-page1-highlight-first.png
Binary files differ
diff --git a/uitest/reference-screenshots/firefox/DragStartModesTest-testDragStartModes_ANY_Firefox__dragImageModeCOMPONENT.png b/uitest/reference-screenshots/firefox/DragStartModesTest-testDragStartModes_ANY_Firefox__dragImageModeCOMPONENT.png
new file mode 100644
index 0000000000..a79d2c12e8
--- /dev/null
+++ b/uitest/reference-screenshots/firefox/DragStartModesTest-testDragStartModes_ANY_Firefox__dragImageModeCOMPONENT.png
Binary files differ
diff --git a/uitest/reference-screenshots/firefox/DragStartModesTest-testDragStartModes_ANY_Firefox__dragImageModeCOMPONENT_OTHER.png b/uitest/reference-screenshots/firefox/DragStartModesTest-testDragStartModes_ANY_Firefox__dragImageModeCOMPONENT_OTHER.png
new file mode 100644
index 0000000000..0966b68d59
--- /dev/null
+++ b/uitest/reference-screenshots/firefox/DragStartModesTest-testDragStartModes_ANY_Firefox__dragImageModeCOMPONENT_OTHER.png
Binary files differ
diff --git a/uitest/reference-screenshots/firefox/DragStartModesTest-testDragStartModes_ANY_Firefox__dragImageModeWRAPPER.png b/uitest/reference-screenshots/firefox/DragStartModesTest-testDragStartModes_ANY_Firefox__dragImageModeWRAPPER.png
new file mode 100644
index 0000000000..1d5e6a0021
--- /dev/null
+++ b/uitest/reference-screenshots/firefox/DragStartModesTest-testDragStartModes_ANY_Firefox__dragImageModeWRAPPER.png
Binary files differ
diff --git a/uitest/reference-screenshots/firefox/GridCaptionTest-LayoutCaption_ANY_Firefox__caption.png b/uitest/reference-screenshots/firefox/GridCaptionTest-LayoutCaption_ANY_Firefox__caption.png
index fb96a2c36b..c553137a02 100644
--- a/uitest/reference-screenshots/firefox/GridCaptionTest-LayoutCaption_ANY_Firefox__caption.png
+++ b/uitest/reference-screenshots/firefox/GridCaptionTest-LayoutCaption_ANY_Firefox__caption.png
Binary files differ
diff --git a/uitest/reference-screenshots/firefox/GridIconTest-LayoutIcon_ANY_Firefox__icon.png b/uitest/reference-screenshots/firefox/GridIconTest-LayoutIcon_ANY_Firefox__icon.png
index 9eda2e6bac..b65504fdfd 100644
--- a/uitest/reference-screenshots/firefox/GridIconTest-LayoutIcon_ANY_Firefox__icon.png
+++ b/uitest/reference-screenshots/firefox/GridIconTest-LayoutIcon_ANY_Firefox__icon.png
Binary files differ
diff --git a/uitest/reference-screenshots/firefox/ResponsiveStylesTest-testValoMenuResponsiveHover_ANY_Firefox__collapsedMenu.png b/uitest/reference-screenshots/firefox/ResponsiveStylesTest-testValoMenuResponsiveHover_ANY_Firefox__collapsedMenu.png
new file mode 100644
index 0000000000..6125e60b57
--- /dev/null
+++ b/uitest/reference-screenshots/firefox/ResponsiveStylesTest-testValoMenuResponsiveHover_ANY_Firefox__collapsedMenu.png
Binary files differ
diff --git a/uitest/reference-screenshots/firefox/ResponsiveStylesTest-testValoMenuResponsiveHover_ANY_Firefox__expandedMenu.png b/uitest/reference-screenshots/firefox/ResponsiveStylesTest-testValoMenuResponsiveHover_ANY_Firefox__expandedMenu.png
new file mode 100644
index 0000000000..1823269d62
--- /dev/null
+++ b/uitest/reference-screenshots/firefox/ResponsiveStylesTest-testValoMenuResponsiveHover_ANY_Firefox__expandedMenu.png
Binary files differ
diff --git a/uitest/reference-screenshots/firefox/ResponsiveUITest-testResizingSplitPanelReflowsLayout_ANY_Firefox__responsive.png b/uitest/reference-screenshots/firefox/ResponsiveUITest-testResizingSplitPanelReflowsLayout_ANY_Firefox__responsive.png
new file mode 100644
index 0000000000..4e8e6137ce
--- /dev/null
+++ b/uitest/reference-screenshots/firefox/ResponsiveUITest-testResizingSplitPanelReflowsLayout_ANY_Firefox__responsive.png
Binary files differ
diff --git a/uitest/reference-screenshots/firefox/TableContextMenuAndIconsTest-tableContextMenuWithIcons_ANY_Firefox__caption-only-and-has-icon.png b/uitest/reference-screenshots/firefox/TableContextMenuAndIconsTest-tableContextMenuWithIcons_ANY_Firefox__caption-only-and-has-icon.png
new file mode 100644
index 0000000000..cb8cdf716c
--- /dev/null
+++ b/uitest/reference-screenshots/firefox/TableContextMenuAndIconsTest-tableContextMenuWithIcons_ANY_Firefox__caption-only-and-has-icon.png
Binary files differ
diff --git a/uitest/reference-screenshots/firefox/TableContextMenuAndIconsTest-tableContextMenuWithIcons_ANY_Firefox__contextmenu-empty.png b/uitest/reference-screenshots/firefox/TableContextMenuAndIconsTest-tableContextMenuWithIcons_ANY_Firefox__contextmenu-empty.png
new file mode 100644
index 0000000000..c6fda1464a
--- /dev/null
+++ b/uitest/reference-screenshots/firefox/TableContextMenuAndIconsTest-tableContextMenuWithIcons_ANY_Firefox__contextmenu-empty.png
Binary files differ
diff --git a/uitest/reference-screenshots/firefox/TableContextMenuAndIconsTest-tableContextMenuWithIcons_ANY_Firefox__contextmenu-noicon.png b/uitest/reference-screenshots/firefox/TableContextMenuAndIconsTest-tableContextMenuWithIcons_ANY_Firefox__contextmenu-noicon.png
new file mode 100644
index 0000000000..c3ce161858
--- /dev/null
+++ b/uitest/reference-screenshots/firefox/TableContextMenuAndIconsTest-tableContextMenuWithIcons_ANY_Firefox__contextmenu-noicon.png
Binary files differ
diff --git a/uitest/reference-screenshots/firefox/TableContextMenuAndIconsTest-tableContextMenuWithIcons_ANY_Firefox__large-icon.png b/uitest/reference-screenshots/firefox/TableContextMenuAndIconsTest-tableContextMenuWithIcons_ANY_Firefox__large-icon.png
new file mode 100644
index 0000000000..8197945dc0
--- /dev/null
+++ b/uitest/reference-screenshots/firefox/TableContextMenuAndIconsTest-tableContextMenuWithIcons_ANY_Firefox__large-icon.png
Binary files differ
diff --git a/uitest/reference-screenshots/firefox/TableDropIndicatorValoTest-indicator_ANY_Firefox__indicator.png b/uitest/reference-screenshots/firefox/TableDropIndicatorValoTest-indicator_ANY_Firefox__indicator.png
new file mode 100644
index 0000000000..7f98a63f82
--- /dev/null
+++ b/uitest/reference-screenshots/firefox/TableDropIndicatorValoTest-indicator_ANY_Firefox__indicator.png
Binary files differ
diff --git a/uitest/reference-screenshots/firefox/WindowZIndexTest-removingUpdatesZIndices_ANY_Firefox__win4-on-top.png b/uitest/reference-screenshots/firefox/WindowZIndexTest-removingUpdatesZIndices_ANY_Firefox__win4-on-top.png
new file mode 100644
index 0000000000..7133485551
--- /dev/null
+++ b/uitest/reference-screenshots/firefox/WindowZIndexTest-removingUpdatesZIndices_ANY_Firefox__win4-on-top.png
Binary files differ
diff --git a/uitest/src/test/java/com/vaadin/tests/VerifyBrowserVersionTest.java b/uitest/src/test/java/com/vaadin/tests/VerifyBrowserVersionTest.java
index fc2693c13f..f7d0563441 100644
--- a/uitest/src/test/java/com/vaadin/tests/VerifyBrowserVersionTest.java
+++ b/uitest/src/test/java/com/vaadin/tests/VerifyBrowserVersionTest.java
@@ -26,6 +26,9 @@ public class VerifyBrowserVersionTest extends MultiBrowserTest {
// because of auto updates...
browserIdentifier = getExpectedUserAgentString(
getDesiredCapabilities()) + "66";
+ } else if (BrowserUtil.isFirefox(getDesiredCapabilities())) {
+ browserIdentifier = getExpectedUserAgentString(
+ getDesiredCapabilities()) + "58";
} else {
browserIdentifier = getExpectedUserAgentString(desiredCapabilities)
+ desiredCapabilities.getVersion();
diff --git a/uitest/src/test/java/com/vaadin/tests/components/abstractcomponent/ContextClickUITest.java b/uitest/src/test/java/com/vaadin/tests/components/abstractcomponent/ContextClickUITest.java
index 2dea0fbd4c..c6b6203f35 100644
--- a/uitest/src/test/java/com/vaadin/tests/components/abstractcomponent/ContextClickUITest.java
+++ b/uitest/src/test/java/com/vaadin/tests/components/abstractcomponent/ContextClickUITest.java
@@ -16,8 +16,9 @@ public class ContextClickUITest extends MultiBrowserTest {
public void testContextClick() {
openTestURL();
- new Actions(getDriver())
- .moveToElement($(UIElement.class).first(), 10, 10)
+ final UIElement uiElement = $(UIElement.class).first();
+ new Actions(getDriver()).moveToElement(uiElement,
+ getXOffset(uiElement, 10), getYOffset(uiElement, 10))
.contextClick().perform();
assertEquals("Context click not received correctly",
diff --git a/uitest/src/test/java/com/vaadin/tests/components/draganddropwrapper/DragStartModesTest.java b/uitest/src/test/java/com/vaadin/tests/components/draganddropwrapper/DragStartModesTest.java
index e23a61a8a9..2ecaa51e52 100644
--- a/uitest/src/test/java/com/vaadin/tests/components/draganddropwrapper/DragStartModesTest.java
+++ b/uitest/src/test/java/com/vaadin/tests/components/draganddropwrapper/DragStartModesTest.java
@@ -23,9 +23,13 @@ public class DragStartModesTest extends MultiBrowserTest {
private void dragToTarget(String dragMode, WebElement dropTarget)
throws IOException {
WebElement draggable = vaadinElementById("label" + dragMode);
- new Actions(driver).moveToElement(draggable, 10, 10).clickAndHold()
- .moveByOffset(5, 0).perform();
- new Actions(driver).moveToElement(dropTarget, 12, 10).perform();
+ new Actions(driver)
+ .moveToElement(draggable, getXOffset(draggable, 10),
+ getYOffset(draggable, 10))
+ .clickAndHold().moveByOffset(5, 0).perform();
+ new Actions(driver).moveToElement(dropTarget,
+ getXOffset(dropTarget, 12), getYOffset(dropTarget, 10))
+ .perform();
compareScreen("dragImageMode" + dragMode);
new Actions(driver).release().perform();
}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/embedded/EmbeddedClickListenerRelativeCoordinatesTest.java b/uitest/src/test/java/com/vaadin/tests/components/embedded/EmbeddedClickListenerRelativeCoordinatesTest.java
index 2a4f8558cc..820b07fadb 100644
--- a/uitest/src/test/java/com/vaadin/tests/components/embedded/EmbeddedClickListenerRelativeCoordinatesTest.java
+++ b/uitest/src/test/java/com/vaadin/tests/components/embedded/EmbeddedClickListenerRelativeCoordinatesTest.java
@@ -6,6 +6,7 @@ import static org.junit.Assert.assertTrue;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.By;
+import org.openqa.selenium.interactions.Actions;
import com.vaadin.testbench.elements.EmbeddedElement;
import com.vaadin.testbench.elements.LabelElement;
@@ -28,14 +29,14 @@ public class EmbeddedClickListenerRelativeCoordinatesTest
clickAt(41, 22);
checkLocation(41, 22);
- clickAt(0, 0);
- checkLocation(0, 0);
+ clickAt(1, 1);
+ checkLocation(1, 1);
}
private void clickAt(int x, int y) {
EmbeddedElement embedded = $(EmbeddedElement.class).first();
- embedded.click(x, y);
+ embedded.click(getXOffset(embedded, x), getYOffset(embedded, y));
}
private void checkLocation(int expectedX, int expectedY) {
@@ -51,9 +52,9 @@ public class EmbeddedClickListenerRelativeCoordinatesTest
// IE10 and IE11 sometimes click one pixel below the given position
int tolerance = isIE() ? 1 : 0;
- assertTrue(
+ assertEquals(
"Reported Y-coordinate from Embedded does not match click location",
- Math.abs(expectedY - y) <= tolerance);
+ expectedY, y, tolerance);
}
private boolean isIE() {
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridColumnResizingTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridColumnResizingTest.java
index a95992df23..68f427c119 100644
--- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridColumnResizingTest.java
+++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridColumnResizingTest.java
@@ -130,8 +130,9 @@ public class GridColumnResizingTest extends MultiBrowserTest {
GridCellElement headerCell = getGrid().getHeaderCell(0, columnIndex);
Dimension size = headerCell.getSize();
new Actions(getDriver())
- .moveToElement(headerCell, size.getWidth() + posX,
- size.getHeight() / 2)
+ .moveToElement(headerCell,
+ getXOffset(headerCell, size.getWidth() + posX),
+ getYOffset(headerCell, size.getHeight() / 2))
.clickAndHold().moveByOffset(offset, 0).release().perform();
}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridComponentsTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridComponentsTest.java
index 1c134f97e4..34892da664 100644
--- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridComponentsTest.java
+++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridComponentsTest.java
@@ -8,6 +8,7 @@ import java.util.Locale;
import java.util.stream.IntStream;
import java.util.stream.Stream;
+import org.junit.Assume;
import org.junit.Test;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebElement;
@@ -18,20 +19,16 @@ import com.vaadin.testbench.elements.ButtonElement;
import com.vaadin.testbench.elements.GridElement;
import com.vaadin.testbench.elements.GridElement.GridCellElement;
import com.vaadin.testbench.elements.GridElement.GridRowElement;
+import com.vaadin.testbench.parallel.BrowserUtil;
import com.vaadin.testbench.elements.LabelElement;
import com.vaadin.testbench.elements.NotificationElement;
import com.vaadin.testbench.elements.TextFieldElement;
-import com.vaadin.testbench.parallel.BrowserUtil;
import com.vaadin.tests.tb3.MultiBrowserTest;
public class GridComponentsTest extends MultiBrowserTest {
@Test
public void testReuseTextFieldOnScroll() {
- if (BrowserUtil.isPhantomJS(getDesiredCapabilities())) {
- // skip test on PhantomJS as it often crashes the browser
- return;
- }
openTestURL();
GridElement grid = $(GridElement.class).first();
editTextFieldInCell(grid, 0, 1);
@@ -54,7 +51,7 @@ public class GridComponentsTest extends MultiBrowserTest {
GridElement grid = $(GridElement.class).first();
editTextFieldInCell(grid, 1, 1);
// Select row
- grid.getCell(1, 1).click(1, 1);
+ grid.getCell(1, 0).click();
WebElement textField = grid.getCell(1, 1)
.findElement(By.tagName("input"));
@@ -186,6 +183,9 @@ public class GridComponentsTest extends MultiBrowserTest {
@Test
public void testTabNavigation() {
+ Assume.assumeFalse("Firefox has issues with Shift",
+ BrowserUtil.isFirefox(getDesiredCapabilities()));
+
openTestURL();
GridElement grid = $(GridElement.class).first();
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridHeightTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridHeightTest.java
index 1c6b36bf89..091df96087 100644
--- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridHeightTest.java
+++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridHeightTest.java
@@ -14,6 +14,7 @@ import org.junit.Test;
import org.openqa.selenium.By;
import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.testbench.elements.GridElement.GridRowElement;
import com.vaadin.testbench.elements.RadioButtonGroupElement;
import com.vaadin.testbench.parallel.TestCategory;
import com.vaadin.tests.tb3.MultiBrowserTest;
@@ -83,7 +84,8 @@ public class GridHeightTest extends MultiBrowserTest {
fail();
}
- grid.getRow(2).click(5, 5);
+ GridRowElement row = grid.getRow(2);
+ row.click(getXOffset(row, 5), getYOffset(row, 5));
waitForElementPresent(By.id("lbl1"));
int openHeight = grid.getSize().getHeight();
@@ -96,7 +98,7 @@ public class GridHeightTest extends MultiBrowserTest {
detailsRowHeight, "opened" });
}
- grid.getRow(2).click(5, 5);
+ row.click(getXOffset(row, 5), getYOffset(row, 5));
waitForElementNotPresent(By.id("lbl1"));
int afterHeight = grid.getSize().getHeight();
diff --git a/uitest/src/test/java/com/vaadin/tests/components/grid/GridResizeHiddenColumnTest.java b/uitest/src/test/java/com/vaadin/tests/components/grid/GridResizeHiddenColumnTest.java
index 6125fe2f16..1a6a03aea1 100644
--- a/uitest/src/test/java/com/vaadin/tests/components/grid/GridResizeHiddenColumnTest.java
+++ b/uitest/src/test/java/com/vaadin/tests/components/grid/GridResizeHiddenColumnTest.java
@@ -97,8 +97,9 @@ public class GridResizeHiddenColumnTest extends MultiBrowserTest {
int offset) {
Dimension size = headerCell.getSize();
new Actions(getDriver())
- .moveToElement(headerCell, size.getWidth() + posX,
- size.getHeight() / 2)
+ .moveToElement(headerCell,
+ getXOffset(headerCell, size.getWidth() + posX),
+ getYOffset(headerCell, size.getHeight() / 2))
.clickAndHold().moveByOffset(offset, 0).release().perform();
}
}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/table/ColumnReorderingWithManyColumnsTest.java b/uitest/src/test/java/com/vaadin/tests/components/table/ColumnReorderingWithManyColumnsTest.java
index 5e5773fc3f..a7a11a6e1a 100644
--- a/uitest/src/test/java/com/vaadin/tests/components/table/ColumnReorderingWithManyColumnsTest.java
+++ b/uitest/src/test/java/com/vaadin/tests/components/table/ColumnReorderingWithManyColumnsTest.java
@@ -31,9 +31,11 @@ public class ColumnReorderingWithManyColumnsTest extends MultiBrowserTest {
private void drag(WebElement source, WebElement target) {
Actions actions = new Actions(getDriver());
- actions.moveToElement(source, 10, 10);
+ actions.moveToElement(source, getXOffset(source, 10),
+ getYOffset(source, 10));
actions.clickAndHold(source);
- actions.moveToElement(target, 10, 10);
+ actions.moveToElement(target, getXOffset(target, 10),
+ getYOffset(target, 10));
actions.perform();
}
}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/table/ContextMenuSizeTest.java b/uitest/src/test/java/com/vaadin/tests/components/table/ContextMenuSizeTest.java
index 6dab60b655..2ecde5c1bc 100644
--- a/uitest/src/test/java/com/vaadin/tests/components/table/ContextMenuSizeTest.java
+++ b/uitest/src/test/java/com/vaadin/tests/components/table/ContextMenuSizeTest.java
@@ -47,8 +47,14 @@ public class ContextMenuSizeTest extends MultiBrowserTest {
}
private WebElement openContextMenu() {
+ WebElement target = findElement(By.className("v-table-cell-wrapper"));
+
+ // Make sure target is visible.
+ target.click();
+
Actions actions = new Actions(getDriver());
- actions.contextClick(findElement(By.className("v-table-cell-wrapper")));
+ actions.moveToElement(target, getXOffset(target, 1),
+ getYOffset(target, 1)).contextClick();
actions.perform();
return findElement(By.className("v-contextmenu"));
}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/textarea/TextAreaSizeResettedTest.java b/uitest/src/test/java/com/vaadin/tests/components/textarea/TextAreaSizeResettedTest.java
index e288636815..492e5c300f 100644
--- a/uitest/src/test/java/com/vaadin/tests/components/textarea/TextAreaSizeResettedTest.java
+++ b/uitest/src/test/java/com/vaadin/tests/components/textarea/TextAreaSizeResettedTest.java
@@ -70,10 +70,10 @@ public class TextAreaSizeResettedTest extends MultiBrowserTest {
private void resizeTextAreaBy(int offset) {
int resizeHandlerOffset = 10;
- new Actions(getDriver())
- .moveToElement(getTextArea(),
- TEXTAREAWIDTH - resizeHandlerOffset,
- TEXTAREAHEIGHT - resizeHandlerOffset)
+ TextAreaElement textArea = getTextArea();
+ new Actions(getDriver()).moveToElement(textArea,
+ getXOffset(textArea, TEXTAREAWIDTH - resizeHandlerOffset),
+ getYOffset(textArea, TEXTAREAHEIGHT - resizeHandlerOffset))
.clickAndHold().moveByOffset(offset, offset).release().build()
.perform();
}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/upload/UploadImmediateButtonWidthChameleonTest.java b/uitest/src/test/java/com/vaadin/tests/components/upload/UploadImmediateButtonWidthChameleonTest.java
index 7c1500ce75..17223fc670 100644
--- a/uitest/src/test/java/com/vaadin/tests/components/upload/UploadImmediateButtonWidthChameleonTest.java
+++ b/uitest/src/test/java/com/vaadin/tests/components/upload/UploadImmediateButtonWidthChameleonTest.java
@@ -17,6 +17,6 @@ public class UploadImmediateButtonWidthChameleonTest
@Test
public void immediateButtonWithUndefinedWidth() {
- assertThat(getButtonWidth("upload3"), closeTo(69, 4));
+ assertThat(getButtonWidth("upload3"), closeTo(69, 5));
}
}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/window/MaximizedWindowOrderTest.java b/uitest/src/test/java/com/vaadin/tests/components/window/MaximizedWindowOrderTest.java
index 05d8594962..abf3443da8 100644
--- a/uitest/src/test/java/com/vaadin/tests/components/window/MaximizedWindowOrderTest.java
+++ b/uitest/src/test/java/com/vaadin/tests/components/window/MaximizedWindowOrderTest.java
@@ -5,6 +5,8 @@ import static org.hamcrest.Matchers.greaterThan;
import static org.junit.Assert.assertThat;
import org.junit.Test;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.interactions.Actions;
import com.vaadin.testbench.elements.WindowElement;
import com.vaadin.testbench.elements.ButtonElement;
@@ -61,10 +63,19 @@ public class MaximizedWindowOrderTest extends MultiBrowserTest {
WindowElement anotherWindow = openAnotherWindow();
// move the window to make the maximize button visible.
- anotherWindow.move(10, 20);
+ moveWindow(anotherWindow, 10, 20);
maximizedWindow.maximize();
assertThat(maximizedWindow.getCssValue("z-index"),
is(greaterThan(anotherWindow.getCssValue("z-index"))));
}
+
+ private void moveWindow(WindowElement window, int xOffset, int yOffset) {
+ WebElement wrap = window
+ .findElement(org.openqa.selenium.By.className("v-window-wrap"));
+ new Actions(getDriver())
+ .moveToElement(wrap, getXOffset(wrap, 5), getYOffset(wrap, 5))
+ .clickAndHold().moveByOffset(xOffset, yOffset).release().build()
+ .perform();
+ }
}
diff --git a/uitest/src/test/java/com/vaadin/tests/components/window/ModalWindowRefocusTest.java b/uitest/src/test/java/com/vaadin/tests/components/window/ModalWindowRefocusTest.java
index d09d3ce027..eaf4b7e6a3 100755
--- a/uitest/src/test/java/com/vaadin/tests/components/window/ModalWindowRefocusTest.java
+++ b/uitest/src/test/java/com/vaadin/tests/components/window/ModalWindowRefocusTest.java
@@ -46,7 +46,8 @@ public class ModalWindowRefocusTest extends ModalWindowFocusTest {
waitForElementPresent(By.id("focusfield"));
WebElement curtain = findElement(
org.openqa.selenium.By.className("v-window-modalitycurtain"));
- curtain.click();
+ testBenchElement(curtain).click(getXOffset(curtain, 20),
+ getYOffset(curtain, 20));
pressKeyAndWait(Keys.TAB);
pressKeyAndWait(Keys.TAB);
diff --git a/uitest/src/test/java/com/vaadin/tests/components/window/WindowZIndexTest.java b/uitest/src/test/java/com/vaadin/tests/components/window/WindowZIndexTest.java
index 72a9199219..93aaaae2fe 100644
--- a/uitest/src/test/java/com/vaadin/tests/components/window/WindowZIndexTest.java
+++ b/uitest/src/test/java/com/vaadin/tests/components/window/WindowZIndexTest.java
@@ -39,7 +39,8 @@ public class WindowZIndexTest extends MultiBrowserTest {
WebElement window4 = driver
.findElement(By.xpath("//*[contains(text(), 'Window 4')]"));
- new Actions(driver).moveToElement(window4, 1, 9).click().perform();
+ new Actions(driver).moveToElement(window4, getXOffset(window4, 1),
+ getYOffset(window4, 9)).click().perform();
compareScreen("win4-on-top");
}
diff --git a/uitest/src/test/java/com/vaadin/tests/contextclick/AbstractContextClickTest.java b/uitest/src/test/java/com/vaadin/tests/contextclick/AbstractContextClickTest.java
index e8663a687c..e5817da952 100644
--- a/uitest/src/test/java/com/vaadin/tests/contextclick/AbstractContextClickTest.java
+++ b/uitest/src/test/java/com/vaadin/tests/contextclick/AbstractContextClickTest.java
@@ -126,7 +126,9 @@ public abstract class AbstractContextClickTest extends MultiBrowserTest {
"var ev = document.createEvent('MouseEvents'); ev.initMouseEvent('click', true, true, document.defaultView, 1, arguments[1]-5, arguments[2]-5, arguments[1]-5, arguments[2]-5, false, false, false, false, 1, null); arguments[0].dispatchEvent(ev);",
e, x, y);
} else {
- new Actions(getDriver()).moveToElement(e, xCoord, yCoord)
+ new Actions(getDriver())
+ .moveToElement(e, getXOffset(e, xCoord),
+ getYOffset(e, yCoord))
.contextClick().moveByOffset(-5, -5).click().perform();
}
}
diff --git a/uitest/src/test/java/com/vaadin/tests/contextclick/TreeContextClickTest.java b/uitest/src/test/java/com/vaadin/tests/contextclick/TreeContextClickTest.java
index 412e7593d2..0f43fb7872 100644
--- a/uitest/src/test/java/com/vaadin/tests/contextclick/TreeContextClickTest.java
+++ b/uitest/src/test/java/com/vaadin/tests/contextclick/TreeContextClickTest.java
@@ -40,8 +40,9 @@ public class TreeContextClickTest extends AbstractContextClickTest {
List<WebElement> nodes = $(TreeElement.class).first()
.findElements(By.className("v-tree-node"));
- new Actions(getDriver()).moveToElement(nodes.get(1), 10, 10).click()
- .perform();
+ new Actions(getDriver()).moveToElement(nodes.get(1),
+ getXOffset(nodes.get(1), 10), getYOffset(nodes.get(1), 10))
+ .click().perform();
nodes = $(TreeElement.class).first()
.findElements(By.className("v-tree-node"));
diff --git a/uitest/src/test/java/com/vaadin/tests/dd/DnDOnSubtreeTest.java b/uitest/src/test/java/com/vaadin/tests/dd/DnDOnSubtreeTest.java
index 0e92945190..59d0248f1e 100644
--- a/uitest/src/test/java/com/vaadin/tests/dd/DnDOnSubtreeTest.java
+++ b/uitest/src/test/java/com/vaadin/tests/dd/DnDOnSubtreeTest.java
@@ -8,6 +8,7 @@ import org.openqa.selenium.support.ui.ExpectedCondition;
import com.vaadin.testbench.By;
import com.vaadin.testbench.TestBenchElement;
+import com.vaadin.testbench.commands.TestBenchElementCommands;
import com.vaadin.tests.tb3.MultiBrowserTest;
import com.vaadin.v7.testbench.elements.TreeElement;
@@ -24,12 +25,16 @@ public class DnDOnSubtreeTest extends MultiBrowserTest {
TreeElement tree = $(TreeElement.class).first();
WebElement bar2 = tree.findElement(By.vaadin("#n[3]"));
WebElement bar5 = tree.findElement(By.vaadin("#n[6]"));
- new Actions(driver).moveToElement(bar2, 11, 8).clickAndHold()
- .moveByOffset(10, 10).perform();
+ new Actions(driver)
+ .moveToElement(bar2, getXOffset(bar2, 11), getYOffset(bar2, 8))
+ .clickAndHold().moveByOffset(10, 10).perform();
/* Drop on Bar5, which is a subtree target */
- new Actions(driver).moveToElement(bar5, 34, 9).release().perform();
- testBenchElement(tree.findElement(By.vaadin("#n[5]/expand"))).click(5,
- 5);
+ new Actions(driver)
+ .moveToElement(bar5, getXOffset(bar5, 34), getYOffset(bar5, 9))
+ .release().perform();
+ WebElement target = tree.findElement(By.vaadin("#n[5]/expand"));
+ testBenchElement(target).click(getXOffset(target, 5),
+ getYOffset(target, 5));
/* Assert that the dragged & dropped node is now a child of Bar5 */
waitUntilElementPresent(tree, "#n[5]/n[0]");
}
diff --git a/uitest/src/test/java/com/vaadin/tests/extensions/ResponsiveUITest.java b/uitest/src/test/java/com/vaadin/tests/extensions/ResponsiveUITest.java
index cd37ba6248..7287372adb 100644
--- a/uitest/src/test/java/com/vaadin/tests/extensions/ResponsiveUITest.java
+++ b/uitest/src/test/java/com/vaadin/tests/extensions/ResponsiveUITest.java
@@ -7,7 +7,6 @@ import org.junit.Test;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.support.ui.ExpectedConditions;
-import org.openqa.selenium.support.ui.WebDriverWait;
import com.vaadin.testbench.By;
import com.vaadin.tests.tb3.MultiBrowserTest;
diff --git a/uitest/src/test/java/com/vaadin/tests/fieldgroup/BasicPersonFormTest.java b/uitest/src/test/java/com/vaadin/tests/fieldgroup/BasicPersonFormTest.java
index 25bd5c7cdd..1baccbb5bc 100644
--- a/uitest/src/test/java/com/vaadin/tests/fieldgroup/BasicPersonFormTest.java
+++ b/uitest/src/test/java/com/vaadin/tests/fieldgroup/BasicPersonFormTest.java
@@ -12,7 +12,9 @@ import com.vaadin.testbench.elements.TableRowElement;
import com.vaadin.testbench.elements.TextAreaElement;
import com.vaadin.testbench.elements.TextFieldElement;
import com.vaadin.tests.data.bean.Sex;
+import com.vaadin.tests.tb3.AbstractTB3Test;
import com.vaadin.tests.tb3.MultiBrowserTest;
+import com.vaadin.tests.tb3.PrivateTB3Configuration;
public abstract class BasicPersonFormTest extends MultiBrowserTest {
@@ -24,6 +26,9 @@ public abstract class BasicPersonFormTest extends MultiBrowserTest {
super.setup();
logCounter = 0;
+
+ // Use larger view port to make sure everything is visible.
+ testBench().resizeViewPortTo(1500, 1500);
}
@Override
diff --git a/uitest/src/test/java/com/vaadin/tests/layouts/TestLayoutClickListenersTest.java b/uitest/src/test/java/com/vaadin/tests/layouts/TestLayoutClickListenersTest.java
index eb1ef85318..1209e6910e 100644
--- a/uitest/src/test/java/com/vaadin/tests/layouts/TestLayoutClickListenersTest.java
+++ b/uitest/src/test/java/com/vaadin/tests/layouts/TestLayoutClickListenersTest.java
@@ -42,7 +42,7 @@ public class TestLayoutClickListenersTest extends MultiBrowserTest {
"2. GridLayout: left click on This is tf5");
// click on the layout body (not any component inside the layout)
- layout.click(130, 41);
+ layout.click(getXOffset(layout, 130), getYOffset(layout, 41));
assertLogText("GridLayout body clicked",
"3. GridLayout: left click on <none>");
}
@@ -99,17 +99,22 @@ public class TestLayoutClickListenersTest extends MultiBrowserTest {
GridLayoutElement layout = $(GridLayoutElement.class).first();
// Drag inside the first label in this layout
+ LabelElement label = layout.$(LabelElement.class).first();
new Actions(getDriver())
- .moveToElement(layout.$(LabelElement.class).first(), 40, 8)
+ .moveToElement(label, getXOffset(label, 40),
+ getYOffset(label, 8))
.clickAndHold().moveByOffset(-20, 0).release().perform();
assertLogText("Mouse dragged in GridLayout",
"1. GridLayout: left click on This is label 1");
// Drag from the third label to a text field in this layout
+ label = layout.$(LabelElement.class).get(2);
+ TextFieldElement textField = layout.$(TextFieldElement.class).get(3);
new Actions(getDriver())
- .moveToElement(layout.$(LabelElement.class).get(2), 40, 8)
- .clickAndHold()
- .moveToElement(layout.$(TextFieldElement.class).get(3), 46, 33)
+ .moveToElement(label, getXOffset(label, 40),
+ getYOffset(label, 8))
+ .clickAndHold().moveToElement(textField,
+ getXOffset(textField, 46), getYOffset(textField, 33))
.release().perform();
assertLogText("Expected the drag to be ignored between elements",
"1. GridLayout: left click on This is label 1");
@@ -120,17 +125,21 @@ public class TestLayoutClickListenersTest extends MultiBrowserTest {
VerticalLayoutElement layout = $(VerticalLayoutElement.class).get(4);
// Drag inside the first text field
+ TextFieldElement textField = layout.$(TextFieldElement.class).first();
new Actions(getDriver())
- .moveToElement(layout.$(TextFieldElement.class).first(), 25, 9)
+ .moveToElement(textField, getXOffset(textField, 25),
+ getYOffset(textField, 9))
.clickAndHold().moveByOffset(-20, 0).release().perform();
assertLogText("Mouse dragged in VerticalLayout",
"1. VerticalLayout: left click on This is tf5");
// Drag from a caption to its text field
+ textField = layout.$(TextFieldElement.class).get(4);
new Actions(getDriver())
- .moveToElement(layout.$(TextFieldElement.class).get(4), 28, 11)
- .clickAndHold()
- .moveToElement(layout.$(TextFieldElement.class).get(4), 39, 30)
+ .moveToElement(textField, getXOffset(textField, 28),
+ getYOffset(textField, 11))
+ .clickAndHold().moveToElement(textField,
+ getXOffset(textField, 39), getYOffset(textField, 30))
.release().perform();
assertLogText("Expected the drag to be ignored between elements",
"1. VerticalLayout: left click on This is tf5");
@@ -141,17 +150,24 @@ public class TestLayoutClickListenersTest extends MultiBrowserTest {
AbsoluteLayoutElement layout = $(AbsoluteLayoutElement.class).first();
// Drag inside the first text field's caption
+ TextFieldElement firstTextField = layout.$(TextFieldElement.class)
+ .first();
new Actions(getDriver())
- .moveToElement(layout.$(TextFieldElement.class).first(), 21, 9)
+ .moveToElement(firstTextField, getXOffset(firstTextField, 21),
+ getYOffset(firstTextField, 9))
.clickAndHold().moveByOffset(-10, 0).release().perform();
assertLogText("Mouse dragged in AbsoluteLayout",
"1. AbsoluteLayout: left click on This is its caption");
// Drag from a text field to another text field
+ TextFieldElement otherTextField = layout.$(TextFieldElement.class)
+ .get(1);
new Actions(getDriver())
- .moveToElement(layout.$(TextFieldElement.class).get(1), 54, 7)
+ .moveToElement(otherTextField, getXOffset(otherTextField, 54),
+ getYOffset(otherTextField, 7))
.clickAndHold()
- .moveToElement(layout.$(TextFieldElement.class).first(), 52, 10)
+ .moveToElement(firstTextField, getXOffset(firstTextField, 52),
+ getYOffset(firstTextField, 10))
.release().perform();
assertLogText("Expected the drag to be ignored between elements",
"1. AbsoluteLayout: left click on This is its caption");
@@ -162,17 +178,24 @@ public class TestLayoutClickListenersTest extends MultiBrowserTest {
CssLayoutElement layout = $(CssLayoutElement.class).first();
// Drag inside the first text field's caption
+ TextFieldElement firstTextField = layout.$(TextFieldElement.class)
+ .first();
new Actions(getDriver())
- .moveToElement(layout.$(TextFieldElement.class).first(), 51, 7)
+ .moveToElement(firstTextField, getXOffset(firstTextField, 51),
+ getYOffset(firstTextField, 7))
.clickAndHold().moveByOffset(-20, 0).release().perform();
assertLogText("Mouse dragged in CSSLayout",
"1. CSSLayout: left click on This is its caption");
// Drag from the first text field to the second text field
+ TextFieldElement otherTextField = layout.$(TextFieldElement.class)
+ .get(1);
new Actions(getDriver())
- .moveToElement(layout.$(TextFieldElement.class).first(), 51, 27)
+ .moveToElement(firstTextField, getXOffset(firstTextField, 51),
+ getYOffset(firstTextField, 27))
.clickAndHold()
- .moveToElement(layout.$(TextFieldElement.class).get(1), 51, 27)
+ .moveToElement(otherTextField, getXOffset(otherTextField, 51),
+ getYOffset(otherTextField, 27))
.release().perform();
assertLogText("Expected the drag to be ignored between elements",
"1. CSSLayout: left click on This is its caption");
diff --git a/uitest/src/test/java/com/vaadin/tests/resources/FrontendInitialResourceUITest.java b/uitest/src/test/java/com/vaadin/tests/resources/FrontendInitialResourceUITest.java
index 7f2748461c..45b386a73e 100644
--- a/uitest/src/test/java/com/vaadin/tests/resources/FrontendInitialResourceUITest.java
+++ b/uitest/src/test/java/com/vaadin/tests/resources/FrontendInitialResourceUITest.java
@@ -14,9 +14,7 @@ public class FrontendInitialResourceUITest extends MultiBrowserTest {
public void correctEs5Es6FileImportedThroughFrontend() {
openTestURL();
String es;
- if (BrowserUtil.isIE(getDesiredCapabilities())
- || BrowserUtil.isPhantomJS(getDesiredCapabilities())
- || BrowserUtil.isFirefox(getDesiredCapabilities())) {
+ if (BrowserUtil.isIE(getDesiredCapabilities())) {
es = "es5";
} else {
es = "es6";
diff --git a/uitest/src/test/java/com/vaadin/tests/resources/FrontendLaterLoadedResourceUITest.java b/uitest/src/test/java/com/vaadin/tests/resources/FrontendLaterLoadedResourceUITest.java
index 36f70948a4..bc3d5aa7e0 100644
--- a/uitest/src/test/java/com/vaadin/tests/resources/FrontendLaterLoadedResourceUITest.java
+++ b/uitest/src/test/java/com/vaadin/tests/resources/FrontendLaterLoadedResourceUITest.java
@@ -15,9 +15,7 @@ public class FrontendLaterLoadedResourceUITest extends MultiBrowserTest {
openTestURL();
$(ButtonElement.class).first().click();
String es;
- if (BrowserUtil.isIE(getDesiredCapabilities())
- || BrowserUtil.isPhantomJS(getDesiredCapabilities())
- || BrowserUtil.isFirefox(getDesiredCapabilities())) {
+ if (BrowserUtil.isIE(getDesiredCapabilities())) {
es = "es5";
} else {
es = "es6";
diff --git a/uitest/src/test/java/com/vaadin/tests/tb3/AbstractTB3Test.java b/uitest/src/test/java/com/vaadin/tests/tb3/AbstractTB3Test.java
index 9fe174ebe0..1e093cf7f4 100644
--- a/uitest/src/test/java/com/vaadin/tests/tb3/AbstractTB3Test.java
+++ b/uitest/src/test/java/com/vaadin/tests/tb3/AbstractTB3Test.java
@@ -1189,6 +1189,48 @@ public abstract class AbstractTB3Test extends ParallelTest {
}
/**
+ * Gets the X offset for
+ * {@link Actions#moveToElement(WebElement, int, int)}. This method takes
+ * into account the W3C specification in browsers that properly implement
+ * it.
+ *
+ * @param element
+ * the element
+ * @param targetX
+ * the X coordinate where the move is wanted to go to
+ * @return the correct X offset
+ */
+ protected int getXOffset(WebElement element, int targetX) {
+ if (BrowserUtil.isFirefox(getDesiredCapabilities())) {
+ // Firefox follow W3C spec and moveToElement is relative to center
+ final int width = element.getSize().getWidth();
+ return targetX - ((width + width % 2) / 2);
+ }
+ return targetX;
+ }
+
+ /**
+ * Gets the Y offset for
+ * {@link Actions#moveToElement(WebElement, int, int)}. This method takes
+ * into account the W3C specification in browsers that properly implement
+ * it.
+ *
+ * @param element
+ * the element
+ * @param targetY
+ * the Y coordinate where the move is wanted to go to
+ * @return the correct Y offset
+ */
+ protected int getYOffset(WebElement element, int targetY) {
+ if (BrowserUtil.isFirefox(getDesiredCapabilities())) {
+ // Firefox follow W3C spec and moveToElement is relative to center
+ final int height = element.getSize().getHeight();
+ return targetY - ((height + height % 2) / 2);
+ }
+ return targetY;
+ }
+
+ /**
* Returns client height rounded up instead of as double because of IE9
* issues: https://dev.vaadin.com/ticket/18469
*/
diff --git a/uitest/src/test/java/com/vaadin/tests/themes/valo/ContrastFontColorTest.java b/uitest/src/test/java/com/vaadin/tests/themes/valo/ContrastFontColorTest.java
index 9eafe62798..2315050335 100644
--- a/uitest/src/test/java/com/vaadin/tests/themes/valo/ContrastFontColorTest.java
+++ b/uitest/src/test/java/com/vaadin/tests/themes/valo/ContrastFontColorTest.java
@@ -5,14 +5,14 @@ import static org.junit.Assert.assertEquals;
import org.junit.Test;
import com.vaadin.testbench.elements.TextFieldElement;
-import com.vaadin.tests.tb3.MultiBrowserTest;
+import com.vaadin.tests.tb3.SingleBrowserTest;
/**
* Test for default contrast color variable in valo-font-color function.
*
* @author Vaadin Ltd
*/
-public class ContrastFontColorTest extends MultiBrowserTest {
+public class ContrastFontColorTest extends SingleBrowserTest {
@Test
public void testTextColor() {