summaryrefslogtreecommitdiffstats
path: root/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java
diff options
context:
space:
mode:
authorArtur Signell <artur@vaadin.com>2014-03-30 22:33:38 +0300
committerArtur Signell <artur@vaadin.com>2014-04-23 21:08:08 +0300
commit0a5eeeca649676432a4166255a4aee0028a3adcc (patch)
treeb265b1deafb4e0ba538ab85cf7c4332b85a4e0a1 /uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java
parent716046af83ec05a44314a792648863646398d3b9 (diff)
downloadvaadin-framework-0a5eeeca649676432a4166255a4aee0028a3adcc.tar.gz
vaadin-framework-0a5eeeca649676432a4166255a4aee0028a3adcc.zip
Support running tests on PhantomJS
Change-Id: I32bda24fbb8a104a9867b7889a74d3c159bbf516
Diffstat (limited to 'uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java')
-rw-r--r--uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java26
1 files changed, 26 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java b/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java
index ba5c81e846..7f9fe1387a 100644
--- a/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java
+++ b/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java
@@ -765,6 +765,21 @@ public abstract class AbstractTB3Test extends TestBenchTestCase {
}
/**
+ * Gets the capabilities for PhantomJS of the given version
+ *
+ * @param version
+ * the major version
+ * @return an object describing the capabilities required for running a
+ * test on the given PhantomJS version
+ */
+ public static DesiredCapabilities phantomJS(int version) {
+ DesiredCapabilities c = DesiredCapabilities.phantomjs();
+ c.setPlatform(Platform.XP);
+ c.setVersion("" + version);
+ return c;
+ }
+
+ /**
* Checks if the given capabilities refer to Internet Explorer 8
*
* @param capabilities
@@ -821,6 +836,15 @@ public abstract class AbstractTB3Test extends TestBenchTestCase {
}
/**
+ * @param capabilities
+ * The capabilities to check
+ * @return true if the capabilities refer to PhantomJS, false otherwise
+ */
+ public static boolean isPhantomJS(DesiredCapabilities capabilities) {
+ return BrowserType.PHANTOMJS.equals(capabilities.getBrowserName());
+ }
+
+ /**
* Returns a human readable identifier of the given browser. Used for
* test naming and screenshots
*
@@ -839,6 +863,8 @@ public abstract class AbstractTB3Test extends TestBenchTestCase {
return "Safari";
} else if (isOpera(capabilities)) {
return "Opera";
+ } else if (isPhantomJS(capabilities)) {
+ return "PhantomJS";
}
return capabilities.getBrowserName();