[Zope3-dev] Re: Javascript functional tests?

Philipp von Weitershausen philipp at weitershausen.de
Mon Mar 7 21:43:35 EST 2005


Roger Ineichen wrote:
> Hi together
> 
> Does anybody have ideas how we can integrate Javascript tests
> in a small testing framework?
> Yes I know, javascripts are not everybody's darling;-)
> 
> I'm not asking about browser compatibility, just calling some
> javascript methods from functional tests or something similar. 
> 
> Hm, perhaps I have to take a look at JSUnit again.
> http://www.edwardh.com/jsunit/
> 
> Does anybody have used this framework with Zope?

For Kupu, we've been using ecmaunit for some time now. Guido Wesdorp of 
Infrae developed it once and I extended it to run with Mozilla's 
standalone JS interpreter, spidermonkey:

http://codespeak.net/svn/kupu/trunk/ecmaunit/

We actually use it to write unit tests (or probably something that would 
be closer to an integration test than a unit test) for kupu, but given 
the dynamic nature and dependency on an HTML page context, nearly all 
tested javascript functionality must be executed in a browser. Plans to 
emulate a whole browser environment with ecmaunit (so that you maybe 
even run it from the command line w/o a browser) have been mere day dreams.

So, in any case, unit tests would have to be executed 'manually', which 
means through a browser and which also means through every browser that 
is supposed to be supported, not just your favourite one.

Then, as you probably know, javascript is by far harder to work with 
Python when it comes to all kinds of quality assurance. Debugging is a 
major pain, which is why we started writing unit tests in the first 
place. Not everything can be tested in JavaScript, though, and not 
always will tests indicate the failure of a component.

JS-sucks-ly,

Philipp



More information about the Zope3-dev mailing list