Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
PhantomJS Cookbook

You're reading from   PhantomJS Cookbook Over 70 recipes to help boost the productivity of your applications using real-world testing with PhantomJS

Arrow left icon
Product type Paperback
Published in Jun 2014
Publisher
ISBN-13 9781783981922
Length 304 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Rob Friesel Rob Friesel
Author Profile Icon Rob Friesel
Rob Friesel
Arrow right icon
View More author details
Toc

Table of Contents (10) Chapters Close

Preface 1. Getting Started with PhantomJS 2. PhantomJS Core Modules FREE CHAPTER 3. Working with webpage Objects 4. Unit Testing with PhantomJS 5. Functional and End-to-end Testing with PhantomJS 6. Network Monitoring and Performance Analysis 7. Generating Images and Documents with PhantomJS 8. Continuous Integration with PhantomJS Index

What this book covers

Chapter 1, Getting Started with PhantomJS, introduces the PhantomJS browser and how to work with it from the shell. It covers installing PhantomJS and how to run it with different command-line arguments.

Chapter 2, PhantomJS Core Modules, discusses the core modules in PhantomJS, such as phantom and system, and covers how to use the fs module to work with the filesystem. The chapter also explains how to create your own modules and load them into your PhantomJS scripts.

Chapter 3, Working with webpage Objects, introduces webpage objects and includes sophisticated strategies for dealing with web page content. You will learn how to interact with the page, simulate events, and capture those interactions for successful tests.

Chapter 4, Unit Testing with PhantomJS, explores how to use PhantomJS as an environment for JavaScript unit tests. This chapter focuses on the Jasmine BDD testing framework, but will also introduce two other popular frameworks, Mocha and QUnit.

Chapter 5, Functional and End-to-end Testing with PhantomJS, demonstrates functional and end-to-end testing strategies with PhantomJS. The chapter surveys several different functional testing tools, including Selenium, Poltergeist (a driver for Capybara), and CasperJS.

Chapter 6, Network Monitoring and Performance Analysis, illustrates how to perform automated performance analysis with PhantomJS. The chapter explores topics such as how to generate a HAR file for waterfall analysis, and how to use libraries such as confess.js and YSlow for automated performance analysis.

Chapter 7, Generating Images and Documents with PhantomJS, shows how to generate images and PDFs with PhantomJS. The chapter provides an overview of PhantomJS' built-in image rendering features and explains how to apply them.

Chapter 8, Continuous Integration with PhantomJS, demonstrates PhantomJS as part of a continuous integration (CI) strategy. The chapter surveys CI, using Jenkins as its specimen, and shows how to fail builds on that system, concluding with a recipe for comprehensive CI example.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime