Log In
Or create an account ->
Imperial Library
Home
About
News
Upload
Forum
Help
Login/SignUp
Index
Using Node.js for UI Testing
Table of Contents
Using Node.js for UI Testing
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers and more
Why Subscribe?
Free Access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Getting Started with Zombie.js
A brief history of software and user interface testing
Enter the automation era
Unit tests versus integration tests
What Zombie.js is
Understanding the server-side DOM
Zombie.js is your headless browser
Summary
2. Creating a Simple Web App
Defining the requirements of our web app
Setting up Node.js and Flatiron
Installing Node.js
Installing Node from the source code
Installing Flatiron and starting your application
Creating your to-do app
Setting up the database
Accessing CouchDB from Node
Application layout
Developing the frontend
User registration
Logging in and session management
The to-do list
File summary
Summary
3. Installing Zombie.js and Mocha
Changing the application manifest
Setting up a test environment
Summary
4. Understanding Mocha
Organizing your tests
Using before and after hooks
Using asynchronous hooks
How hooks interact with test groups
Using assertions
Changing the assertion message
Performing asynchronous tests
Summary
5. Manipulating the Zombie Browser
When is the browser ready?
Options when visiting URLs
debug
headers
maxWait
Checking the existence of elements
Filling a form
Testing the login form
Testing the to-do list
Testing the to-do list page
Testing the to-do item creation
Testing to-do item removal
Putting it all together
Summary
6. Testing Interactions
Acting on radio buttons
Testing the user interaction
Selecting values
Summary
7. Debugging
Running a specific test
Enabling the debugging output per test
Using the browser JavaScript console
Dumping the browser state
Dumping the whole document
Summary
8. Testing AJAX
Implementing drag-and-drop
Summary
Index
← Prev
Back
Next →
← Prev
Back
Next →