Created
October 6, 2013 10:03
-
-
Save i/6851979 to your computer and use it in GitHub Desktop.
zombie help
This file contains hidden or 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'); | |
var browser = new Browser(); | |
logIn(); | |
console.log('logged in successfully'); | |
function logIn() { | |
browser.visit("https://www.pinterest.com/login/", function() { | |
console.log(browser.text("title")); | |
assert.ok(browser.success); | |
browser.wait(function() { | |
browser.fill(".loginUsername input", "[email protected]"); | |
assert.equal(browser.queryAll(".loginPassword input").length, 1); | |
browser.fill(".loginPassword input", "passwordy"); | |
browser.pressButton("Log in", function() { | |
assert.ok(browser.success); | |
assert.notEqual(browser.html().indexOf('pindb'), -1); | |
}); | |
}); | |
}) | |
} | |
function upload(file) { | |
browser.visit('http://www.pinterest.com/mitpindb/', function(){ | |
browser.clickLink("View Cart", function() { | |
}); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment