views:

32

answers:

1

Hi, I'm writing an automation program for a Web Application. I am accessing the Web Application through a javascript API and have wrapper functions with custom assertions that currently just write output to a table in an HTML page.

Now I need to get the data output into my hudson (https://hudson.dev.java.net/) automation, where I have a lot of flexibility when it comes to arranging, sharing and presenting the results. When I wrote NUnit tests, the hudson-integration was impeccable. I saw there was a thing called JSUnit, but it is no longer actively maintained(?), so maybe I shouldn't spend too much time learning it?

I have seen that tools like Firebug can output javascript results to a console, though I don't know where to go from there. The console output seems to stay in firefox and come no further.

Any help or tips are most welcome. Thanks! / Jakob

A: 

If I understand correctly, you want your Hudson build to run a test of your Web Application which is set up and running somewhere else. (This gets a little harder if you're also building your Web Application and want to set it up for a test run all inside Hudson.)

The easy option: As one of your build steps, retrieve the HTML page with your output and tell Hudson that the page is a build artifact. That way you can look at the test output manually.

Somewhat harder: change your test output (or pass a parameter to specify the format) to match the XML format used by NUnit -- see example XML output. This is a direct link to an XML file and may not display well in your browser; try viewing source or saving as text.


Update: On re-reading your question, it wasn't clear to me whether you were interested solely in Hudson integration (which my original answer assumed), or in other possibilities for testing frameworks.

Depending on what you want to test:

  • you might look at testing your Web Application with Selenium. I know there's a Hudson plugin for Selenium, but I've also noticed several questions here recently describing problems with Selenium+Hudson. I don't have any experience with the combination myself.
  • there are lots of javascript testing frameworks with different capabilities.
Dave Bacher
Hey Dave,Thanks for your answer. I decided to go with implementing JSUnit for writing/running the tests. Both of your ideas are interesting though, and should I have problems with JSUnit, I will consider rewriting the output to a NUnit compliant XML or try to get the output HTML page as artifact.Correct me if I'm wrong, but just retrieving the page as an artifact wouldn't allow hudson to decide whether the test was successful or not, right?Thanks again!
Jakob Ryden
Yep, just retrieving the page wouldn't let Hudson decide if the test was successful. Good luck!
Dave Bacher