Automated browser testing with PhantomJS and CasperJS

One way to test whether a UI is working is to pay several people to interact with a website via a browser and report any errors they find. This can become a very expensive and ultimately unreliable process. Also, it requires putting potentially failing code into production in order to test it. It is better to test whether application views are rendering correctly from within the build process itself prior to releasing any views "into the wild". PhantomJS was created to address this need, among others.

A browser, stripped of its buttons and other controls, is, at its heart, a program that validates and runs JavaScript, HTML, and CSS. That the validated HTML is rendered visually on your screen ...

Get Deploying Node.js now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.