Libraries
=========

Promises
--------

Watai uses promises throughout its codebase. The chosen Promises/A implementation is `Q`, for its proper respect of the spec, and its very large API surface and helper methods.


Communication with WebDriver
----------------------------

The chosen implementation for WebDriver is [`wd`](https://github.com/admc/wd).

[`wd`](https://github.com/admc/wd/) is the only library out of [WebDriverJS](https://github.com/Camme/webdriverjs/), [Soda](https://github.com/LearnBoost/soda) and [Selenium-Webdriverjs](https://github.com/hacklschorsch/selenium-webdriverjs) to support the [Alert](http://selenium.googlecode.com/svn/trunk/docs/api/rb/Selenium/WebDriver/Alert.html) commands and to offer a `Q`-based [promises API](https://github.com/admc/wd/blob/master/examples/example.promise.chrome.js), sharing that library with Watai's core.


Convenience
-----------

The standard JS+Node libraries are a bit limited in convenience methods.

To ease development, [MooTools](http://mootools.net) is used, mainly for its class system but also for its elegant way of providing helper methods. Yes, it relies on extending core objects' prototypes. Sorry if you don't like that.


CLI
---

The RunnerCLI uses CLI animation for spinners, for example. That code was mostly taken from Mocha, as attributed.

Libraries such as [cli](https://github.com/chriso/cli/) or [Celeri](https://github.com/crcn/celeri) could be used instead. However, they are mostly focused on input rather than output, while Watai is not so concerned with user input. Moreover, Celeri's spinner is much uglier than Mocha's (`[\]` vs `◜`).


Logging
-------

Logging uses [winston](https://github.com/flatiron/winston).

This was a nice idea before views were properly implemented, but now it just feels overkill. Dependency on that library should be minimized, and retired when possible.
