I want to check for specific console logs during my tests with
it('should return logs', function(done) {
browser
.log('browser').then(function(logs){
console.log(logs);
})
...
});
What I get is:
[ { level: 'INFO',
message: 'https://localhost:3000/ 42:14 "foo"',
timestamp: 1485785320222 },
{ level: 'INFO',
message: 'https://localhost:3000/ 43:14 "bar"',
timestamp: 1485785320222 },
{ level: 'INFO',
message: 'https://localhost:3000/ 46:14 Array[6]',
timestamp: 1485785320225 },
{ level: 'SEVERE',
message: 'https://localhost:3000/favicon.ico - Failed to load resource: the server responded with a status of 404 (Not Found)',
timestamp: 1485785320298 } ]
So it should just returns a list of log entries like "foo" and "bar", so I can check if it is equal to my assumed value it should be.
I am now unsure if I need a "for..in" to build my method that I can reuse or just loop through the multiple objects and looking for logs.value.message and trim the part with "".