[Project_owners] unit-testing Firefox extensions?
msherborne at gmail.com
Tue Jan 24 22:48:36 EST 2006
To test XUL you'd have to programatically check the DOM, see if your item is
that it does what it's surposed to.
Should be pretty easy: (Famous last words)
var ele = getElementById('myid')
assert(ele.nextSibling.caption == 'a caption')
ele.click() // or something
Personally I'm still in the prototyping/framework creation stage and it
seems like a lot of work so I'm not going to bother at the moment.
On 24/01/06, Matthew Wilson <matthew at mjwilson.demon.co.uk> wrote:
> Babak Esfandiari wrote:
> > Hi,
> > Any tips as to how to unit-test Firefox extensions? I know there are a
> > them in the context of a Firefox extension? And would you use any
> > particular development environment for such a task?
> I'm just starting to move to doing this for testing of some of my code
> with JSUnit.
> This is for an XPCOM component, so the testing is of the public
> interface. (The testLocalServer function should be split into separate
> functions though.)
> How you test depends on what you're testing. You may need to refactor
> Testing of XUL is much harder of course.
> Matthew Wilson
> Project_owners mailing list
> Project_owners at mozdev.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Project_owners