wd headless twin.
wd-zombie is a partial wd API implementation using zombie.
Note:
- This is only worth using for simple pages, not relying heavily on Javacripts.
- This package wont be maintained/improved, at least until Zombie 2 is stable.
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.
- getComputedCss
- takeScreenshot
- isVisible
- waitForElement
- waitForVisible
- all the window + frame methods
- element.getTagName
- element.isDisplayed
- element.getComputedCss
- element.getValue
- waitForElementByClassName
- waitForElementByCssSelector
- waitForElementById
- waitForElementByName
- waitForElementByLinkText
- waitForElementByPartialLinkText
- waitForElementByTagName
- waitForElementByXPath
- waitForElementByCss
- waitForVisibleByClassName
- waitForVisibleByCssSelector
- waitForVisibleById
- waitForVisibleByName
- waitForVisibleByLinkText
- waitForVisibleByPartialLinkText
- waitForVisibleByTagName
- waitForVisibleByXPath
- waitForVisibleByCss
- retrieve the zombie browser object: zombieBrowser(done) -> done(err, browser)
once: cake prepare:test
then: cake test