In the API Documentation there is a snippet:
casper.waitFor(function check() {
return this.evaluate(function() {
return document.querySelectorAll('ul.your-list li').length > 2;
});
}, function then() {
this.captureSelector('yoursitelist.png', 'ul.your-list');
}, function timeout() {
this.echo("I can't haz my screenshot.").exit();
});
I need this, but in a coffeescript project. I tried to rewrite it into coffeescript but it didn’t work. Even if i let js2coffe do the job, i get some invalid coffeescript from valid javascript:
i dont know how to pass a list of named functions into another function correctly.