The techniques here are dependent on some libraries, but this should already be included if you are using the phantomjs-qunit-runner maven plugin. Credit to this article to for the DOM setup and teardown helper functions.
Alright, onward to the code examples!
Suppose we had a javascript function that does a simple DOM manipulation to add some text to a given element as such.
Here is the code to test it! Pretty simple really.. comments inline
Comments