title: How does asynchronous javascript testing with zombie work?
body: <p><strong>The problem</strong>
  I have created an app that with express js and am trying to test it with zombie. I have written a number of tests to check the content on web page. I have checked the page manually and the content is correctly loading out of our database. However, when I run our tests I get unpredictable results.</p>
  
  <p><strong>These are our tests. The first test is failing.</strong></p>
  
  <pre><code>before(function(done) {
     models.Listing.create({name: "Studio Flat in London", text: "This is a great flat in zone one."});
     models.Listing.create({name: "The Fish Market", text: "description"});
     done();
  });
  
  beforeEach(function(done) {
     browser.visit('/', done);
  });
  
  it('each property should have a title', function(done) {
     expect(browser.html("body")).to.include("Studio Flat in London");
  
  });
  
  it('each property should have a title the fish market', function(){
     expect(browser.html("body")).to.include("The Fish Market");
  });
  </code></pre>
  
  <p>The first test fails because it cannot find the the text on the page. The second test passes.</p>
  
  <p><strong>Comments</strong>
  The strange part is that tests that look for the exact same type of content pass. Even tests that look for other content that depends on the database. For example I test for a title and a description and we can find the description.</p>
  
  <p><strong>Area that could be causing the problem.</strong>
  Is this a problem with Asynchronous Testing how does that work?
  How do I ensure the page is loaded before the tests run?</p>
  
  <p>Thanks </p>