Wednesday, July 14th, 2010

Synthetic Event Library Syn Aims to Make Testing Easier

Category: JavaScript, Testing

<>p>The team at Jupiter IT have release Syn, a library which allows you to create synthetic events for use in testing. This standalone library is meant to assist in testing complex UI behavior by simulating user actions such as typing, clicking, dragging the mouse.

Testing rich, dynamic web applications sucks. At Jupiter, we’ve tried almost every testing solution available (qUnit, Quick Test Pro, Selenium, JsUnit, Env.js, TestCase) and all of them suffer from some fatal flaw.

Problems:

  • Manual – A tester has to run the tests manually on every supported browser.  People are lazy. 
  • Unit Tests Only – We need to test the app as a whole and complex UI behavior like drag-drop.
  • Low fidelity – We need to make sure the tests are reporting accurate results.
  • Difficult to write – We sling JS like a ninja monkey throws poo.  We want to write tests in a nice JS API.
  • Expensive – A QTP license is 5k a person!  I’d rather buy a vacation.
  • Support – We want to test Mac and Linux browsers.

We’ve solved all of these problems in our upcoming FuncUnit testing framework. It’s a mashup of qUnit, Selenium, Rhino, and Env.js. But its core library, Syn, which does the work of simulating user actions with very high fidelity, is what we are releasing today.

So by using code like this:

javascript
< view plain text >
  1. Syn.click( {},'hello' )
  2.    .type( 'Hello World' )
  3.    .drag( $('#trash') );

you can simulate clicking an element with id=’hello’, typing “Hello World”, and then dragging your mouse from that element to an element with id=’trash’.

Pretty cool stuff. Check out their demo to see how playback occurs.

Related Content:

Posted by Rey Bango at 11:54 am
6 Comments

+----
1 rating from 2 votes

6 Comments »

Comments feed TrackBack URI

looks very nice

Comment by mkuklis — July 14, 2010

Holy crap, this looks awesome. I’ve been trying to record user action for my (extremely basic) UI testing framework (http://github.com/mennovanslooten/UITest) but have miserably failed so far. These guys seem to have nailed it.

Comment by Menno — July 15, 2010

Really slick, very impressed! Love how simple it looks, syntax and all.

Comment by friendlyjs — July 15, 2010

Cool…But what about the synthetic events that the browser doesn’t like?

For example, pressing “TAB” to change focus from one field to another?

Comment by randomrandom — July 15, 2010

Looks great to me.

Comment by chalia — July 15, 2010

@randonrandom, Syn.type(’0\t1\t2′) will tab through a form. Yes, Syn is that awesome.

Comment by JustinMeyer — July 21, 2010

Leave a comment

You must be logged in to post a comment.