3

I've got jsTestDriver up and running, and I use jstd-maven-plugin to run the tests during a build.

The plugin needs a browser to be specified in order to work though, and I'd like to use something like rhino or htmlunit that won't actually launch a browser.

The jasmine-maven-plugin does this with htmlunit, and works quite well.

Is there a way to specify a headless browser for jstd-maven-plugin?

user1429419
  • 127
  • 3
  • 12

3 Answers3

2

One of the reasons that I prefer JsTestDriver over other JavaScript testing frameworks, is that the tests are made on real browsers, and allows me to test on all the major browsers that consumes my application, and verify compatibility issues with older versions of IE for example.

If you prefer to run a complete headless JavaScript testing server, perhaps JsTestDriver is not your best choice. I think CasperJS is a very good alternative to achieve that. It uses PhantomJS, a scriptable headless WebKit engine to run the tests.

In my case, I have a complete headless server running an instance of JsTestDriver, and Other server whit a couple of virtual machines, with common SO/Browsers combinations (Windows/IE7; Windows/IE8; Linux/Firefox...), which have actual browsers connected to the headless JsTestDriver server. But if you don't need to use real browsers, the CasperJS alternative may be a good choice.

Gabriel Jürgens
  • 3,055
  • 3
  • 20
  • 19
0

JsTestDriver need a browser to run the javascriptcode. So there is no way to run your tests without a browser.

There is a way to open the browser in a virtual monitor. This is described in this question: Run Headless JsTestDriver?

Community
  • 1
  • 1
Jens Ehrlich
  • 873
  • 2
  • 11
  • 19
  • 1
    The jstd-maven-plugin has a tag which specifies the browser that will run the javascript. My question is: instead of Firefox, can I do phantomJS (or something like that) so that nothing visible pops up but a browser is still loaded? – user1429419 Jul 11 '12 at 18:06
-1

JSTD maven plugin can be extended to run phanatomjs.

Alex Punnen
  • 5,287
  • 3
  • 59
  • 71
  • You didn't actually give any useful information about how to do this or where to find the solution. -1 – CrazyBS Sep 29 '13 at 06:01