Created
December 14, 2012 12:23
-
-
Save yurfuwa-chan/4285130 to your computer and use it in GitHub Desktop.
mocha zombie
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 assert = require("assert") | |
var Browser = require("zombie") | |
describe("description", function() { | |
var browser = new Browser(); | |
var window = null; | |
var $ = null; | |
beforeEach(function(done){ | |
browser.visit("http://private.localhost/private/test/zombie-mocha/",function(){ | |
window = browser.window | |
$ = window.$ | |
done(); | |
}) | |
}) | |
it("click test",function(){ | |
$("button.push-me").click(); | |
assert.equal($("button.push-me").text(),"push-done"); | |
}) | |
}); |
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
<html> | |
<head> | |
<script src='http://code.jquery.com/jquery-1.7.2.min.js'></script> | |
<script> | |
window.onload = function(){ | |
$('.push-me').click(function(){ | |
$('.push-me').text("push-done"); | |
}); | |
}; | |
</script> | |
</head> | |
<body> | |
<h1>Title</h1> | |
<button class='push-me'>push-me</button> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment