diff options
author | Artur Signell <artur@vaadin.com> | 2014-03-30 22:33:38 +0300 |
---|---|---|
committer | Artur Signell <artur@vaadin.com> | 2014-04-23 21:08:08 +0300 |
commit | 0a5eeeca649676432a4166255a4aee0028a3adcc (patch) | |
tree | b265b1deafb4e0ba538ab85cf7c4332b85a4e0a1 /uitest/src | |
parent | 716046af83ec05a44314a792648863646398d3b9 (diff) | |
download | vaadin-framework-0a5eeeca649676432a4166255a4aee0028a3adcc.tar.gz vaadin-framework-0a5eeeca649676432a4166255a4aee0028a3adcc.zip |
Support running tests on PhantomJS
Change-Id: I32bda24fbb8a104a9867b7889a74d3c159bbf516
Diffstat (limited to 'uitest/src')
-rw-r--r-- | uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java | 26 | ||||
-rw-r--r-- | uitest/src/com/vaadin/tests/tb3/MultiBrowserTest.java | 2 |
2 files changed, 27 insertions, 1 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(); diff --git a/uitest/src/com/vaadin/tests/tb3/MultiBrowserTest.java b/uitest/src/com/vaadin/tests/tb3/MultiBrowserTest.java index fa55b82390..2318fd8655 100644 --- a/uitest/src/com/vaadin/tests/tb3/MultiBrowserTest.java +++ b/uitest/src/com/vaadin/tests/tb3/MultiBrowserTest.java @@ -44,7 +44,7 @@ public abstract class MultiBrowserTest extends PrivateTB3Configuration { FIREFOX(BrowserUtil.firefox(24)), CHROME(BrowserUtil.chrome(33)), SAFARI( BrowserUtil.safari(7)), IE8(BrowserUtil.ie(8)), IE9(BrowserUtil .ie(9)), IE10(BrowserUtil.ie(10)), IE11(BrowserUtil.ie(11)), OPERA( - BrowserUtil.opera(17)); + BrowserUtil.opera(17)), PHANTOMJS(BrowserUtil.phantomJS(1)); private DesiredCapabilities desiredCapabilities; private Browser(DesiredCapabilities desiredCapabilities) { |