Preface
With all the exciting things going on in the browser space, this is a fantastic time to be a front-end developer. The family of technologies that we call HTML5 is giving us new opportunities that were difficult or even impossible just a few years ago, and JavaScript has flourished alongside it as rich web applications have become the norm. Throughout this time, the WebKit project has emerged as the leader of this innovative streak. If you are unfamiliar with WebKit, it is an open source web browser engine with contributors from companies such as Apple, Google, and Nokia, to name a few. WebKit powers Safari, versions of Chrome, and PhantomJS.
The reason you are reading this book is because you have discovered PhantomJS and want to harness its full potential.
PhantomJS is one of the most important innovations in the front-end development tool chain in the last several years. It has proven to be the ideal environment for lightning-fast tests, both manual and automated. Since it is simply a specialized build of WebKit, front-end developers can have confidence that their tests are being executed in a real browser, not a simulated environment. As it is truly headless, it can be deployed anywhere without the hassle of configuring Xvfb. Perhaps best of all, PhantomJS is fully scriptable using JavaScript, a tool that every front-end developer already knows. All these elements combined have uniquely positioned PhantomJS as the preferred testing environment among front-end developers for quick feedback and continuous integration.
The PhantomJS Cookbook focuses on using PhantomJS as the preferred testing environment. This book provides practical recipes that demonstrate the fundamentals of this headless browser and also help you take advantage of it for a variety of testing tasks. In this book, you will learn how to integrate PhantomJS into your development workflow at all stages. You will learn how you can receive immediate feedback from your unit tests. You will learn how to create a functional test suite that is both fast and automatic. Also, you will learn how to add PhantomJS to your continuous integration system so that you can make end-to-end and front-end performance tests first-class citizens of your build.