aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Ahlroos <john@vaadin.com>2014-01-14 09:39:34 +0200
committerJohn Ahlroos <john@vaadin.com>2014-01-14 09:39:34 +0200
commit89d860c6b0c8ab02d5c8f3e3f5405a832a43cdb7 (patch)
treead953af291f0078b8fd34a97f154a3fd67bca07d
parent3595685b81779e7c10fc3f2d9fe9b1e35d4f39d2 (diff)
downloadvaadin-framework-89d860c6b0c8ab02d5c8f3e3f5405a832a43cdb7.tar.gz
vaadin-framework-89d860c6b0c8ab02d5c8f3e3f5405a832a43cdb7.zip
Convinience methods for getting mouse and keyboard in test.
Change-Id: Ic54887c252ba452bb841f7ae2da362235d4f924b
-rw-r--r--uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java b/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java
index f6fce18fae..7a214bd60c 100644
--- a/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java
+++ b/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java
@@ -31,6 +31,9 @@ import org.openqa.selenium.By;
import org.openqa.selenium.Platform;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
+import org.openqa.selenium.interactions.HasInputDevices;
+import org.openqa.selenium.interactions.Keyboard;
+import org.openqa.selenium.interactions.Mouse;
import org.openqa.selenium.remote.BrowserType;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
@@ -891,4 +894,22 @@ public abstract class AbstractTB3Test extends TestBenchTestCase {
}
+ /**
+ * Returns the mouse object for doing mouse commands
+ *
+ * @return Returns the mouse
+ */
+ public Mouse getMouse() {
+ return ((HasInputDevices) getDriver()).getMouse();
+ }
+
+ /**
+ * Returns the keyboard object for controlling keyboard events
+ *
+ * @return Return the keyboard
+ */
+ public Keyboard getKeyboard() {
+ return ((HasInputDevices) getDriver()).getKeyboard();
+ }
+
}