My favorites | Sign in
Google
                
Show all Featured wiki pages:
UsingTheEclipsePlugin

[ GettingStarted | TestCase | Config File | Flags | ContinuousBuild | Debugging | DesignPrinciples | Eclipse Plugin | Compatibility ]

The goal of JsTestDriver is to build a JavaScript test runner which:

  1. easily integrates with continuous builds systems and
  2. allows running tests on multiple browsers quickly to ease TDD style development.

Features

Overview

JsTestDriver consist of a single JAR file which contains everything you need to get started. For in depth discussion of command line option see GettingStarted.

Here is an overview of how JsTestDriver works at runtime:

  1. You start off by launching the Server. The server is responsible for loading the test runner code into the browser and in the process turning the browser into a slave. Once the browser is a slave it can be controlled to do any action from the command line. In our case the server will send commands to the browser to load source code, execute arbitrary functions and report the results back to the requester. A single server can capture any number of browsers, even from other machines across the network. The server does not need to be on your development machine. This is useful if your primary development platform is different than your primary test platform. For example I develop code on mac but want to run my tests against Internet Explorer on Windows.
  2. After you have a server running you can capture any number of browsers. The capturing process can be automatic through a command line option. In most cases you point your browser to the server by visiting the server URL. Once the browser is captured you can forget about the browser (minimize/hide it), since the server can run any number of tests on the browser for an indefinite period of time. A common use case is to capture the browsers once and then use them for the remainder of the development during that day. The only time you will need to interact with the browser is if you wish to debug code with the browser's debugger.
  3. At this point you need write some source and tests code. There is no need to write any HTML wrappers, the code is normal JavaScript code with tests resembling JUnit. Once you have a test we are ready to run our tests.
  4. One last thing you need to do is to create a configuration file. This file tells the JsTestDriver which JavaScript files need to be loaded into the browser and in which order (optionally, where the server is located.) Think of the configuration file as the Java classpath and your JavaScript files as JARs. The good news is that this file is usually very short since for most projects a single line which says load everything (we support globing) is sufficient.
  5. You are now ready to run your tests. Form now on all you need to do is to rerun this last step to re-run the tests. The server is intelligent to reload only the files which have changed into the browser and in the right order. Since the browser is kept ready the test execute extremely fast. The effect is more noticeable as the project gets bigger.

See JsTestDriver in Action

http://www.youtube.com/watch?v=V4wYrR6t5gE

JsTestDriver for Eclipse

Update Site: http://js-test-driver.googlecode.com/svn/update/

More details: Eclipse plugin details

For IntelliJ IDEA

Look for JSTestDriver in the Plugin Manager inside IDEA.

Group

Question? Answers? Feature Requests? Bored? join our group: js-test-driver@googlegroups.com









Powered by Google Project Hosting