headless wd implementation using zombie
OTHER License
wd headless twin.
wd-zombie is a partial wd API implementation using zombie.
Note:
webdriver = require("wd-zombie")
assert = require("assert")
browser = webdriver.remote()
browser.init browserName: "zombie", ->
browser.get "http://saucelabs.com/test/guinea-pig", ->
browser.title (err, title) ->
assert.ok ~title.indexOf("I am a page title - Sauce Labs"), "Wrong title!"
browser.elementById "submit", (err, el) ->
browser.clickElement el, ->
browser.eval "window.location.href", (err, title) ->
console.log "Got title:" + title
assert.ok ~title.indexOf("#"), "Wrong title!"
browser.quit()
var webdriver = require('wd-zombie');
var assert = require('assert');
var browser = webdriver.remote();
browser.init({
browserName:'zombie'
}, function() {
browser.get("http://saucelabs.com/test/guinea-pig", function() {
browser.title(function(err, title) {
assert.ok(~title.indexOf('I am a page title - Sauce Labs'), 'Wrong title!');
browser.elementById('submit', function(err, el) {
browser.clickElement(el, function() {
browser.eval("window.location.href", function(err, title) {
console.log("Got title:" + title);
assert.ok(~title.indexOf('#'), 'Wrong title!');
browser.quit()
})
})
})
})
})
})
API identical to wd.
once: cake prepare:test
then: cake test