Archive for the ‘Testing’ Category

* QUnit Server

Posted on March 1st, 2010 by Dave Johnson. Filed under Components, JavaScript, Testing.

QUnit is a great little JavaScript test framework written by none other than John Resig of jQuery fame.

I love how easy it is to write tests, especially asynchronous ones, with QUnit and so was quick to start using it for my JavaScript tests.

The one thing that I found it lacked was support for continuous integration products like Hudson, CruiseControl or Continuum. So I figured that I would change that.

For a long time I have been using JsUnit along with JsUnit Server to merge in client side JavaScript test results with a server side test integration workflow. Essentially, JsUnit Server is a Jetty server and JsUnit posts back a form with test results to that server, which logs the results to standard JUnit formatted test results files. Those files can then be read by most continuous integration products and included in their reporting.

What I decided to do was hack QUnit so that it too could submit test results back to the JsUnit Server in the same format that JsUnit submits results and could therefore continue using the same JsUnit Server workflow and simply change the client JavaScript test framework to QUnit. It worked like a charm!

I wrote a couple of simple function that in the background dynamically create an HTML form in the QUnit test page and add the results to the form as each test is run. When the tests are complete the page submits back to the JsUnit Server and the test results are logged as they were when I was using JsUnit.

It is some pretty simple changes but does make using QUnit that much better, especially if you were hesitant to switch just because the continuous integration support was not there for QUnit.

Check it out on GitHub.

Tags: , , , .

* Ajax Functional Testing Fun

Posted on March 12th, 2008 by Dave Johnson. Filed under AJAX, JavaScript, Testing, selenium.

It seems that no matter how much you look for information about Eclipse and how to setup different types of projects, your version Eclipse is innevitably not the same version of the person who makes the tutorial and nor are you as much of an Eclipse geek as the writer of the tutorial. The same things will probably be thought about what follows :)
First of all I am doing this in Eclipse 3.3 WTP.

I started by creating a new Java project.

Which should have resulted in a basic project that looks something like this.

Then right click on the project root and choose “Properties” from the context menu (Alt+Enter). Go to the “Java Build Path” section of the properties. There you can include source files from elsewhere on your computer - so for example if you keep your test code elsewhere on your system you can include the source folder which will include your Java files in the Java project so that they can be built and run as a Java program while still keeping the files in your source control folder as well. This way you also avoid checking in Java projects all over the place that are useless for everyone else.

Now we add some external Jars. Find the Selenium Java client Jar and the JUnit Jar on your system and add them.

Now your project should be ready to go and you can create Selenium tests using the Java API and run them from Eclipse using JUnit. How sweet it is!


* Ajax Functional Testing

Posted on February 27th, 2008 by Dave Johnson. Filed under AJAX, Testing, Uncategorized, selenium.

We are getting really close to being able to release all of our Selenium functional tests and JSUnit unit tests to our developer community! Ryan has been doing a kick ass job of bring Cruise Control back from the brink and we are being way better about actually running all our tests ;)
With Cruise Control we can now check out our web based dashboard to see the results of automagical test runs and builds or do a manual build. We can even see the results of our Java based Selenium functional tests online.

By abstracting much of the Ajax and DOM leg work into base classes we get really clean Java based functional tests that look something like this:
assertEquals("Some cell value", getSelectedCellValue());

What could be easier? It is also nice that it is run from Java since I can just create a Java project that references all my Ajax tests then compile and run them individually on my development computer using JUnit. Then they can also easily be called from ANT build files and Cruise Control as well.

I will be posting some more about Ajax testing soon.


* Enterprise Ajax Podcast 15

Posted on October 22nd, 2006 by Dave Johnson. Filed under AJAX, Nitobi, Podcast, Testing, ajaxworld.

This one was supposed to be out a long time ago but Andre tried to pull a fast one on us! We talk about a fiew things like Canadian Thanksgiving, OpenAjax Alliance, AjaxWorld, Testing and Debugging.

There are likely some quality problems and I think that Andre’s recording died before the end so Alexei and I have to pretend like we know stuff.

Get it while it’s hot!


* AjaxWorld Testing and Debugging Slides

Posted on October 7th, 2006 by Dave Johnson. Filed under AJAX, Conference, Debugging, JavaScript, Testing.

Here are the slides from my testing and debugging talk at AjaxWorld.

I had a great time down in Santa Clara despite the high number of marketing presentations compared to good Ajax technical talk. Still, I got to meet a lot of new people. w00t.

Anyhow, hopefully doing a podcast this afternoon so we will discuss all the happenings there!

technorati tags:ajax, javascript, conference, testing, debugging, ajaxworld