Does anyone know of a library that does this?

I have extensive tests for everything server-side (REST = easy) and 
client-side. Client was hard, now using nodeunit+zombie to automate 
testing. It doesn't completely cover all of the oddities of 
Safari+Opera+Firefox+IE (especially IE), but gets the overwhelming majority 
of errors before going visual/manual or playing with Selenium.

I find myself writing an enormous number of assert/test statements to parse 
HTML:
- test if the following element has attribute x=foo, class y, etc.
- test if the following element is tagName=div, has 3 children, etc.

There has to be an easier way to do this. Would be much easier if I could 
just say, 

htmlCompare(someHtmlElement,myHtmlTree);

where I build myHtmlTree and input it into the engine. Might be something 
in json like:

[tag: "div", attr: {x:"foo"}, class:["y"], 
children:[{tag:"table",....},{tag:"form",...}]

For all intents and purposes, I have crudely built something like that, but 
far prefer a formalized library. Anything out there? If not, should I just 
publish this, others find it useful?



-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to