diff options
author | Teemu Suo-Anttila <teemusa@vaadin.com> | 2015-10-07 12:43:12 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2015-10-07 12:45:54 +0000 |
commit | ec8f3e9bc6955e9916e297b74a12b4a431b69928 (patch) | |
tree | 7c655959d75d63d0fba5c59814842a26eccd2cdc | |
parent | 548ee39a92ae3f148940e47cccc13d9679572b53 (diff) | |
download | vaadin-framework-ec8f3e9bc6955e9916e297b74a12b4a431b69928.tar.gz vaadin-framework-ec8f3e9bc6955e9916e297b74a12b4a431b69928.zip |
Use synthetic javascript events for IE browsers in context click tests
Change-Id: Ifdfac8f2088042e2eeb4618b66a9e4dc315f7e24
8 files changed, 25 insertions, 27 deletions
diff --git a/uitest/src/com/vaadin/tests/application/CriticalNotificationsTest.java b/uitest/src/com/vaadin/tests/application/CriticalNotificationsTest.java index 6115937054..6229edc1ee 100644 --- a/uitest/src/com/vaadin/tests/application/CriticalNotificationsTest.java +++ b/uitest/src/com/vaadin/tests/application/CriticalNotificationsTest.java @@ -20,13 +20,19 @@ import org.junit.Test; import com.vaadin.testbench.elements.ButtonElement; import com.vaadin.testbench.elements.CheckBoxElement; import com.vaadin.testbench.elements.NotificationElement; +import com.vaadin.testbench.parallel.BrowserUtil; import com.vaadin.tests.tb3.MultiBrowserThemeTest; public class CriticalNotificationsTest extends MultiBrowserThemeTest { @Override - protected boolean useNativeEventsForIE11() { - return false; + protected boolean useNativeEventsForIE() { + if (BrowserUtil.isIE(getDesiredCapabilities(), 11)) { + // Use JavaScript events only for IE11 + return false; + } else { + return true; + } } @Test diff --git a/uitest/src/com/vaadin/tests/contextclick/AbstractContextClickTest.java b/uitest/src/com/vaadin/tests/contextclick/AbstractContextClickTest.java index ce97c87b75..cff063db5f 100644 --- a/uitest/src/com/vaadin/tests/contextclick/AbstractContextClickTest.java +++ b/uitest/src/com/vaadin/tests/contextclick/AbstractContextClickTest.java @@ -22,6 +22,7 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import org.junit.Assert; +import org.junit.Before; import org.junit.Test; import org.openqa.selenium.Point; import org.openqa.selenium.WebElement; @@ -40,14 +41,22 @@ public abstract class AbstractContextClickTest extends MultiBrowserTest { .compile("[0-9]+. ContextClickEvent: [(]([0-9]+), ([0-9]+)[)]"); @Override + protected boolean useNativeEventsForIE() { + return false; + } + + @Override public List<DesiredCapabilities> getBrowsersToTest() { return getBrowsersSupportingContextMenu(); } - @Test - public void testDefaultListener() { + @Before + public void setUp() { openTestURL(); + } + @Test + public void testDefaultListener() { addOrRemoveDefaultListener(); assertDefaultContextClickListener(1); diff --git a/uitest/src/com/vaadin/tests/contextclick/GridContextClickTest.java b/uitest/src/com/vaadin/tests/contextclick/GridContextClickTest.java index c4a67f5fc8..25847f8bf2 100644 --- a/uitest/src/com/vaadin/tests/contextclick/GridContextClickTest.java +++ b/uitest/src/com/vaadin/tests/contextclick/GridContextClickTest.java @@ -24,8 +24,6 @@ import com.vaadin.testbench.elements.GridElement; public class GridContextClickTest extends AbstractContextClickTest { @Test public void testBodyContextClickWithTypedListener() { - openTestURL(); - addOrRemoveTypedListener(); contextClick($(GridElement.class).first().getCell(0, 0)); @@ -43,8 +41,6 @@ public class GridContextClickTest extends AbstractContextClickTest { @Test public void testHeaderContextClickWithTypedListener() { - openTestURL(); - addOrRemoveTypedListener(); contextClick($(GridElement.class).first().getHeaderCell(0, 0)); @@ -62,8 +58,6 @@ public class GridContextClickTest extends AbstractContextClickTest { @Test public void testFooterContextClickWithTypedListener() { - openTestURL(); - addOrRemoveTypedListener(); contextClick($(GridElement.class).first().getFooterCell(0, 0)); diff --git a/uitest/src/com/vaadin/tests/contextclick/ListenerAddAndRemoveTest.java b/uitest/src/com/vaadin/tests/contextclick/ListenerAddAndRemoveTest.java index 01fbd87d74..dd1d3ebd53 100644 --- a/uitest/src/com/vaadin/tests/contextclick/ListenerAddAndRemoveTest.java +++ b/uitest/src/com/vaadin/tests/contextclick/ListenerAddAndRemoveTest.java @@ -21,8 +21,6 @@ public class ListenerAddAndRemoveTest extends TableContextClickTestBase { @Test public void testAddAndRemoveListeners() { - openTestURL(); - // Add typed listener addOrRemoveTypedListener(); diff --git a/uitest/src/com/vaadin/tests/contextclick/TableContextClick.java b/uitest/src/com/vaadin/tests/contextclick/TableContextClick.java index 8d75dd61c0..d8816f4bdc 100644 --- a/uitest/src/com/vaadin/tests/contextclick/TableContextClick.java +++ b/uitest/src/com/vaadin/tests/contextclick/TableContextClick.java @@ -29,6 +29,7 @@ public class TableContextClick extends Table table = new Table(); table.setContainerDataSource(PersonContainer.createWithTestData()); table.setFooterVisible(true); + table.setHeight("400px"); return table; } diff --git a/uitest/src/com/vaadin/tests/contextclick/TableContextClickTest.java b/uitest/src/com/vaadin/tests/contextclick/TableContextClickTest.java index 51efbf9498..e7e716a02f 100644 --- a/uitest/src/com/vaadin/tests/contextclick/TableContextClickTest.java +++ b/uitest/src/com/vaadin/tests/contextclick/TableContextClickTest.java @@ -25,8 +25,6 @@ public class TableContextClickTest extends TableContextClickTestBase { @Test public void testBodyContextClickWithTypedListener() { - openTestURL(); - addOrRemoveTypedListener(); assertTypedContextClickListener(1); @@ -34,8 +32,6 @@ public class TableContextClickTest extends TableContextClickTestBase { @Test public void testHeaderContextClickWithTypedListener() { - openTestURL(); - addOrRemoveTypedListener(); contextClick($(TableElement.class).first().getHeaderCell(0)); @@ -53,8 +49,6 @@ public class TableContextClickTest extends TableContextClickTestBase { @Test public void testFooterContextClickWithTypedListener() { - openTestURL(); - addOrRemoveTypedListener(); contextClick($(TableElement.class).first().getFooterCell(0)); diff --git a/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java b/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java index 00b861f705..5572c79ff5 100644 --- a/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java +++ b/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java @@ -905,7 +905,7 @@ public abstract class AbstractTB3Test extends ParallelTest { } /** - * Should the "native events" be enabled for Internet Explorer 11. + * Should the "native events" be enabled for Internet Explorer. * <p> * Native events sometimes cause failure in clicking on buttons/checkboxes * but are possibly needed for some operations. @@ -913,7 +913,7 @@ public abstract class AbstractTB3Test extends ParallelTest { * @return true, to use "native events", false to use generated Javascript * events */ - protected boolean useNativeEventsForIE11() { + protected boolean useNativeEventsForIE() { return true; } diff --git a/uitest/src/com/vaadin/tests/tb3/MultiBrowserTest.java b/uitest/src/com/vaadin/tests/tb3/MultiBrowserTest.java index fe2c12e8af..d1af903cee 100644 --- a/uitest/src/com/vaadin/tests/tb3/MultiBrowserTest.java +++ b/uitest/src/com/vaadin/tests/tb3/MultiBrowserTest.java @@ -96,13 +96,9 @@ public abstract class MultiBrowserTest extends PrivateTB3Configuration { InternetExplorerDriver.ENABLE_PERSISTENT_HOVERING, false); } - if (BrowserUtil.isIE(desiredCapabilities, 11)) { - // Only for IE 11 for now, can be expanded to other versions if - // they have the same problems - if (!useNativeEventsForIE11()) { - desiredCapabilities.setCapability( - InternetExplorerDriver.NATIVE_EVENTS, false); - } + if (!useNativeEventsForIE()) { + desiredCapabilities.setCapability( + InternetExplorerDriver.NATIVE_EVENTS, false); } } |