Book Image

JavaScript Unit Testing

By : Hazem Saleh
Book Image

JavaScript Unit Testing

By: Hazem Saleh

Overview of this book

<p>The largest challenge for many developers’ day to day life is ensuring the support of, and assuring the reach of, their product. With the ever increasing number of mainstream web browsers this is becoming a more difficult task for JavaScript coders. <br /><br />From the beginning, JavaScript Unit Testing will show you how to reduce the time you spend testing, and automate and ensure efficiency in guaranteeing your success.<br /><br />JavaScript Unit Testing will introduce and help you master the art of efficiently performing and automating JavaScript Unit tests for your web applications.<br /><br />Using the most popular JavaScript unit testing frameworks, you will develop, integrate, and automate all the tests you need to ensure the widest reach and success of your web application.<br /><br />Covering the most popular JavaScript Unit testing frameworks of today, JavaScript Unit Testing is your bible to ensuring the functionality and success of all of your JavaScript and Ajax Web Applications.<br /><br />Starting with Jasmine, you will also learn about, and use, YUITest, QUnit, and JsTestDriver, integrate them into your projects, and use them together to generate reports.<br /><br />Learn to automate these tools, make them work for you, and include the power of these tools in your projects from day one.</p>
Table of Contents (12 chapters)

Automation and integration with build management tools


It can be difficult to run every test page individually in order to check the results, so for example, if we have 100 YUI test pages, it means that we have to type 100 URLs in the browser's address bar, which is a very inefficient way of performing the tests. Fortunately, we can automate the running of the YUI test pages using Selenium (an automation web application testing tool) integration with YUI Test. This sort of integration can be done by the YUI Test Selenium Driver utility. Let's see how to work it.

Configuring YUI Test Selenium Driver

In order to configure the YUI Test Selenium Driver utility with the YUI tests, you need to do the following:

  1. Make sure that you have installed Java 5 (v1.5 or later) on your operating system.

  2. Download the following: