]> source.dussan.org Git - vaadin-framework.git/commitdiff
Convinience methods for getting mouse and keyboard in test.
authorJohn Ahlroos <john@vaadin.com>
Tue, 14 Jan 2014 07:39:34 +0000 (09:39 +0200)
committerJohn Ahlroos <john@vaadin.com>
Tue, 14 Jan 2014 07:39:34 +0000 (09:39 +0200)
Change-Id: Ic54887c252ba452bb841f7ae2da362235d4f924b

uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java

index f6fce18fae655956308c175b48bb1f811edb309b..7a214bd60cc2afcb0f0542af412683368d8c55d7 100644 (file)
@@ -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();
+    }
+
 }