My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members
Featured
Downloads

Injest is a Jasmine runner that uses WebDriver to run JavaScript tests. This allows you to:

  • Run the tests in headless mode, using HtmlUnit
  • Run JavaScript tests against a real DOM
  • Run your tests through your IDE, without firing up a browser
  • Run your tests in any Java build environment
  • Write beautiful, Jasmine-style tests :)

This is really just a bit of glue that mixes together two of our favourite frameworks. It is designed to be minimally intrusive, and any suggestions are welcome. Patches (with tests) are even more welcome.

How do I run it?

  • Download the jar file from this page
  • Download the latest WebDriver
  • Shove 'em both in your classpath and start writing Jasmine tests

Tests look like this:

@Test
public void runMyTests() throws Exception {
    JasmineRunner jasmineRunner = new JasmineRunner("tests/jasmine/javascript", "src/jasmine/javascript");

    jasmineRunner.runJasmineTests("Player.js", "Song.js", "SpecHelper.js", "PlayerSpec.js");
}
  • JasmineRunner is constructed with the source roots of your JavaScript directories, relative to your working directory.
  • Call runJasmineTests with the set of specs (tests) to run and their dependencies. In this example, we are using the tests that are shipped with Jasmine.
  • The JUnit test passes if none of the Jasmine tests fail.
  • The results are written to jasmine/test-results.html in your TEMP directory (or /var/tmp/ or tmp, etc)

What's coming next?

  • An example project that shows more test examples and Ant integration
  • Parameterised JUnit tests that run your entire suite
  • An IntelliJ plugin that runs a Jasmine test directly from the IDE

Thanks to...

  • The WebDriver team, who have built upon earlier works to provide the single best web testing platform I know of.
  • The Jasmine team from Pivotal Labs
  • Justin Searls, whose jasmine-maven-plugin showed me how easy it was to integrate with Jasmine.

Powered by Google Project Hosting