Improving MbUnit’s HTML report with JavaScript
Every morning in my email I get a couple unit test reports generated by MbUnit during our daily (actually nightly) build process. Many of our tests output a lot of logging information, so reading the report takes a lot of scrolling and there’s no way to see at a glance what’s failed.
I realized that MbUnit’s HTML reports are just an MbUnit XML report with an XSL transform. By downloading the MbUnit source code, I was able to get the XSL, modify it with some JavaScript, and do my own transform. Specifically, I added +/- buttons to expand and collapse the details of each test, and Expand All and Collapse All buttons at the top of the page. By collapsing the details, I get a nice summary of what’s passed and failed and I can then drill in to see just the errors I’m concerned about.
Before the change I can’t see more than a couple results without scrolling:
After I can collapse the the results and see them many at a glance:
Download the XSL file here.

Great work!
I’m putting this into service pronto!
Comment by Jeff — June 30, 2006 @ 2:53 pm
I would like to do something similar to that, but I don’t want to have to change MbUnit’s source. Is there any way to set the XML reports to use a custom stylesheet?
I don’t mind opening the XML file instead of generating an HTML one, as long as it uses my stylesheet (and I also don’t have to change the file manually to use it).
Do you know how I can achieve this?
Comment by Andre — November 22, 2006 @ 7:05 am
See my reply in the MbUnitUser group:
http://groups.google.com/group/MbUnitUser/tree/browse_frm/thread/b33b5795c5000063/6dcd556690b3dec5?rnum=1&_done=%2Fgroup%2FMbUnitUser%2Fbrowse_frm%2Fthread%2Fb33b5795c5000063%2F6dcd556690b3dec5%3F#doc_2ac9feccdb5ceb67
Comment by marcstober — November 22, 2006 @ 11:04 am