garris / garris/BackstopJS

Casper catch console errors\messages

Open
#553 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
7.2k
Forks
621
PR merge metrics
No merged PRs in 30d

Description

Good day. Now i got a problem with capturing console errors(or messages) with casperjs. I tried to add
console.js both for onBefore and onReady scripts. Can anyone suggest how to cath it?
```
"scenarios": [{
"label": "Homepage",
"url": "http://localhost:3000/",
"readyEvent": "",
"delay": null,
"misMatchThreshold": 0.1,
"requireSameDimensions": true,
"onBeforeScript": "casper/console.js"
}],
```
```
"report": ["CI"],
"engine": "phantom",
```
console.js

```
module.exports = function(casper, scenario, vp) {
casper.on('remote.message', function(message) {
this.echo("--------> " + message);
});
casper.on('remote.error', function(message) {
this.echo("--------> " + message);
});
};
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.