user1429419
user1429419

Reputation: 127

running jstd-maven-plugin tests without a browser

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?

Upvotes: 3

Views: 1318

Answers (3)

Alex Punnen
Alex Punnen

Reputation: 6224

JSTD maven plugin can be extended to run phanatomjs.

Upvotes: -1

Gabriel Jürgens
Gabriel Jürgens

Reputation: 3153

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.

Upvotes: 2

Jens Ehrlich
Jens Ehrlich

Reputation: 873

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?

Upvotes: 0

Related Questions