O'Reilly logo

Using Node.js for UI Testing by Pedro Teixeira

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 8. Testing AJAX

In this book, we have tested the filling of text fields on a form, clicking on buttons, and the resulting HTML document. This makes us ready to test a traditional form-based request-response application, but typical modern applications are usually more complex than that as they make use of asynchronous HTTP requests, that somehow update the document without having to refresh it. This is because they use AJAX.

Our application emits AJAX requests when presented with the to-do item list page; a user can drag an item and drop it in the new position. The code that we placed in the public/js/todos.js file catches the change and calls the server /todos/sort URL, changing the item order in the database.

Let's see how we can use Zombie ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required