Created
February 20, 2013 07:13
-
-
Save 79yuuki/4993584 to your computer and use it in GitHub Desktop.
Zombie.js test.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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