I've released two little libraries that make working with promises a bit nicer in some cases:
QProxy is the more interesting one. It lets you chain method calls on unresolved promises like this:
browser = QProxy(wd.promiseRemote("localhost", 4444));
browser.elementById("some_id").click(); // returns a promise
instead of this:
browser = wd.promiseRemote("localhost", 4444);
browser.elementById("some_id").then(function(element) {
return element.click()
}); // returns a promise
The main thing to note is that elementById returns a Q promise (which is wrapped with a proxy), not a special object with a "click" method. You could call any method on it and it will be invoked once the promise is resolved, or the promise it returns will be rejected if the method doesn't exist.
It's similar in concept to Q's `promise.invoke("foo", ...args)` API (and in fact is implemented with that API), but much nicer looking syntax. Internally it uses JavaScript's new Proxy feature (node-proxy module on Node, should be trivial to adapt it for the browser)
QStep is just a simple control flow library similar to creationix's Step.
Here's an example using both QProxy and QStep with the "wd" WebDriver library to script a browser (admittedly it looks nicer in CoffeeScript than JS)
QStep(
-> browser.init(browserName: "firefox")
-> browser.elementById("email").type(credentials.email)
-> browser.elementById("pass").type(credentials.password)
-> browser.elementById("u_0_b").click()
)