zombie v2.0.0 Release Notes

Release Date: 2014-09-24 // over 9 years ago
  • 📚 Much much has changed, and the documentation has not caught up. Here's a partial and incomplete list.

    🏁 browser.tabs replaces browser.windows. Is now an array so you can access a 💻 tab directly (e.g. browser.tabs[0]), and also switch tabs more easily (e.g. 💻 browser.tabs.current = 0).

    🌲 console.log, console.error and friends now emit a console event from the 💻 browser. First argument is the output type (e.g. "log"), second is the formatted text.

    console.error and console.assert output to standard error (unless silent).

    💻 browser.url returns the URL of the current document.

    🆕 New browser has no open window. You need to call visit, open or set location.

    💻 Brand new implementation of browser history, fixes the "two URLs, one window" issue.

    💻 browser.request and browser.response return the request/response used for the last top-most page load. All other resources available from 💻 browser.resources. These replace lastRequest and lastResponse.

    ➕ Added browser.activeElement (removed browser.focus) and support for autofocus attribute.

    💻 Browser is now an EventEmitter so you can hook into it and instrument it.

    The wait method now takes two optional parameters: options that determine how long to wait and a callback. Options include duration, function and element, the later completing when the element is found in the document.

    The wait method's wait function now receives two parameters: the active window and how long the wait is for the next event (0 to Infinity).

    The visit method now passes applicable options to wait (duration, function, etc).

    The maxWait option is now called waitDuration and waitFor is no longer 👌 supported. waitDuration should be provided in milliseconds (maxWait was provided in seconds)

    Introducing assertsions to make your life all the more easier, for example:

    browser.element("h1") browser.text("h1", "Header") browser.elements("li", { atLeast: 5 }) browser.assert.url("http://example.com")

    ➕ Added support for deflat and gzip responses.

    🆕 New API for accessing resources, use browser.resources. Lots of goodies like 👍 allowing you to retrieve resources directory (resources.get, resources.post), define how resources are handled, emulate server failures 🤡 (resources.fail), delay responses (resources.delay), even mock responses 🤡 (resources.mock).

    676 tests
    12 sec to complete