Files
zulip/zephyr/tests/frontend/casperjs/samples/customevents.js
Tim Abbott eadb2ea6d3 Update casperjs to 1.0.2.
(imported from commit 9e34b51c4588dce6419ea86024b2e8c06346a685)
2013-03-05 15:10:32 -05:00

17 lines
390 B
JavaScript

/*jshint strict:false*/
/*global CasperError console phantom require*/
var casper = require("casper").create();
// listening to a custom event
casper.on("google.loaded", function(title) {
this.echo("Google page title is " + title);
});
casper.start("http://google.com/", function() {
// emitting a custom event
this.emit("google.loaded", this.getTitle());
});
casper.run();