From 89d860c6b0c8ab02d5c8f3e3f5405a832a43cdb7 Mon Sep 17 00:00:00 2001 From: John Ahlroos Date: Tue, 14 Jan 2014 09:39:34 +0200 Subject: Convinience methods for getting mouse and keyboard in test. Change-Id: Ic54887c252ba452bb841f7ae2da362235d4f924b --- .../src/com/vaadin/tests/tb3/AbstractTB3Test.java | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) 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(); + } + } -- cgit v1.2.3