I'm new to zombie and I've been trying out some tentative tests with it. Something I noticed was the tests were significantly slower than I expected. The "test" looked something like this:
The "boot" sequence for the SUT spits out progress to console along with timings and, combined with timestamping when the zombie browser "done" event was called I could see around a 500ms delay between the end of the boot sequence and zombie "done" event being fired.
Looking at the zombie code I can see that such a browser.visit has an implicit "wait until the event loop is clear". So, I tried using a completion function instead:
this.browser.wait(function (window) {
window.browser.dump();
return window.browser.query("li");
}, callback);
This immediately eliminated the ~500ms overhead.
So what was the browser doing for the next 500ms until the "done" event was called? To that end I added the browser dump in the "wait" completion function above. But the event loop in the resulting dump was empty.
So, are there any thoughts on what might account for that ~500ms overhead? (I suspect that it might be my nascent understanding of zombie that's the problem here.)
(Great idea for getting the browser to wait until the event loop is clear by the way!)
Thanks,
Alistair