diff options
author | Teemu Suo-Anttila <teemusa@vaadin.com> | 2015-11-05 16:12:00 +0200 |
---|---|---|
committer | Teemu Suo-Anttila <teemusa@vaadin.com> | 2015-11-24 12:39:27 +0000 |
commit | 6e4ce712ecebe0c8f012a119db07de0e5ff3c740 (patch) | |
tree | bb556780a5dace4ac41f72e9cd223828f8a9e162 /uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java | |
parent | 90e3121453e23c00648942eb21f7354d9f198065 (diff) | |
download | vaadin-framework-6e4ce712ecebe0c8f012a119db07de0e5ff3c740.tar.gz vaadin-framework-6e4ce712ecebe0c8f012a119db07de0e5ff3c740.zip |
Move capability handling from MultiBrowserTest to super class
Capabilities should be set the same way in SingleBrowserTests as well,
not just MultiBrowserTests.
Change-Id: Ifed8534b87bbe45fd90fe0e7110e26a5344c5540
Diffstat (limited to 'uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java')
-rw-r--r-- | uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java b/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java index 7df65829ae..227ef4a84f 100644 --- a/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java +++ b/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java @@ -22,16 +22,19 @@ import java.io.IOException; import java.net.InetAddress; import java.net.NetworkInterface; import java.net.SocketException; +import java.util.Calendar; import java.util.Enumeration; import java.util.Properties; import org.junit.Assert; +import org.openqa.selenium.ie.InternetExplorerDriver; import org.openqa.selenium.remote.DesiredCapabilities; import com.vaadin.testbench.annotations.BrowserFactory; import com.vaadin.testbench.annotations.RunLocally; import com.vaadin.testbench.annotations.RunOnHub; import com.vaadin.testbench.parallel.Browser; +import com.vaadin.testbench.parallel.BrowserUtil; /** * Provides values for parameters which depend on where the test is run. @@ -97,6 +100,35 @@ public abstract class PrivateTB3Configuration extends ScreenshotTB3Test { super.setup(); } + @Override + public void setDesiredCapabilities(DesiredCapabilities desiredCapabilities) { + super.setDesiredCapabilities(desiredCapabilities); + + if (BrowserUtil.isIE(desiredCapabilities)) { + if (requireWindowFocusForIE()) { + desiredCapabilities.setCapability( + InternetExplorerDriver.REQUIRE_WINDOW_FOCUS, true); + } + if (!usePersistentHoverForIE()) { + desiredCapabilities.setCapability( + InternetExplorerDriver.ENABLE_PERSISTENT_HOVERING, + false); + } + if (!useNativeEventsForIE()) { + desiredCapabilities.setCapability( + InternetExplorerDriver.NATIVE_EVENTS, false); + } + } + + desiredCapabilities.setCapability("project", "Vaadin Framework"); + desiredCapabilities.setCapability("build", String.format("%s / %s", + getDeploymentHostname(), Calendar.getInstance().getTime())); + desiredCapabilities.setCapability( + "name", + String.format("%s.%s", getClass().getCanonicalName(), + testName.getMethodName())); + } + protected static DesiredCapabilities getRunLocallyCapabilities() { VaadinBrowserFactory factory = new VaadinBrowserFactory(); try { |