alert.js 283 Bytes Raw Blame History Permalink 1 2 3 4 5 6 7 8 9 10 11 12 13 /*global casper*/ /*jshint strict:false*/ var ok = false; casper.on('remote.alert', function(message) { ok = message === 'plop'; }); casper.start('tests/site/alert.html').run(function() { this.test.assert(ok, 'alert event has been intercepted'); this.test.done(); });