Personally I like just using "wd" along with a promise helper library or two.
Here's an example using q-proxy (https://npmjs.org/package/q-proxy) and q-step (https://npmjs.org/package/q-step). The result is a pretty nice syntax (admittedly nicer in CoffeeScript than JavaScript) and a lot more flexibility to do other logic:
browser = QProxy(wd.promiseRemote("localhost", 4444)) QStep( -> browser.init(browserName: "firefox") -> browser.get("https://www.facebook.com/") -> browser.elementById("email").type(credentials.email) -> browser.elementById("pass").type(credentials.password) -> browser.elementById("u_0_b").click() )
browser .init({browserName:'chrome'}) .get("http://admc.io/wd/test-pages/guinea-pig.html") .title() .should.become('WD Tests') .elementById('i am a link') .click() .eval("window.location.href") .should.eventually.include('guinea-pig2') .back() .elementByCss('#comments').type('Bonjour!') .getValue().should.become('Bonjour!') .fin(function() { return browser.quit(); }) .done();
Personally I like just using "wd" along with a promise helper library or two.
Here's an example using q-proxy (https://npmjs.org/package/q-proxy) and q-step (https://npmjs.org/package/q-step). The result is a pretty nice syntax (admittedly nicer in CoffeeScript than JavaScript) and a lot more flexibility to do other logic:
Or wd's own built-in promise chaining is pretty similar to Nightwatch.js as well: