I want to make sure my angular application does not log any errors in the console when loading the page where the application is located.
For that I use protractor and so far I have the following test:
spec.js:
describe('Protractor Demo App', function () {
it('should show all logs', function () {
browser.get('http://localhost:9050/#/10');
browser.sleep(20000)
browser.manage().logs().get('browser').then(function (browserLogs) {
console.log(browserLogs)
browserLogs.forEach(function (log) {
console.log("-------------------");
console.log(log.message);
if (log.level.value > 900) {
throw log.message;
}
});
});
});
});
when I look at the terminal output I get only the first element of the logs. However if I open the console in chrome and look at the logs myself there are more error and warning logs but they are not part of the terminal output. How is this possible, what did I miss ?
Aucun commentaire:
Enregistrer un commentaire