how to test javascript-enhanced web apps?

slanning on 2005-03-12T21:57:28

My question is on perlmonks.


tests

kungfuftr on 2005-03-13T19:26:05

Yullo,

Have a peek at http://www.jsunit.org which provides a nice testing framework for javascript. As well, plxpcom is currently kinda flaky, but there's been a bit more activity recently and it _does_ now build. I believe my housemate is going to look into doing some more with it and I'll have a peek at stuff when it's a bit more solid.

woot.

Re:tests

slanning on 2005-03-15T16:54:39

I found it here . Thanks.

Regarding plxpcom, it wouldn't build for me on either 1.6 or 1.8b1 of Mozilla with perl 5.8.4. I uploaded my detailed install notes (they won't go thru the "compression filter" here for some reason).


Re:tests

slanning on 2005-03-15T16:55:27

uploaded it here...

Re:tests

kungfuftr on 2005-03-16T01:13:39

Hmmm.... looks like possibly old MakeMaker stuff, haven't built it in a while it must be admitted. Will look into it again, but it _has_ compiled for others.

Re:tests

slanning on 2005-03-16T13:14:12

I don't think it's MakeMaker, as my version of ExtUtils::MakeMaker is the latest version. I assume you're referring to the "CXX is not a known MakeMaker parameter", but as far as I know it's never in fact been a MakeMaker parameter. I admit I'm pretty clueless there, though.

If only they'd give detailed accounts of exactly what they did.. like what exact version of Mozilla (including link to download from), what version of Perl, etc.

You mentioned that there has been activity in plxpcom recently. How do you know that? Is there a mailing list somewhere else now? I found no indication of any activity except for a note... hey, what's this, another note in the "What's New?" right column here, which says that two days ago plxpcom was made to compile with Mozilla 1.6. So, I'll try again this evening. Anyway, I couldn't subscribe to the mailing list given on their site. I received no reply from an email to the maintainer (Matt Kennedy matt @ jumpline com). I'm interested in following the developments of this project.

Re:tests

slanning on 2005-03-16T13:30:47

Oh, and I wanted to ask.. how do you find documentation on XPCOM components? (sorry, that's probably a FAQ, but I haven't found anything good) I've found lists of interfaces, but that doesn't do me much good.

Re:tests

kungfuftr on 2005-03-16T13:43:56

mozilla documentation in general is non-existant. xulplanet seems to keep a decent list of things, but which branch they talk about, etc is beyond me. The books seem to be better, or looking at the source code. As for activity, it's the CVS repository showing me activity.

=0)

Re:tests

kungfuftr on 2005-03-16T13:44:54

ah...

http://www.mozref.com/ too

Re:tests

slanning on 2005-03-16T16:31:05

http://mozref.com/reference/objects/ looks promising.

The DOM, etc. specs I can find. What I want is a reference and guide to the XPCOM components. And I don't mean how to instantiate a component from an interface, and I don't mean a list of interfaces tellings what their contract keys are (like here), and I don't mean how to implement a component in C++; I mean a list of components, explaining what each is useful for (if anything), or a cookbook, or something useful. If the whole point of XPCOM is to provide reuseable components, then what good is it if nobody knows how to use them?

For example, someone gave me the idea that I might be able to make a server inside Mozilla, then call to that server from Perl. So, I searched the list of interfaces, and found some with "network" in their names. @mozilla.org/network/server-socket;1 looks promising, but beyond this:

Contract ID    - @mozilla.org/network/server-socket;1
Class ID       - {2ec62893-3b35-48fa-ab1d-5e68a9f45f08}
Interface name - nsIServerSocket
Interface ID   - {a5b64be0-d563-46bb-ae95-132e46fcd42f}
Methods        - QueryInterface
                 init
                 close
                 asyncListen
                 port
I have no idea what it's for or how to use it.

Re:tests

slanning on 2005-03-16T16:36:57

Heh, that mozref site is mostly a shell. E.g. this article on network-related stuff is empty.

Re:tests

slanning on 2005-03-16T19:07:04

http://xulplanet.com/references/xpcomref/ is pretty good. And this.

Re:tests

slanning on 2005-03-17T13:25:47

It did build okay after I updated if from CVS after March 14th. I wish I could find a mailing list or IRC channel where I could ask questions. (Hm, maybe I should look for a more general XPCOM list..) Now that I've gotten it built, I find that I don't really understand how I'm going to use it yet. I guess I should start by reading the tutorials this weekend and reading through the mailing list archives (ending in 2003 :( ). At this point I've lost some confidence in how useful it's going to be for me, because I'm not sure whether you can actually use it to control a browser or whether it just allows you to use the same components that the browser happens to use. My current impression is that you have to use Perl XPCOM to write components in Perl that would then be used from JavaScript embedded within a web page; hopefully I'm wrong, and you can actually control the browser like you can with OLE and Internet Explorer. Yet at the same time, I feel like I'm going to make a breakthrough real soon now.