Friday, April 25th, 2008

JavaScriptMVC Test Plugin

Category: JavaScript, Testing

Justin Meyer and the JavaScriptMVC team have created a new Test plugin. We all voted testing as the number two pain point in Web dev and this is an attempt to make the world a bit better.

Test lets you simulate every major DOM event, as well as some combination events like Write and Drag, simulate Ajax, and use assertions. It runs functional and unit tests in a separate console window. Another nice feature is that if you use it with the Controller plugin, helper methods are automatically created that simulate each controller action’s event, such as TodoClick.

Here’s an example test function:

javascript

  1. test_drag: function(){
  2.     // click the second todo
  3.     this.TodoClick(2);
  4.     // call done_dragging after Drag is complete
  5.     this.Drag($('draggable'),{from: 'pointA', to: 'pointB', callback: this.next_callback()})
  6. },
  7. done_dragging : function(){
  8.     // did the drag complete successfully
  9.     this.assert_equal(1, $('pointB').next().childNodes.length);
  10. }

Check out the demo

Posted by Dion Almaer at 6:18 am
3 Comments

+++--
3.7 rating from 14 votes

3 Comments »

Comments feed TrackBack URI

It is nice to see more testing tools appearing. To see our Ajax-testing environment, see IT Mill Toolkit Testing Tools. To try out, try out management console demo at http://toolkit.itmill.com:8099/ or run a pre-recorded test at http://toolkit.itmill.com/demo/FeatureBrowser?TT=1&TT-TC=65&restartApplication

Comment by jole — April 25, 2008

wow…. I cant fri*kin believe you linked to a site with a popup on it????? thats low

Comment by henrah — April 26, 2008

@henrah, assuming you’re referring to the demo, that popup is the test console window where you run unit and functional tests. It is not an advertisement. We’ll post a warning on the page for future visitors.

Comment by moschel — April 26, 2008

Leave a comment

You must be logged in to post a comment.