Selenium (browser automating) might be what your looking for.
The Boston PHP group had a talk this week on integrating Selenium, phantomJS (headless browser) and Jenkins (continuous integration). Its php based talk, but at the end he showed the javascript version of the same tests.
https://github.com/balancerockmedia/boston-php-automated-tes...