Using Node.js for UI Testing

Learn how to easily automate testing of your web apps using Node.js, Zombie.js, and Mocha
Preview in Mapt

Using Node.js for UI Testing

Pedro Teixeira

Learn how to easily automate testing of your web apps using Node.js, Zombie.js, and Mocha
Mapt Subscription
FREE
$29.99/m after trial
eBook
$10.50
RRP $14.99
Save 29%
Print + eBook
$29.99
RRP $29.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$10.50
$29.99
$29.99p/m after trial
RRP $14.99
RRP $29.99
Subscription
eBook
Print + eBook
Start 30 Day Trial

Frequently bought together


Using Node.js for UI Testing Book Cover
Using Node.js for UI Testing
$ 14.99
$ 10.50
Server-side Programming with Node.js for Beginners [Video] Book Cover
Server-side Programming with Node.js for Beginners [Video]
$ 124.99
$ 106.25
Buy 2 for $28.00
Save $111.98
Add to Cart
Subscribe and access every Packt eBook & Video.
 
  • 5,000+ eBooks & Videos
  • 50+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 

Book Details

ISBN 139781782160526
Paperback146 pages

Book Description

Automating tests for your user interfaces has always been the holy grail of programming. Now, using Zombie.js and Mocha you can create and quickly run your tests, allowing you to test even small changes. Increase your confidence in the code and minimize the number of times you have to use a real browser while you develop.

"Using Node.js for UI Testing" is a quick and thorough guide on how to automatically test your web app, keeping it rock solid and bug-free. You will learn how to simulate complex user behaviour and verify that your application behaves correctly.

You will create a web app in Node.js that uses complex user interactions and AJAX; by the end you will be able to fully test it from the command-line. Then you will start creating the user interface tests for this application using Mocha as a framework and Zombie.js as a headless browser.

You will also create a complete test suite, module by module, testing simple and complex user interactions.

Table of Contents

Chapter 1: Getting Started with Zombie.js
A brief history of software and user interface testing
Understanding the server-side DOM
Summary
Chapter 2: Creating a Simple Web App
Defining the requirements of our web app
Setting up Node.js and Flatiron
Creating your to-do app
File summary
Summary
Chapter 3: Installing Zombie.js and Mocha
Changing the application manifest
Setting up a test environment
Summary
Chapter 4: Understanding Mocha
Organizing your tests
Using before and after hooks
Using asynchronous hooks
Using assertions
Performing asynchronous tests
Summary
Chapter 5: Manipulating the Zombie Browser
When is the browser ready?
Checking the existence of elements
Filling a form
Testing the login form
Testing the to-do list
Putting it all together
Summary
Chapter 6: Testing Interactions
Acting on radio buttons
Testing the user interaction
Selecting values
Summary
Chapter 7: Debugging
Running a specific test
Using the browser JavaScript console
Dumping the browser state
Dumping the whole document
Summary
Chapter 8: Testing AJAX
Implementing drag-and-drop
Summary

What You Will Learn

  • Creating your test suite using Mocha
  • Building a web application using Node.js and Flatiron.js
  • Loading documents into the Zombie.js headless browser
  • Triggering user events in Zombie.js
  • Querying the DOM to test your application behaviour
  • Injecting complex events into your application
  • Triggering and testing complex user interactions and AJAX calls
  • Inspecting the Zombie headless browser state

Authors

Table of Contents

Chapter 1: Getting Started with Zombie.js
A brief history of software and user interface testing
Understanding the server-side DOM
Summary
Chapter 2: Creating a Simple Web App
Defining the requirements of our web app
Setting up Node.js and Flatiron
Creating your to-do app
File summary
Summary
Chapter 3: Installing Zombie.js and Mocha
Changing the application manifest
Setting up a test environment
Summary
Chapter 4: Understanding Mocha
Organizing your tests
Using before and after hooks
Using asynchronous hooks
Using assertions
Performing asynchronous tests
Summary
Chapter 5: Manipulating the Zombie Browser
When is the browser ready?
Checking the existence of elements
Filling a form
Testing the login form
Testing the to-do list
Putting it all together
Summary
Chapter 6: Testing Interactions
Acting on radio buttons
Testing the user interaction
Selecting values
Summary
Chapter 7: Debugging
Running a specific test
Using the browser JavaScript console
Dumping the browser state
Dumping the whole document
Summary
Chapter 8: Testing AJAX
Implementing drag-and-drop
Summary

Book Details

ISBN 139781782160526
Paperback146 pages
Read More

Read More Reviews

Recommended for You

Mastering Web Application Development with AngularJS Book Cover
Mastering Web Application Development with AngularJS
$ 26.99
$ 5.40
Responsive Web Design with HTML5 and CSS3 Book Cover
Responsive Web Design with HTML5 and CSS3
$ 23.99
$ 4.80
Object-Oriented JavaScript - Second Edition Book Cover
Object-Oriented JavaScript - Second Edition
$ 29.99
$ 21.00
JavaScript Unit Testing Book Cover
JavaScript Unit Testing
$ 14.99
$ 10.50
Responsive Web Design by Example : Beginner's Guide Book Cover
Responsive Web Design by Example : Beginner's Guide
$ 26.99
$ 18.90
Mastering Node.js Book Cover
Mastering Node.js
$ 29.99
$ 6.00