What JavaScript UI testing framework should I use for a simple HTML5 + jQuery app?

Martin R-L picture Martin R-L · Dec 19, 2010 · Viewed 6.9k times · Source

I'm about to write a simple HTML5 + JavaScript (jQuery) app in my spare time in order to keep up with the latest web technologies (at work it's more advanced C# backend stuff).

I'd like to develop in the same fashion that I've done for the last ten years or so, namely TDD style.

Being new to the TDD/BDD/AcceptanceTDD world in HTML/JavaScript, my question is: is there a great framework or the like for writing test against a web page in a browser (out-of-the-box support for many browsers being a definitive plus)?

The reason I'd like to use JavaScript is two-fold. 1. I'd like to learn more JavaScript, and 2. I'd like to use the same language(s) for the tests as I do for development.

Otherwise, I could simply use my C# skills and use Selenium, WatiN, or a similar framework.

I've found Jasmine, QUnit, and a homegrown solution using jQuery at MSDN, but don't get a feel for the flow nor complexity, so recommendations and first hand experiences are more than welcome.

Answer

machineghost picture machineghost · Dec 19, 2010

JS Test Driver is the framework recommended by the Javascript TDD book from O'Reilly that I'm reading right now. I haven't actually had a chance to play with it much yet, but:

  • A dude who wrote a book on JS testing recommends it
  • It has a very nice feature set (automated test running across multiple browsers being key)
  • It comes from Google (love 'em or hate 'em, they have a lot of smart JS people working there)

So at the very least it's worth checking out I think.