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

Testing the to-do list

Now that we're done with the user registration and the session initiation, we are ready to test the core of our app, which is to manage to-do items. We will start by segregating that part of the application tests into a file of their own at test/todos.js, which may start with the following boilerplate:

var assert = require('assert'), Browser = require('zombie'), app = require('../app'), couchdb = require('../lib/couchdb'), dbName = 'todos', db = couchdb.use(dbName), fixtures = require('./fixtures'), login = require('./login'); describe('Todos', function() { before(function(done) { app.start(3000, done); }); after(function(done) { app.server.close(done); }); beforeEach(function(done) { db.get(fixtures.user.email, function(err, ...

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