The ideal solution is to write your code as modules that are seperate from your page.
This way you can just load the module into a subbed unit testing html page or into a headless browser and run your unit tests on it.
Preferably unit test libraries include mocha
The important part here is not unit testing the entire page because the entire page is not a unit.
The other important part here is writing your code so that it is loosely coupled. The looser your coupling the easier it is to unit test your module and the less you have to mock for your test to just work.
For instance I'm currently working on a page that has an accordion and each item of the accordion has dynamic contents populated through a JSON object. The JSON object is provided by a third party. I'm using jQuery. My way of testing so far is called console.log :)
Take your accordian widget and ensure it either has unit tests or write unit tests for them.
Then make a dummy page you can drop your accordian into and inject the mocked out version of the third party data into it. Then unit test that the accordian renders properly and things just work with the mocked third party JSON.
The difficult part is automating the running of your unit tests on all 20 browsers you support. (I really hope you only support 5!)