U
U
UksusoFF2016-10-25 17:55:25
JavaScript
UksusoFF, 2016-10-25 17:55:25

Is it possible to catch errors in requested resources in nightwatch.js?

In casper.js, it was implemented like this:

casper.on('resource.received', function(resource) {
    if (resource.status == 500) {
        casper.fail('Resource ' + resource.url + ' failed to load (' + resource.status + ')');
    }
});

Is it possible to implement this in nightwatch.js?
If the page is requested via a custom command, then it is more or less clear: https://github.com/nightwatchjs/nightwatch/issues/444
The problem is only with those pages that are loaded, for example, after clicking on a button or asynchronously.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question