I would like to test the output generated by some functions which are responsible to generate new content in the dom.
The problem is that I need to test such scenarios without using a browser and by running xpath queries against the generated output. (something like HTMLUnit in Java).
How can I write such tests? Which framework/technology can I use?
I would like to test the output generated by some functions which are responsible
Share
This is usually handled by using a browser running on a fake screen (e.g. using xvfb) and driving it programmatically. Headless will let you set up xvfb from within node.js.
Phantom and Selenium provide a couple of ways to drive browsers.