//this is nodejs environement
//declare your spooky instance here
spooky.start('http://example.com/the-page.html');
spooky.then(function () {
// this function runs in Casper's environment
//here you can access to mouse module. Example :
this.mouse.click(400, 300);
});
spooky.thenEvaluate(function () {
// this function runs in the page's environment
})
// this function (and the three spooky calls above) runs in Spooky's environment
spooky.run();
To access any Casper prototypes in its module, including other CasperJS modules, you have to do it inside the CasperJS scope.
As explained on https://github.com/SpookyJS/SpookyJS/wiki/Introduction :