Skip to content

Instantly share code, notes, and snippets.

@sfermigier
Created December 31, 2010 13:19
Show Gist options
  • Save sfermigier/760997 to your computer and use it in GitHub Desktop.
Save sfermigier/760997 to your computer and use it in GitHub Desktop.
Stefanes-macbook% cat test.js
require.paths.unshift('lib');
var zombie = require("index");
var browser = new zombie.Browser({ debug: true });
browser.visit("http://www.google.com/webhp", function (err, browser) {
//console.log(browser.html());
browser.
fill("q", "nuxeo").
pressButton("btnG", function(err, browser) {
assert.equal(browser.text("title"), "Welcome To Brains Depot");
});
});
Stefanes-macbook% node test.js
Zombie: GET http://www.google.com/webhp
Zombie: GET http://www.google.com/webhp => 200
Zombie: Running script from http://www.google.com/webhp:undefined:undefined<script>
Zombie: Running script from http://www.google.com/webhp:undefined:undefined<script>
Unexpected token ILLEGAL
Zombie: Running script from http://www.google.com/webhp:undefined:undefined<script>
Zombie: Running script from http://www.google.com/webhp:undefined:undefined<script>
google is not defined
Zombie: Running script from http://www.google.com/webhp:undefined:undefined<script>
Zombie: Running script from http://www.google.com/webhp:undefined:undefined<script>
Unexpected end of input
Zombie: Running script from http://www.google.com/webhp:undefined:undefined<script>
Zombie: Running script from http://www.google.com/webhp:undefined:undefined<script>
Unexpected end of input
Zombie: Running script from http://www.google.com/webhp:undefined:undefined<script>
google is not defined
Zombie: Running script from http://www.google.com/webhp:undefined:undefined<script>
Cannot read property 't' of undefined
Zombie: Running script from http://www.google.com/webhp:undefined:undefined<script>
Cannot read property 't' of undefined
Zombie: GET http://www.google.com/search?hl=en&source=hp&q=nuxeo&btnG=Google%20Search
Zombie: GET http://www.google.com/search?hl=en&source=hp&q=nuxeo&btnG=Google%20Search => 200
Zombie: Running script from http://www.google.com/search:undefined:undefined<script>
Zombie: Running script from http://www.google.com/search:undefined:undefined<script>
Unexpected token ILLEGAL
Zombie: Running script from http://www.google.com/search:undefined:undefined<script>
Zombie: Running script from http://www.google.com/search:undefined:undefined<script>
google is not defined
Zombie: Running script from http://www.google.com/search:undefined:undefined<script>
Zombie: Running script from http://www.google.com/search:undefined:undefined<script>
Unexpected end of input
Zombie: Running script from http://www.google.com/search:undefined:undefined<script>
Zombie: Running script from http://www.google.com/search:undefined:undefined<script>
Unexpected end of input
Zombie: Running script from http://www.google.com/search:undefined:undefined<script>
google is not defined
Zombie: Running script from http://www.google.com/search:undefined:undefined<script>
Cannot read property 't' of undefined
Zombie: Running script from http://www.google.com/search:undefined:undefined<script>
Cannot read property 't' of undefined
node.js:63
throw e;
^
ReferenceError: assert is not defined
at /Users/fermigier/git/zombie/test.js:14:7
at Browser.<anonymous> (lib/zombie/browser.js:81:18)
at lib/zombie/browser.js:9:60
at EventLoop.<anonymous> (lib/zombie/eventloop.js:137:18)
at Array.<anonymous> (lib/zombie/eventloop.js:2:61)
at EventEmitter._tickCallback (node.js:55:22)
at node.js:773:9
@hellp
Copy link

hellp commented Dec 31, 2010

I think you need an assert = require("assert")

@sfermigier
Copy link
Author

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment