summaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2014-08-21 11:38:22 +0300
committerLeif Åstrand <leif@vaadin.com>2014-08-29 15:28:10 +0300
commitc4935487a28e2a8a1226ebcfbfeb453e05f9fbe6 (patch)
tree729c82cf232f4458442d302281a55ce5c1e1c59f /uitest
parentf2ee01abeb0603236d512cb9fffcf476fc880fc8 (diff)
downloadvaadin-framework-c4935487a28e2a8a1226ebcfbfeb453e05f9fbe6.tar.gz
vaadin-framework-c4935487a28e2a8a1226ebcfbfeb453e05f9fbe6.zip
Do not automatically change DesiredCapabilities so equals works the way tests expect
Change-Id: I573f0a7f8544742396fcd5927bc3292350754c6d
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/com/vaadin/tests/components/table/CtrlShiftMultiselectTest.java7
-rw-r--r--uitest/src/com/vaadin/tests/components/table/SelectAllRowsTest.java9
-rw-r--r--uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java37
3 files changed, 33 insertions, 20 deletions
diff --git a/uitest/src/com/vaadin/tests/components/table/CtrlShiftMultiselectTest.java b/uitest/src/com/vaadin/tests/components/table/CtrlShiftMultiselectTest.java
index 255a798594..026d672044 100644
--- a/uitest/src/com/vaadin/tests/components/table/CtrlShiftMultiselectTest.java
+++ b/uitest/src/com/vaadin/tests/components/table/CtrlShiftMultiselectTest.java
@@ -40,11 +40,8 @@ public class CtrlShiftMultiselectTest extends MultiBrowserTest {
}
@Override
- protected DesiredCapabilities getDesiredCapabilities() {
- DesiredCapabilities cap = new DesiredCapabilities(
- super.getDesiredCapabilities());
- cap.setCapability("requireWindowFocus", true);
- return cap;
+ protected boolean requireWindowFocusForIE() {
+ return true;
}
@Test
diff --git a/uitest/src/com/vaadin/tests/components/table/SelectAllRowsTest.java b/uitest/src/com/vaadin/tests/components/table/SelectAllRowsTest.java
index 0fc09adf40..d4e8441757 100644
--- a/uitest/src/com/vaadin/tests/components/table/SelectAllRowsTest.java
+++ b/uitest/src/com/vaadin/tests/components/table/SelectAllRowsTest.java
@@ -35,14 +35,9 @@ import com.vaadin.tests.tb3.MultiBrowserTest;
public class SelectAllRowsTest extends MultiBrowserTest {
- private final static String TABLE_ROW = "v-table-row";
-
@Override
- protected DesiredCapabilities getDesiredCapabilities() {
- DesiredCapabilities cap = new DesiredCapabilities(
- super.getDesiredCapabilities());
- cap.setCapability("requireWindowFocus", true);
- return cap;
+ protected boolean requireWindowFocusForIE() {
+ return true;
}
@Override
diff --git a/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java b/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java
index b892fbe4a0..02913f59a1 100644
--- a/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java
+++ b/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java
@@ -252,12 +252,15 @@ public abstract class AbstractTB3Test extends TestBenchTestCase {
private void setupRemoteDriver(DesiredCapabilities capabilities)
throws Exception {
if (BrowserUtil.isIE(capabilities)) {
- capabilities.setCapability(
- InternetExplorerDriver.REQUIRE_WINDOW_FOCUS,
- requireWindowFocusForIE());
- capabilities.setCapability(
- InternetExplorerDriver.ENABLE_PERSISTENT_HOVERING,
- usePersistentHoverForIE());
+ if (requireWindowFocusForIE()) {
+ capabilities.setCapability(
+ InternetExplorerDriver.REQUIRE_WINDOW_FOCUS, true);
+ }
+ if (!usePersistentHoverForIE()) {
+ capabilities.setCapability(
+ InternetExplorerDriver.ENABLE_PERSISTENT_HOVERING,
+ false);
+ }
}
for (int i = 1; i <= BROWSER_INIT_ATTEMPTS; i++) {
@@ -381,7 +384,10 @@ public abstract class AbstractTB3Test extends TestBenchTestCase {
* @param desiredCapabilities
*/
public void setDesiredCapabilities(DesiredCapabilities desiredCapabilities) {
- this.desiredCapabilities = desiredCapabilities;
+ // Make a copy as the desired capabilities can come from a shared,
+ // static resource. This will cause all kinds of problems if some test
+ // modifies the capabilities
+ this.desiredCapabilities = new DesiredCapabilities(desiredCapabilities);
}
/**
@@ -956,10 +962,25 @@ public abstract class AbstractTB3Test extends TestBenchTestCase {
* Checks if the given capabilities refer to Internet Explorer 8
*
* @param capabilities
+ * @param version
* @return true if the capabilities refer to IE8, false otherwise
*/
public static boolean isIE8(DesiredCapabilities capabilities) {
- return isIE(capabilities) && "8".equals(capabilities.getVersion());
+ return isIE(8, capabilities);
+ }
+
+ /**
+ * Checks if the given capabilities refer to Internet Explorer of the
+ * given version
+ *
+ * @param capabilities
+ * @param version
+ * @return true if the capabilities refer to IE of the given version,
+ * false otherwise
+ */
+ public static boolean isIE(int version, DesiredCapabilities capabilities) {
+ return isIE(capabilities)
+ && ("" + version).equals(capabilities.getVersion());
}
/**