From 6e4ce712ecebe0c8f012a119db07de0e5ff3c740 Mon Sep 17 00:00:00 2001 From: Teemu Suo-Anttila Date: Thu, 5 Nov 2015 16:12:00 +0200 Subject: 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 --- .../src/com/vaadin/tests/tb3/MultiBrowserTest.java | 32 ---------------------- .../vaadin/tests/tb3/PrivateTB3Configuration.java | 32 ++++++++++++++++++++++ 2 files changed, 32 insertions(+), 32 deletions(-) (limited to 'uitest/src/com/vaadin') diff --git a/uitest/src/com/vaadin/tests/tb3/MultiBrowserTest.java b/uitest/src/com/vaadin/tests/tb3/MultiBrowserTest.java index d1af903cee..9bb146b8e4 100644 --- a/uitest/src/com/vaadin/tests/tb3/MultiBrowserTest.java +++ b/uitest/src/com/vaadin/tests/tb3/MultiBrowserTest.java @@ -17,14 +17,11 @@ package com.vaadin.tests.tb3; import java.util.ArrayList; -import java.util.Calendar; import java.util.List; -import org.openqa.selenium.ie.InternetExplorerDriver; import org.openqa.selenium.remote.DesiredCapabilities; import com.vaadin.testbench.parallel.Browser; -import com.vaadin.testbench.parallel.BrowserUtil; /** * Base class for tests which should be run on all supported browsers. The test @@ -82,35 +79,6 @@ public abstract class MultiBrowserTest extends PrivateTB3Configuration { Browser.FIREFOX, Browser.CHROME); } - @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())); - } - @Override public List getBrowsersToTest() { // Uncomment Safari and Opera if those become tested browsers again. 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 { -- cgit v1.2.3