summaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2014-08-11 13:43:53 +0300
committerVaadin Code Review <review@vaadin.com>2014-08-14 07:46:21 +0000
commitc8e6c343483c4b4eaaa5b2a20b8c174c3b6c5f84 (patch)
treecb167a1bc1595dc7f03a0bc5d08905bdd3d400f3 /uitest
parent52b98ccd173682355af9396ce216ce5a98993194 (diff)
downloadvaadin-framework-c8e6c343483c4b4eaaa5b2a20b8c174c3b6c5f84.tar.gz
vaadin-framework-c8e6c343483c4b4eaaa5b2a20b8c174c3b6c5f84.zip
Support setting persistent hover and require window focus parameters
Change-Id: I0b2bb3fba1a8a854799fd087601ba54988ec423b
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java38
1 files changed, 38 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java b/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java
index e463f666d9..6c37e7b950 100644
--- a/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java
+++ b/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java
@@ -233,6 +233,15 @@ public abstract class AbstractTB3Test extends TestBenchTestCase {
*/
private void setupRemoteDriver(DesiredCapabilities capabilities)
throws Exception {
+ if (BrowserUtil.isIE(capabilities)) {
+ capabilities.setCapability(
+ InternetExplorerDriver.REQUIRE_WINDOW_FOCUS,
+ requireWindowFocusForIE());
+ capabilities.setCapability(
+ InternetExplorerDriver.ENABLE_PERSISTENT_HOVERING,
+ usePersistentHoverForIE());
+ }
+
for (int i = 1; i <= BROWSER_INIT_ATTEMPTS; i++) {
try {
WebDriver dr = TestBench.createDriver(new RemoteWebDriver(
@@ -1128,4 +1137,33 @@ public abstract class AbstractTB3Test extends TestBenchTestCase {
return findElement(By.xpath("//button[@title='Debug message log']"));
}
+ /**
+ * Should the "require window focus" be enabled for Internet Explorer.
+ * RequireWindowFocus makes tests more stable but seems to be broken with
+ * certain commands such as sendKeys. Therefore it is not enabled by default
+ * for all tests
+ *
+ * @return true, to use the "require window focus" feature, false otherwise
+ */
+ protected boolean requireWindowFocusForIE() {
+ return false;
+ }
+
+ /**
+ * Should the "enable persistent hover" be enabled for Internet Explorer.
+ *
+ * Persistent hovering causes continuous firing of mouse over events at the
+ * last location the mouse cursor has been moved to. This is to avoid
+ * problems where the real mouse cursor is inside the browser window and
+ * Internet Explorer uses that location for some undefined operation
+ * (http://
+ * jimevansmusic.blogspot.fi/2012/06/whats-wrong-with-internet-explorer
+ * .html)
+ *
+ * @return true, to use the "persistent hover" feature, false otherwise
+ */
+ protected boolean usePersistentHoverForIE() {
+ return true;
+ }
+
}