Skip to content

Instantly share code, notes, and snippets.

@79yuuki
Created February 20, 2013 07:13
Show Gist options
  • Save 79yuuki/4993584 to your computer and use it in GitHub Desktop.
Save 79yuuki/4993584 to your computer and use it in GitHub Desktop.
Zombie.js test.
var Browser = require("zombie");
var assert = require("assert");
browser = new Browser();
browser.on('error', function(error) {
console.log(error);
});
// Load the page from AmebaBlog.
browser.visit("http://ameblo.jp/ran-ran-k/", function (err, browser, statusCode) {
// Return true if the status code is 2xx.
assert.ok(browser.success);
// Return the text contents of the selected elements.
assert.equal(browser.text('title'), '神戸蘭子オフィシャルブログ「神戸蘭子の☆diary☆」by Ameba');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment