Commit b49e6165 b49e6165ff5db2b323681795946ec92127e6e3e6 by Laurent Jouanneau

Refs #482: fixes test onerror.js

Error message for a ReferenceError is not equal
between Gecko and Webkit.
1 parent 1c4a5a49
......@@ -2,12 +2,19 @@
/*jshint strict:false*/
casper.test.begin('page.error event tests', 2, function(test) {
var error = {};
var expectedMessage;
if (phantom.casperEngine === 'phantomjs') {
expectedMessage = "ReferenceError: Can't find variable: plop";
}
else {
expectedMessage = "ReferenceError: plop is not defined";
}
casper.once("page.error", function onError(msg, trace) {
error.msg = msg;
error.trace = trace;
});
casper.start('tests/site/error.html', function() {
test.assertEquals(error.msg, "ReferenceError: Can't find variable: plop",
test.assertEquals(error.msg, expectedMessage,
"page.error event has been caught OK");
test.assertMatch(error.trace[0].file, /error.html/,
"page.error retrieves correct stack trace");
......