OK, not “just like that”, a lot of changed since Zombie 0.13 hit the road on April 25th.
So may improvements, let’s go over the important ones, in no particular oder:
Promises Zombie now supports promises. Like this:
browser.visit("http://localhost:3000/").
then(function() {
assert.equal(browser.text("H1"), "Deferred zombies");
// Chaining works by returning a promise here
return browser.clickLink("Hit me");
}).
then(function() {
assert.equal(browser.text("H1"), "Ouch");
});
Proxies By popular request, Zombie now supports HTTP/S proxies. As simple as:
Browser.proxy = "http://myproxy:8080"
Authentication New API for setting authentication credentials:
// HTTP Basic takes user and password
browser.authenticate().basic("me", "secret")
// OAuth 2.0 Bearer takes an access token
browser.authenticate("example.com:443").bearer("12345")
// Show the authentication credentials in use
console.log(browser.authenticate().token)
IFrames Working so well, in fact, that we’re able to test Facebook Connect, with its popup and hidden XD and other shenanigans.
postMessage Yes.
Windows That too. You can open as many as you want with browser.open, and with brower.windows you can also list them all, get specific window by number or number, select the current window, and close it when done.
Server-sent Events Zombie now supports the EventSource object for testing Server-Sent Events. Side note, if you’re pushing updates to the browser in real time, forget long polling and Web Sockets and try the simpler Server-Sent Events.
Mocha Zombie’s test suite changes from Vows to Mocha. That shouldn’t affect your project, you can use whichever test suite you feel like using, but if you’re wondering what I recommend, Mocha is not perfect, but I have more luck with it.
Cookies Zombie now uses Tough Cookie, and things like parsing, encoding and host matching are much more reliable.
Scripts Upgraded to the most recent version of JSOM and Contextify, speeding up DOM processing and fixing some edge-case JavaScript evals. Also, fixed handling for old-style event handlers like onclick and onsubmit. Guess which largest social network is still using them?
HTML Switched back to using HTML5 parser by default, that means more forgiving HTML parsing, handling for inline scripts and … ugh … document.write.
about:blank New windows open in about:blank, and you can now set the window location to a javascript: expression. Handy if you’re testing bookmarklets and such; to actually evaluate JavaScript, use browser.evaluate.
Redirects Fixed redirects after POST, redirects that include a # document fragment and cookie handling when redirecting.
So yes, the big One Oh! So go build stuff, and may the testing gods smile upon you!